Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
e4094c0c
Commit
e4094c0c
authored
May 30, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update build scripts
parent
2e51fe20
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
28 deletions
+17
-28
build.py
build.py
+7
-14
Android.mk
native/jni/Android.mk
+1
-4
Application.mk
native/jni/Application.mk
+1
-6
Android.mk
native/jni/base/Android.mk
+8
-4
No files found.
build.py
View file @
e4094c0c
...
@@ -328,8 +328,6 @@ def build_binary(args):
...
@@ -328,8 +328,6 @@ def build_binary(args):
dump_flag_header
()
dump_flag_header
()
# Build shared executables
flag
=
''
flag
=
''
if
'magisk'
in
args
.
target
:
if
'magisk'
in
args
.
target
:
...
@@ -344,18 +342,6 @@ def build_binary(args):
...
@@ -344,18 +342,6 @@ def build_binary(args):
if
'magiskinit'
in
args
.
target
:
if
'magiskinit'
in
args
.
target
:
flag
+=
' B_PRELOAD=1'
flag
+=
' B_PRELOAD=1'
if
flag
:
run_ndk_build
(
flag
+
' B_SHARED=1'
)
clean_elf
()
# Then build static executables
flag
=
''
if
'magiskinit'
in
args
.
target
:
dump_bin_header
(
args
)
flag
+=
' B_INIT=1'
if
'resetprop'
in
args
.
target
:
if
'resetprop'
in
args
.
target
:
flag
+=
' B_PROP=1'
flag
+=
' B_PROP=1'
...
@@ -364,6 +350,13 @@ def build_binary(args):
...
@@ -364,6 +350,13 @@ def build_binary(args):
if
flag
:
if
flag
:
run_ndk_build
(
flag
)
run_ndk_build
(
flag
)
clean_elf
()
# magiskinit and busybox has to be built separately
if
'magiskinit'
in
args
.
target
:
dump_bin_header
(
args
)
run_ndk_build
(
'B_INIT=1'
)
if
'busybox'
in
args
.
target
:
if
'busybox'
in
args
.
target
:
run_ndk_build
(
'B_BB=1'
)
run_ndk_build
(
'B_BB=1'
)
...
...
native/jni/Android.mk
View file @
e4094c0c
...
@@ -78,7 +78,6 @@ LOCAL_SRC_FILES := \
...
@@ -78,7 +78,6 @@ LOCAL_SRC_FILES := \
init/twostage.cpp \
init/twostage.cpp \
init/selinux.cpp
init/selinux.cpp
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
endif
endif
...
@@ -109,7 +108,6 @@ LOCAL_SRC_FILES := \
...
@@ -109,7 +108,6 @@ LOCAL_SRC_FILES := \
boot/pattern.cpp \
boot/pattern.cpp \
boot/cpio.cpp
boot/cpio.cpp
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
endif
endif
...
@@ -145,7 +143,6 @@ LOCAL_SRC_FILES := \
...
@@ -145,7 +143,6 @@ LOCAL_SRC_FILES := \
resetprop/resetprop.cpp \
resetprop/resetprop.cpp \
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=resetprop_main
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=resetprop_main
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
endif
endif
...
@@ -170,7 +167,7 @@ endif
...
@@ -170,7 +167,7 @@ endif
########################
########################
include $(CLEAR_VARS)
include $(CLEAR_VARS)
LOCAL_MODULE:= libpolicy
LOCAL_MODULE
:= libpolicy
LOCAL_STATIC_LIBRARIES := \
LOCAL_STATIC_LIBRARIES := \
libbase \
libbase \
libsepol
libsepol
...
...
native/jni/Application.mk
View file @
e4094c0c
...
@@ -7,15 +7,10 @@ APP_PLATFORM := android-21
...
@@ -7,15 +7,10 @@ APP_PLATFORM := android-21
APP_THIN_ARCHIVE := true
APP_THIN_ARCHIVE := true
APP_STRIP_MODE := --strip-all
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
# Busybox should use stock libc.a
ifdef B_BB
ifdef B_BB
APP_PLATFORM := android-24
APP_PLATFORM := android-24
APP_LDFLAGS += -T jni/lto_fix.lds
ifeq ($(OS),Windows_NT)
ifeq ($(OS),Windows_NT)
APP_SHORT_COMMANDS := true
APP_SHORT_COMMANDS := true
endif
endif
...
...
native/jni/base/Android.mk
View file @
e4094c0c
...
@@ -3,7 +3,7 @@ LOCAL_PATH := $(call my-dir)
...
@@ -3,7 +3,7 @@ LOCAL_PATH := $(call my-dir)
# Magisk project-wide common code
# Magisk project-wide common code
include $(CLEAR_VARS)
include $(CLEAR_VARS)
LOCAL_MODULE:= libbase
LOCAL_MODULE
:= libbase
LOCAL_C_INCLUDES := jni/include $(LOCAL_PATH)/include out/generated
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
...
@@ -18,10 +18,14 @@ LOCAL_SRC_FILES := \
...
@@ -18,10 +18,14 @@ LOCAL_SRC_FILES := \
stream.cpp
stream.cpp
include $(BUILD_STATIC_LIBRARY)
include $(BUILD_STATIC_LIBRARY)
# Workaround "hacky" libc.a missing symbols
# All static executables should link with libcompat
# To build Magisk with vanilla NDK, remove all usage of libcompat
include $(CLEAR_VARS)
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
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)
include $(BUILD_STATIC_LIBRARY)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment