Skip to content

Commit d86184a

Browse files
committed
Build su as static.
With so many different versions of Android, using a dynamically linked binary is just not practical, since things can be wildly different on different versions.
1 parent 382d1e3 commit d86184a

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

Android.mk

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,17 @@ LOCAL_PATH := $(call my-dir)
22
include $(CLEAR_VARS)
33

44
LOCAL_MODULE := su
5-
LOCAL_SRC_FILES := su.c db.c activity.cpp
6-
7-
SU_SHARED_LIBRARIES := liblog libsqlite
8-
ifeq ($(PLATFORM_SDK_VERSION),4)
9-
LOCAL_CFLAGS += -DSU_LEGACY_BUILD
10-
SU_SHARED_LIBRARIES += libandroid_runtime
11-
else
12-
SU_SHARED_LIBRARIES += libcutils libbinder libutils
13-
LOCAL_MODULE_TAGS := debug,eng
14-
endif
5+
LOCAL_SRC_FILES := su.c db.c activity.c
156

167
LOCAL_C_INCLUDES += external/sqlite/dist
178

18-
LOCAL_SHARED_LIBRARIES := $(SU_SHARED_LIBRARIES)
9+
LOCAL_STATIC_LIBRARIES := \
10+
liblog \
11+
libsqlite \
12+
libc \
1913

2014
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
15+
LOCAL_MODULE_TAGS := eng debug
16+
LOCAL_FORCE_STATIC_EXECUTABLE := true
2117

22-
include $(BUILD_EXECUTABLE)
18+
include $(BUILD_EXECUTABLE)

0 commit comments

Comments
 (0)