ld 无法识别的仿真模式 aarch64linux

Sim*_*on 7 linker cmake ld

在 CMake 中运行 make 时,我只收到一条错误,提示 /usr/bin/ld 无法识别仿真模式 aarch64linux。

我正在尝试为 Android 构建 DualBootPatcher 应用程序,这是错误:

/usr/bin/ld: unrecognised emulation mode: aarch64linux Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe clang: error: linker command failed with exit code 1 (use -v to see invocation) make[5]: *** [misc/CMakeFiles/fsck-wrapper.dir/build.make:76: misc/fsck-wrapper] Error 1 make[4]: *** [CMakeFiles/Makefile2:1786: misc/CMakeFiles/fsck-wrapper.dir/all] Error 2 make[3]: *** [Makefile:163: all] Error 2 make[2]: *** [android/CMakeFiles/android-system_arm64-v8a.dir/build.make:111: android/android-system_arm64-v8a-prefix/src/android-system_arm64-v8a-stamp/android-system_arm64-v8a-build] Error 2 make[1]: *** [CMakeFiles/Makefile2:1868: android/CMakeFiles/android-system_arm64-v8a.dir/all] Error 2 make: *** [Makefile:163: all] Error 2>

我正在运行最新的 Cmake 和 binutils。还尝试重新安装 binutils。我不是开发人员,所以如果您能解释一下就好了^^ 有人有解决方案吗?

Luk*_*e F 6

从输出来自 的事实来看,这个问题很清楚/usr/bin/ld。这是系统ld,而不是ldNDK 附带的。您应该调查为什么ld要执行此操作,例如通过strace.

对我来说,这是一个文件权限问题 - NDK zip 文件在没有执行权限的情况下提取,因此工具链二进制文件被默默地忽略。过了一会儿chmod +x,一切都很好。