diff --git a/build.py b/build.py index a1fa581a4..632edb130 100755 --- a/build.py +++ b/build.py @@ -257,8 +257,7 @@ def run_cargo_build(args): write_if_diff(op.join(native_gen_path, f'{p}-rs.hpp'), text) # Start building the actual build commands - cmds = [cargo, 'build', '-Z', 'build-std=std,panic_abort', - '-Z', 'build-std-features=panic_immediate_abort'] + cmds = [cargo, 'build'] for target in targets: cmds.append('-p') cmds.append(target) diff --git a/gradle.properties b/gradle.properties index c1634f5e2..34b94ab34 100644 --- a/gradle.properties +++ b/gradle.properties @@ -28,4 +28,4 @@ android.nonTransitiveRClass=true # Magisk magisk.stubVersion=36 magisk.versionCode=26101 -magisk.ondkVersion=r25.2 +magisk.ondkVersion=r25.3 diff --git a/native/src/.cargo/config.toml b/native/src/.cargo/config.toml index 6f2e10465..259118ad4 100644 --- a/native/src/.cargo/config.toml +++ b/native/src/.cargo/config.toml @@ -1,4 +1,25 @@ [build] -# This is only used to make the IDE happy, the actual compilation will -# have the target overriden by command-line +# Choose arm64 as the default target to make the IDE happy. +# The actual compilation will have the target overriden by command-line. target = "aarch64-linux-android" + +[unstable] +build-std = ["std", "panic_abort"] +build-std-features = ["panic_immediate_abort"] +profile-rustflags = true + +# Workaround bug for undefined symbol errors that occur with the +# combination of `-Zbuild-std`, `opt-level = "z"`, and `lto = true`. +# compiler_builtins are expected to be built with special flags. +# https://github.com/rust-lang/rust/issues/108853 +# https://github.com/rust-lang/wg-cargo-std-aware/issues/62 + +[profile.release.package.compiler_builtins] +rustflags = ["-Zshare-generics=off"] +overflow-checks = false +debug-assertions = false + +[profile.dev.package.compiler_builtins] +rustflags = ["-Zshare-generics=off"] +overflow-checks = false +debug-assertions = false