dodorare / crossbow

Cross-Platform build tools and toolkit for games and game engines written in Rust! 🦀
https://crossbow.dodorare.com/
Apache License 2.0
201 stars 13 forks source link

aarch64-linux-android-ld.gold not found in the newest Android SDK, NDK #69

Closed beling closed 2 years ago

beling commented 2 years ago

I've just installed android-studio and required (the newest) SDK, NDK, set the paths, generated the macroquad project and I cannot compile it (my system is linux debian).

rossbundle build android --quad results in error:

error: linker `/home/qwak/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ld.gold` not found

ls /home/qwak/Android/Sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/ prints:

aarch64-linux-android21-clang       clang                         llvm-config
aarch64-linux-android21-clang++     clang++                       llvm-cov
aarch64-linux-android22-clang       clang-12                      llvm-cxxfilt
aarch64-linux-android22-clang++     clang-check                   llvm-dis
aarch64-linux-android23-clang       clangd                        llvm-dwarfdump
aarch64-linux-android23-clang++     clang-format                  llvm-dwp
aarch64-linux-android24-clang       clang-tidy                    llvm-lib
aarch64-linux-android24-clang++     clang-tidy.real               llvm-link
aarch64-linux-android26-clang       dsymutil                      llvm-lipo
aarch64-linux-android26-clang++     git-clang-format              llvm-modextract
aarch64-linux-android27-clang       i686-linux-android16-clang    llvm-nm
aarch64-linux-android27-clang++     i686-linux-android16-clang++  llvm-objcopy
aarch64-linux-android28-clang       i686-linux-android17-clang    llvm-objdump
aarch64-linux-android28-clang++     i686-linux-android17-clang++  llvm-profdata
aarch64-linux-android29-clang       i686-linux-android18-clang    llvm-ranlib
aarch64-linux-android29-clang++     i686-linux-android18-clang++  llvm-rc
aarch64-linux-android30-clang       i686-linux-android19-clang    llvm-readelf
aarch64-linux-android30-clang++     i686-linux-android19-clang++  llvm-readobj
aarch64-linux-android31-clang       i686-linux-android21-clang    llvm-size
aarch64-linux-android31-clang++     i686-linux-android21-clang++  llvm-strings
aarch64-linux-android-as            i686-linux-android22-clang    llvm-strip
arm-linux-androideabi-as            i686-linux-android22-clang++  llvm-symbolizer
armv7a-linux-androideabi16-clang    i686-linux-android23-clang    remote_toolchain_inputs
armv7a-linux-androideabi16-clang++  i686-linux-android23-clang++  sancov
armv7a-linux-androideabi17-clang    i686-linux-android24-clang    sanstats
armv7a-linux-androideabi17-clang++  i686-linux-android24-clang++  scan-build
armv7a-linux-androideabi18-clang    i686-linux-android26-clang    scan-view
armv7a-linux-androideabi18-clang++  i686-linux-android26-clang++  x86_64-linux-android21-clang
armv7a-linux-androideabi19-clang    i686-linux-android27-clang    x86_64-linux-android21-clang++
armv7a-linux-androideabi19-clang++  i686-linux-android27-clang++  x86_64-linux-android22-clang
armv7a-linux-androideabi21-clang    i686-linux-android28-clang    x86_64-linux-android22-clang++
armv7a-linux-androideabi21-clang++  i686-linux-android28-clang++  x86_64-linux-android23-clang
armv7a-linux-androideabi22-clang    i686-linux-android29-clang    x86_64-linux-android23-clang++
armv7a-linux-androideabi22-clang++  i686-linux-android29-clang++  x86_64-linux-android24-clang
armv7a-linux-androideabi23-clang    i686-linux-android30-clang    x86_64-linux-android24-clang++
armv7a-linux-androideabi23-clang++  i686-linux-android30-clang++  x86_64-linux-android26-clang
armv7a-linux-androideabi24-clang    i686-linux-android31-clang    x86_64-linux-android26-clang++
armv7a-linux-androideabi24-clang++  i686-linux-android31-clang++  x86_64-linux-android27-clang
armv7a-linux-androideabi26-clang    i686-linux-android-as         x86_64-linux-android27-clang++
armv7a-linux-androideabi26-clang++  ld                            x86_64-linux-android28-clang
armv7a-linux-androideabi27-clang    ld64.lld                      x86_64-linux-android28-clang++
armv7a-linux-androideabi27-clang++  ld.lld                        x86_64-linux-android29-clang
armv7a-linux-androideabi28-clang    lld                           x86_64-linux-android29-clang++
armv7a-linux-androideabi28-clang++  lldb                          x86_64-linux-android30-clang
armv7a-linux-androideabi29-clang    lldb-argdumper                x86_64-linux-android30-clang++
armv7a-linux-androideabi29-clang++  lldb.sh                       x86_64-linux-android31-clang
armv7a-linux-androideabi30-clang    lld-link                      x86_64-linux-android31-clang++
armv7a-linux-androideabi30-clang++  llvm-addr2line                x86_64-linux-android-as
armv7a-linux-androideabi31-clang    llvm-ar                       yasm
armv7a-linux-androideabi31-clang++  llvm-as
bisect_driver.py                    llvm-cfi-verify

I've tried (with the same result) both version of the crossbow, the latest release and the one from master.

enfipy commented 2 years ago

Hey, this is a known issue with ndk r23+ - https://github.com/dodorare/crossbow/blob/main/docs/install-linux-android.md#known-issues. Currently, the only option is to downgrade the ndk version.

beling commented 2 years ago

Note that the issue is a bit different, as in my case even the linker itself was not been found. However, you have right... I tried to change aarch64-linux-android-ld.gold to ld in compile_macroquad.rs, and I got the message about missing gcc lib. Note that the problem has been worked around in cargo-apk: https://github.com/rust-windowing/android-ndk-rs/releases/tag/cargo-apk-0.8.2

BTW. Thank you for your great work!

enfipy commented 2 years ago

@beling Hey, can you test your project with the current main of crossbundle?