升级到macOS Catalina之后,我的Unity 2018.3无法使用il2cpp在Android上编译。
在链接过程中似乎发生了错误。
以下是输出:
/Users/myuser/Applications/android-ndk-r16b/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ @"/var/folders/vq/04653nwj79jdpld6_lndr1lw0000gn/T/tmpXtN5uB.tmp" -o "/Users/myuser/Documents/Unity/MyProject/Library/il2cpp_android_arm64-v8a/il2cpp_cache/linkresult_44B2FEF258539B2B7FE0DE0B1C88B423/libil2cpp.so" -shared -Wl,-soname,libil2cpp.so -Wl,--no-undefined -Wl,-z,noexecstack -Wl,--gc-sections -Wl,--build-id --sysroot "/Users/myuser/Applications/android-ndk-r16b/platforms/android-21/arch-arm64" -gcc-toolchain "/Users/myuser/Applications/android-ndk-r16b/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64" -target aarch64-none-linux-android -Wl,--wrap,sigaction -L "/Users/myuser/Applications/android-ndk-r16b/sources/cxx-stl/gnu-libstdc++/4.9/libs/arm64-v8a" -lgnustl_static -llog -Xlinker -Map="/Users/myuser/Documents/Unity/MyProject/Library/il2cpp_android_arm64-v8a/il2cpp_cache/linkresult_44B2FEF258539B2B7FE0DE0B1C88B423/libil2cpp.map" -rdynamic -fuse-ld=bfd
clang++: error: invalid linker name in argument '-fuse-ld=bfd'
就像在NDK中一样,darwin-x86_64没有链接器ld-bfd
:(
您对如何解决有任何想法吗?
答案 0 :(得分:0)
我发现了一种(确实很糟糕)的解决方法,可以正常工作。
导航到您的NDK文件夹,然后:
cd toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/aarch64-linux-android/bin
现在,将gold
链接程序复制为bfd
:
cp ld.gold ld.bfd
不确定它是否有任何副作用,但是,它可以编译!