首页
社区
课程
招聘
未解决 [求助]编译旧版Magisk 遇到rustc版本报错 100雪币
发表于: 2024-10-23 10:13 418

未解决 [求助]编译旧版Magisk 遇到rustc版本报错 100雪币

2024-10-23 10:13
418

当我使用Magisk 版本自带的编译工具,报如下错误

1
2
3
4
5
6
7
8
9
10
11
* Building binaries: magisk magiskinit magiskboot magiskpolicy busybox
 
error: failed to compile `cxxbridge-cmd v1.0.94 (\Magisk-Delta\native\src\external\cxx-rs\gen\cmd)`, intermediate artifacts can be found at `\Magisk-Delta\native\src\external\cxx-rs\target`
 
Caused by:
  package `clap_builder v4.5.20` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.65.0-dev
  Either upgrade to rustc 1.74 or newer, or use
  cargo update -p clap_builder@4.5.20 --precise ver
  where `ver` is the latest version of `clap_builder` supporting rustc 1.65.0-dev
 
cxxbridge-cmd installation failed!

尝试替换高版本ondk里的rust,就遇到LLVM过低

1
2
3
4
5
6
7
8
9
10
ld: error: src/../out/armeabi-v7a/libmagiskboot-rs.a(magiskboot-83db140de1a473e1.base-343f7d8b4ba194eb.5f724wd4q121trbu.rcgu.o.rcgu.o): Unknown attribute kind (86) (Producer: 'LLVM17.0.0-rust-1.75.0-nightly' Reader: 'LLVM 15.0.0')
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [D:/Android/SDK/ndk/magisk/build/../build/core/build-binary.mk:670: obj/local/armeabi-v7a/magiskboot] Error 1
make: *** Waiting for unfinished jobs....
ld: error: src/../out/armeabi-v7a/libmagiskpolicy-rs.a(base-343f7d8b4ba194eb.5f724wd4q121trbu.rcgu.o): Unknown attribute kind (86) (Producer: 'LLVM17.0.0-rust-1.75.0-nightly' Reader: 'LLVM 15.0.0')
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [D:/Android/SDK/ndk/magisk/build/../build/core/build-binary.mk:670: obj/local/armeabi-v7a/magiskpolicy] Error 1
ld: error: src/../out/arm64-v8a/libmagiskboot-rs.a(magiskboot-2a314aaf11ee3221.base-fd583e110269027c.51a9oczz9h1q8yv5.rcgu.o.rcgu.o): Unknown attribute kind (86) (Producer: 'LLVM17.0.0-rust-1.75.0-nightly' Reader: 'LLVM 15.0.0')
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [D:/Android/SDK/ndk/magisk/build/../build/core/build-binary.mk:670: obj/local/arm64-v8a/magiskboot] Error 1

可能是替换高版本rustc导致的吧,索性直接用高版本ondk,修改build.py 的ondk版本校验,出现找不到__vsnprintf_chk

1
2
3
4
5
6
7
8
9
ld.lld: error: undefined symbol: __vsnprintf_chk
>>> referenced by stdio.h:53 (/home/xxx/Android/Sdk/ndk/magisk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/bits/fortify/stdio.h:53)
>>>               lto.tmp:(fmt_and_log_with_rs(LogLevel, char const*, std::__va_list))
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/home/xxx/Android/Sdk/ndk/magisk/build/core/build-binary.mk:667:obj/local/armeabi-v7a/magiskboot] 错误 1
make: *** 正在等待未完成的任务....
[x86] Executable     : magiskboot
[arm64-v8a] Executable     : magiskboot
[x86_64] Executable     : magiskboot

[注意]传递专业知识、拓宽行业人脉——看雪讲师团队等你加入!

收藏
免费 0
支持
分享
最新回复 (0)
游客
登录 | 注册 方可回帖
返回
//