diff --git a/build.py b/build.py index 4d901d6ac..f0262ed92 100755 --- a/build.py +++ b/build.py @@ -257,8 +257,6 @@ def run_cargo(cmds, triple="aarch64-linux-android"): env["PATH"] = f'{rust_bin}{os.pathsep}{env["PATH"]}' env["CARGO_BUILD_RUSTC"] = op.join(rust_bin, "rustc" + EXE_EXT) env["RUSTFLAGS"] = f"-Clinker-plugin-lto -Zthreads={min(8, cpu_count)}" - env["TARGET_CC"] = op.join(llvm_bin, "clang" + EXE_EXT) - env["TARGET_CFLAGS"] = f"--target={triple}23" return execv([cargo, *cmds], env) diff --git a/buildSrc/src/main/java/Setup.kt b/buildSrc/src/main/java/Setup.kt index 81f4e02ef..b5c887ec3 100644 --- a/buildSrc/src/main/java/Setup.kt +++ b/buildSrc/src/main/java/Setup.kt @@ -72,7 +72,7 @@ fun Project.setupCommon() { compileSdkVersion(34) buildToolsVersion = "34.0.0" ndkPath = "$sdkDirectory/ndk/magisk" - ndkVersion = "26.2.11394342" + ndkVersion = "27.0.11718014" defaultConfig { minSdk = 23 diff --git a/gradle.properties b/gradle.properties index 88fc4689c..89556d5a8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,4 +28,4 @@ android.nonFinalResIds=false # Magisk magisk.stubVersion=39 magisk.versionCode=27002 -magisk.ondkVersion=r26.4 +magisk.ondkVersion=r27.0 diff --git a/native/src/Android.mk b/native/src/Android.mk index 91822e1c4..dc84fa31b 100644 --- a/native/src/Android.mk +++ b/native/src/Android.mk @@ -76,11 +76,10 @@ LOCAL_SRC_FILES := \ init/selinux.cpp \ init/init-rs.cpp -LOCAL_LDFLAGS := -static -T src/lto_fix.lds +LOCAL_LDFLAGS := -static ifdef B_CRT0 LOCAL_STATIC_LIBRARIES += crt0 -LOCAL_LDFLAGS := endif include $(BUILD_EXECUTABLE) @@ -107,11 +106,11 @@ LOCAL_SRC_FILES := \ boot/format.cpp \ boot/boot-rs.cpp -LOCAL_LDFLAGS := -static -T src/lto_fix.lds +LOCAL_LDFLAGS := -static ifdef B_CRT0 LOCAL_STATIC_LIBRARIES += crt0 -LOCAL_LDFLAGS := -lm +LOCAL_LDFLAGS += -lm endif include $(BUILD_EXECUTABLE) diff --git a/native/src/Application.mk b/native/src/Application.mk index 69cf63bc3..9b880bf6f 100644 --- a/native/src/Application.mk +++ b/native/src/Application.mk @@ -17,10 +17,9 @@ NDK_APP_OUT := ./obj/nolibc endif -# Busybox should use stock libc.a +# Busybox should use a newer libc.a ifdef B_BB APP_PLATFORM := android-26 -APP_LDFLAGS += -T src/lto_fix.lds ifeq ($(OS),Windows_NT) APP_SHORT_COMMANDS := true endif diff --git a/native/src/external/busybox b/native/src/external/busybox index c8a45a342..b0f643d53 160000 --- a/native/src/external/busybox +++ b/native/src/external/busybox @@ -1 +1 @@ -Subproject commit c8a45a3422e38b62a38ba7f5e4e91d3dcacf78f2 +Subproject commit b0f643d5353c2c0156358d87043e25a77bae3047 diff --git a/native/src/external/crt0 b/native/src/external/crt0 index 6f5a10ac1..17233ab90 160000 --- a/native/src/external/crt0 +++ b/native/src/external/crt0 @@ -1 +1 @@ -Subproject commit 6f5a10ac125e5f8f83b022b5196deba8051b3e26 +Subproject commit 17233ab90ea37dd86b1867b22c3f243e8a98cd10 diff --git a/native/src/lto_fix.lds b/native/src/lto_fix.lds deleted file mode 100644 index 7f329730f..000000000 --- a/native/src/lto_fix.lds +++ /dev/null @@ -1,12 +0,0 @@ -SECTIONS { - .init_array : { - *(SORT_BY_INIT_PRIORITY(.init_array.*)) - *(EXCLUDE_FILE(*crtend_android.o) .init_array) - } -} INSERT AFTER .fini_array; -SECTIONS { - .fini_array : { - *(SORT_BY_INIT_PRIORITY(.fini_array.*)) - *(EXCLUDE_FILE(*crtend_android.o) .fini_array) - } -} INSERT BEFORE .init_array;