mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 12:57:39 +00:00
Separate libc.a hacks into its own component
This commit is contained in:
parent
9fa096c6f4
commit
7f65f7d3ca
@ -8,7 +8,12 @@ ifdef B_MAGISK
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := magisk
|
LOCAL_MODULE := magisk
|
||||||
LOCAL_STATIC_LIBRARIES := libnanopb libsystemproperties libutils-shared libphmap libxhook
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
libutils \
|
||||||
|
libnanopb \
|
||||||
|
libsystemproperties \
|
||||||
|
libphmap \
|
||||||
|
libxhook
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
core/applets.cpp \
|
core/applets.cpp \
|
||||||
@ -47,7 +52,10 @@ ifdef B_INIT
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := magiskinit
|
LOCAL_MODULE := magiskinit
|
||||||
LOCAL_STATIC_LIBRARIES := libsepol libxz libutils
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
libutilx \
|
||||||
|
libsepol \
|
||||||
|
libxz
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
init/init.cpp \
|
init/init.cpp \
|
||||||
@ -72,7 +80,15 @@ ifdef B_BOOT
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := magiskboot
|
LOCAL_MODULE := magiskboot
|
||||||
LOCAL_STATIC_LIBRARIES := libmincrypt liblzma liblz4 libbz2 libfdt libutils libz libzopfli
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
libutilx \
|
||||||
|
libmincrypt \
|
||||||
|
liblzma \
|
||||||
|
liblz4 \
|
||||||
|
libbz2 \
|
||||||
|
libfdt \
|
||||||
|
libz \
|
||||||
|
libzopfli
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
magiskboot/main.cpp \
|
magiskboot/main.cpp \
|
||||||
@ -94,7 +110,9 @@ ifdef B_POLICY
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := magiskpolicy
|
LOCAL_MODULE := magiskpolicy
|
||||||
LOCAL_STATIC_LIBRARIES := libsepol libutils
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
libutilx \
|
||||||
|
libsepol
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
core/applet_stub.cpp \
|
core/applet_stub.cpp \
|
||||||
@ -114,7 +132,10 @@ ifdef B_PROP
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := resetprop
|
LOCAL_MODULE := resetprop
|
||||||
LOCAL_STATIC_LIBRARIES := libnanopb libsystemproperties libutils
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
libutilx \
|
||||||
|
libnanopb \
|
||||||
|
libsystemproperties
|
||||||
|
|
||||||
LOCAL_SRC_FILES := \
|
LOCAL_SRC_FILES := \
|
||||||
core/applet_stub.cpp \
|
core/applet_stub.cpp \
|
||||||
@ -132,7 +153,10 @@ ifneq (,$(wildcard jni/test.cpp))
|
|||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE := test
|
LOCAL_MODULE := test
|
||||||
LOCAL_STATIC_LIBRARIES := libutils-shared libphmap
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
|
libutils \
|
||||||
|
libphmap
|
||||||
|
|
||||||
LOCAL_SRC_FILES := test.cpp
|
LOCAL_SRC_FILES := test.cpp
|
||||||
include $(BUILD_EXECUTABLE)
|
include $(BUILD_EXECUTABLE)
|
||||||
|
|
||||||
|
@ -1,15 +1,6 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
|
|
||||||
# All Magisk common code lives here
|
# Magisk project-wide common code
|
||||||
|
|
||||||
UTILS_SRC_FILES := \
|
|
||||||
new.cpp \
|
|
||||||
files.cpp \
|
|
||||||
misc.cpp \
|
|
||||||
selinux.cpp \
|
|
||||||
logging.cpp \
|
|
||||||
xwrap.cpp \
|
|
||||||
stream.cpp
|
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE:= libutils
|
LOCAL_MODULE:= libutils
|
||||||
@ -17,14 +8,25 @@ LOCAL_C_INCLUDES := jni/include $(LOCAL_PATH)/include out/generated
|
|||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
||||||
LOCAL_EXPORT_STATIC_LIBRARIES := libcxx
|
LOCAL_EXPORT_STATIC_LIBRARIES := libcxx
|
||||||
LOCAL_STATIC_LIBRARIES := libcxx
|
LOCAL_STATIC_LIBRARIES := libcxx
|
||||||
LOCAL_SRC_FILES := $(UTILS_SRC_FILES) missing.cpp
|
LOCAL_SRC_FILES := \
|
||||||
|
new.cpp \
|
||||||
|
files.cpp \
|
||||||
|
misc.cpp \
|
||||||
|
selinux.cpp \
|
||||||
|
logging.cpp \
|
||||||
|
xwrap.cpp \
|
||||||
|
stream.cpp
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# libutils + "hacky" libc.a missing symbols
|
||||||
|
|
||||||
|
# To build Magisk with vanilla NDK, simply
|
||||||
|
# remove compat.cpp from sources, or replace
|
||||||
|
# all usage of libutilx to libutils
|
||||||
|
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
LOCAL_MODULE:= libutils-shared
|
LOCAL_MODULE:= libutilx
|
||||||
LOCAL_C_INCLUDES := jni/include $(LOCAL_PATH)/include out/generated
|
LOCAL_EXPORT_STATIC_LIBRARIES := libutils
|
||||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES)
|
LOCAL_STATIC_LIBRARIES := libutils
|
||||||
LOCAL_EXPORT_STATIC_LIBRARIES := libcxx
|
LOCAL_SRC_FILES := compat/compat.cpp
|
||||||
LOCAL_STATIC_LIBRARIES := libcxx
|
|
||||||
LOCAL_SRC_FILES := $(UTILS_SRC_FILES)
|
|
||||||
include $(BUILD_STATIC_LIBRARY)
|
include $(BUILD_STATIC_LIBRARY)
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
#include "logging.hpp"
|
#include <logging.hpp>
|
||||||
|
|
||||||
#undef _FORTIFY_SOURCE
|
#undef _FORTIFY_SOURCE
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user