Update build scripts

This commit is contained in:
topjohnwu
2022-05-30 03:47:31 -07:00
parent 2e51fe20a1
commit e4094c0caa
4 changed files with 17 additions and 28 deletions

View File

@ -78,7 +78,6 @@ LOCAL_SRC_FILES := \
init/twostage.cpp \
init/selinux.cpp
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
endif
@ -109,7 +108,6 @@ LOCAL_SRC_FILES := \
boot/pattern.cpp \
boot/cpio.cpp
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
endif
@ -145,7 +143,6 @@ LOCAL_SRC_FILES := \
resetprop/resetprop.cpp \
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=resetprop_main
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
endif
@ -170,7 +167,7 @@ endif
########################
include $(CLEAR_VARS)
LOCAL_MODULE:= libpolicy
LOCAL_MODULE := libpolicy
LOCAL_STATIC_LIBRARIES := \
libbase \
libsepol

View File

@ -7,15 +7,10 @@ APP_PLATFORM := android-21
APP_THIN_ARCHIVE := true
APP_STRIP_MODE := --strip-all
ifndef B_SHARED
# Fix static variables' ctor/dtor when using LTO
# See: https://github.com/android/ndk/issues/1461
APP_LDFLAGS += -T jni/lto_fix.lds
endif
# Busybox should use stock libc.a
ifdef B_BB
APP_PLATFORM := android-24
APP_LDFLAGS += -T jni/lto_fix.lds
ifeq ($(OS),Windows_NT)
APP_SHORT_COMMANDS := true
endif

View File

@ -3,7 +3,7 @@ LOCAL_PATH := $(call my-dir)
# Magisk project-wide common code
include $(CLEAR_VARS)
LOCAL_MODULE:= libbase
LOCAL_MODULE := libbase
LOCAL_C_INCLUDES := jni/include $(LOCAL_PATH)/include out/generated
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
LOCAL_EXPORT_STATIC_LIBRARIES := libcxx
@ -18,10 +18,14 @@ LOCAL_SRC_FILES := \
stream.cpp
include $(BUILD_STATIC_LIBRARY)
# Workaround "hacky" libc.a missing symbols
# To build Magisk with vanilla NDK, remove all usage of libcompat
# All static executables should link with libcompat
include $(CLEAR_VARS)
LOCAL_MODULE:= libcompat
LOCAL_MODULE := libcompat
# Workaround "hacky" libc.a missing symbols
# To build Magisk with vanilla NDK, comment out the next line
LOCAL_SRC_FILES := compat/compat.cpp
# Fix static variables' ctor/dtor when using LTO
# See: https://github.com/android/ndk/issues/1461
LOCAL_EXPORT_LDLIBS := -static -T jni/lto_fix.lds
include $(BUILD_STATIC_LIBRARY)