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

@@ -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)