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

Unrecognized command-line option "-m64" when trying to cross compile from aarch64 #470

Closed
rtyler opened this issue Oct 17, 2020 · 3 comments
Labels
A-aarch64-host Area: ARMv8 hosts bug

Comments

@rtyler
Copy link

rtyler commented Oct 17, 2020

My hunch is that this might be a cargo bug, but I hope you all don't mind if I start here 😸

Basically, my main workstation is aarch64 and I'm trying to cross compile for amd64, but the following error occurs. Best I can tell it's because the GCC suite on aarch64 doesn't bother with -m64 since all binaries are emitted as 64-bit

❯ cross build -p sh-step --target x86_64-unknown-linux-gnu
   Compiling sh-step v0.1.0 (/home/tyler/source/git/otto/stdlib/sh)
error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.108slxnxl84a8h2f.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.134ziw0g7jk3p69o.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.14uiomqtlfl5nzd4.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.161xya9reg1ng3h6.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.16ktne17pgfd6e8x.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.1fxx1wkh3qncu4bm.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.1j172sjzkmsxcut7.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.1p5kxwqqbbvq4kjj.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.1x7ekt4pwko6ujje.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.25fguub22fspemta.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.26xmpfqwvm0kq268.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2eikxo4y5y7nphs4.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2f9tkcjb5e3a88qg.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2h2sbuw5aii9r5df.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2hfgb1qhj97usljb.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2i2mbos0nhus3zja.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2n7lvw77cv9hhwox.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2qmt17ag37yxygcz.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2up67yk70rvkuifs.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2vw33jny2gzfdpa9.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2wai0p264sb84pni.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2zsi8ey6c119hwe5.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.30eu0ii11mfmjc3i.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.32zjml8m3a5x2t5e.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.34wdp6ckfzu1yez7.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.37qgmuqe80k6mqw6.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.3bgtyqpkpuv3b5hc.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.3c3epogj5kuqszmz.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.3hicgh1eshcmd9dy.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.3hlflkfonjsrljwd.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.3rcnpulaplwbvbww.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.409wh3cxv0tfhzg5.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4127yxrb5b2ta31h.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.44omceh76jru58r0.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.47mzff9uisoase5f.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.485lss35sv62742k.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.48z5v59lrl70op9e.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.49v5x7n7cgbyr4li.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4crdzj18xx6w2m9b.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4ghl3bazzin1prh3.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4lv0rst6r8dmsben.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4njbl72dos2y85wh.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4o8pq2zh4pb0gta4.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4ocxgmndrl9dzp54.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4osii95x85maskfv.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4qa3tvdhwbwg5p11.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.4u8tp2k74wj52m0.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.53vjfg5uj0o6ug91.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.540cdd5lw8i6d6ox.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.56c4ypoyb9hzjh67.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.56hkobvfz0j121cb.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.58prn70r1c9st48w.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.5byqjwa8k0hzous0.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.6hcw83qysby4pp2.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.9h03wsex1r6qse1.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.9yqiahkv98acugk.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.bnlso59plo7gvyt.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.coc0elx53qqm6id.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.cpp8y39uzsi0v20.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.f3ju065rpk5fv0j.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.jrr1moqhssit1eq.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.k4jmdprdt9f5o4v.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.sn6k82fd52toxqb.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.vynfj8unwi3jgs4.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.weqdav723ecip6r.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.xqo3gberr23447n.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.xyqd9e3id1nlwc9.rcgu.o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.zxlexzx0ya8e4pl.rcgu.o" "-o" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/sh_step-003bdfd6dc5c6518.2phiuveydcfmsx12.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps" "-L" "/home/tyler/source/git/otto/target/debug/deps" "-L" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libserde_yaml-2de69749d2cf1476.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libdtoa-ae9450c56b23718c.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libyaml_rust-54275b068e15941f.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/liblinked_hash_map-50078dc0ecbfed11.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libtempfile-ee94cf60552dd87e.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/librand-d8c7f71b9b517290.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/librand_chacha-6b5c410ed1728e2d.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libppv_lite86-31eeb0e7a6bcf806.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/librand_core-34cc898fe8805933.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libgetrandom-88bb7b545bbd0c3d.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/liblibc-899160bccb5d7c03.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libremove_dir_all-30e13ef53f409341.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libcfg_if-8b0ddfa83e73e110.rlib" "/home/tyler/source/git/otto/target/x86_64-unknown-linux-gnu/debug/deps/libserde-d9f7b89fa6fe089f.rlib" "-Wl,--start-group" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-cf0f33af3a901778.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-daf8c2d692e6eca4.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-24e8f97647425e48.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-85ed7d2b484c05a9.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace-89de2c581262ec09.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libbacktrace_sys-3b0db98e62ed7d75.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-c60847f9a163de82.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-0bb9b63424f4fc5d.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-3f74d829e37fa40e.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-0e9d83ff06f1a7ad.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-2c8c904efaf7c40b.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-cbfb51de52131460.rlib" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-97497c26fddb7882.rlib" "-Wl,--end-group" "/home/tyler/.rustup/toolchains/stable-aarch64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-f1a9d8c443e20b5e.rlib" "-Wl,-Bdynamic" "-ldl" "-lrt" "-lpthread" "-lgcc_s" "-lc" "-lm" "-lrt" "-lpthread" "-lutil" "-ldl" "-lutil"
  = note: cc: error: unrecognized command-line option '-m64'


error: aborting due to previous error

error: could not compile `sh-step`.

To learn more, run the command again with --verbose.

tyler on coconut in otto on  step-libraries [?] via 🦀 v1.46.0
❯ uname -a
Linux coconut 5.6.14-1-default #1 SMP Wed May 20 08:32:48 UTC 2020 (b0ab48a) aarch64 aarch64 aarch64 GNU/Linux
@Alexhuszagh
Copy link
Contributor

We should be able to reproduce this if we use rust-cpp-hello-world cross-compiled from an ARMv8, but I simply don't have access to the hardware right now so I'll see if I can get a cloud instance to test this (somewhat difficult since Github Workflows and DigitalOcean don't seem to support ARMv8 machines).

@Alexhuszagh Alexhuszagh added bug A-aarch64-host Area: ARMv8 hosts labels May 28, 2022
@Alexhuszagh
Copy link
Contributor

This may be fixed when we have support for other toolchains in images #817, which would allow #751 to work, so the cross-compiler can run from an aarch64unknown-linux-gnu image and cross-compile to a x86_64-unknown-linux-gnu target.

@Emilgardis
Copy link
Member

alright! So, this issue is strange, as it's using the stable-aarch64-unknown-linux-gnu toolchain and not stable-x86_64-unknown-linux-gnu as it should have with #244, I suspect an old cross version was used (pre 0.1.15)

this does not replicate anymore, unless the wrong toolchain is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-aarch64-host Area: ARMv8 hosts bug
Projects
None yet
Development

No branches or pull requests

3 participants