Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get the linker to use x64 target #169

Closed
Seldom-SE opened this issue Feb 23, 2024 · 3 comments
Closed

Can't get the linker to use x64 target #169

Seldom-SE opened this issue Feb 23, 2024 · 3 comments

Comments

@Seldom-SE
Copy link

Despite setting the architecture
x build --device adb:emulator-5554 --arch x64
it still tries to use aarch64-linux-android

info: component 'rust-std' for target 'aarch64-linux-android' is up to date
// ...
error: linking with `clang` failed: exit status: 1
  |
// ...
  = note: ld.lld: error: /home/seldom/.cache/x/Android.ndk/usr/lib/x86_64-linux-android/33/crtbegin_so.o is incompatible with aarch64linux
          ld.lld: error: /tmp/rustcPsKtaN/symbols.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.10igtzs7ksk7cz79.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.111d2uc2pxob9jnz.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.112h6ifimoncc7yw.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.11npk11elk3u1ey4.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.126hkn995b0mvt7y.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.12sqfvmnp9lyh4u9.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.1330uz87oy8dd6qk.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.1334295v68h8weef.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.157ud2cu8j8nuj4u.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.15v9srs6sau8tzi3.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.165nkn4bsqj9g3ec.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.16d02s1fmw4mtv0y.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.16pbc2vdc19xmpzr.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.177osnsyympzikvr.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.1803giu0je8xf0gb.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.18cqz6on7whqbppg.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.18wwnqv21sy50p64.rcgu.o is incompatible with aarch64linux
          ld.lld: error: /home/seldom/elevated_arcanum/target/x/debug/android/x64/cargo/x86_64-linux-android/debug/deps/bevy_mobile_example.19dityh3rb2v9e35.rcgu.o is incompatible with aarch64linux
          ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
          clang-16: error: linker command failed with exit code 1 (use -v to see invocation)

(the emulator is x64)
image

@Seldom-SE
Copy link
Author

Also reproed on Windows

PS C:\Users\Hayde\Documents\Projects\elevated_arcanum> x run --device adb:emulator-5554
[1/3] Fetch precompiled artifacts
info: component 'rust-std' for target 'aarch64-linux-android' is up to date
[1/3] Fetch precompiled artifacts [162ms]
[2/3] Build rust `arcana_elevated`
   Compiling arcana_elevated v0.1.0 (C:\Users\Hayde\Documents\Projects\elevated_arcanum)
// ...
error: linking with `clang` failed: exit code: 1
  |
// ...
  = note: ld.lld: error: C:\\Users\\Hayde\\AppData\\Local\\x\\Android.ndk\\usr\\lib\\x86_64-linux-android\\33\\crtbegin_so.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\AppData\\Local\\Temp\\rustcaeSn3Q\\symbols.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.102f1kqaxbam3hot.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.10jrwzw3oy02hsvv.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.10y091wnc1i6p80h.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.12ol8g2ihbh7t0hu.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.13ctc1o7940nyye6.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.14lmfafd6l1c5wn8.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.15ej1cs6o9qncrib.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.1643hg2z520o04pj.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.16fhjf6x3h5eavda.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.16nkwkuzna4q57dy.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.170aqede3tf0oj28.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.170cel0x4wpnq8oc.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.177stf62jgj652ve.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.17h0zk80duflcc04.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.185p5blwg2opufvl.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.18nhhw06jmivhidm.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.18okoiijv6bcb7qn.rcgu.o is incompatible with aarch64linux
          ld.lld: error: C:\\Users\\Hayde\\Documents\\Projects\\elevated_arcanum\\target\\x\\debug\\android\\x64\\cargo\\x86_64-linux-android\\debug\\deps\\bevy_mobile_example.191l3fv3fihcdb69.rcgu.o is incompatible with aarch64linux
          ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

@MarijnS95
Copy link
Member

@Seldom-SE you're likely running into #127, which was already fixed and merged. Feel free to install from git for the time being (cargo install --git https://github.com/rust-mobile/xbuild) until we publish a new version containing this fix to crates.io.

@MarijnS95
Copy link
Member

In that sense this is also a duplicate of #126.

@MarijnS95 MarijnS95 closed this as not planned Won't fix, can't repro, duplicate, stale May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants