rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.25k stars 12.57k forks source link

Apple arm64e targets fail to link with newer Xcode 15 #130085

Open madsmtm opened 3 weeks ago

madsmtm commented 3 weeks ago

See tracking issue for these targets in https://github.com/rust-lang/rust/issues/73628.

Building a project using the arm64e-apple-ios target fails to link when using Xcode 15.4. Using Xcode 14.3.1 works.

This might also be the case for arm64e-apple-darwin, but I can't test that due to https://github.com/rust-lang/cc-rs/issues/1205.

$ cargo new foo && cd foo && cargo +nightly build --target=arm64e-apple-ios -Zbuild-std
// Or
$ ./x test --target=arm64e-apple-ios

The exact error is:

  = note: ld: warning: search path '$HOME/.rustup/toolchains/nightly-2024-01-15-aarch64-apple-darwin/lib/rustlib/arm64e-apple-ios/lib' not found
          ld: warning: search path '$HOME/.rustup/toolchains/nightly-2024-01-15-aarch64-apple-darwin/lib/rustlib/arm64e-apple-ios/lib' not found
          ld: warning: ignoring file '/private/var/folders/0j/tk3sfgz540712zgqd1hrry0m0000gn/T/rustcMbh3OI/symbols.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.26sqj2knsb351po8.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.3mx9ar89kmsx5j1l.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.45hdsivk0rjaalqm.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.44zwmgr66v8ihk0u.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libpanic_unwind-f79c716b594cd87d.rlib[3](panic_unwind-f79c716b594cd87d.panic_unwind.b0d5fa77f79efb86-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libpanic_unwind-f79c716b594cd87d.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.5dkwtrczm5qjphu6.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.42cln6of8os0f9gy.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.3d02ymmiyeu3vpo7.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libaddr2line-fb1df4cdd978991d.rlib[3](addr2line-fb1df4cdd978991d.addr2line.b32b3d1578f40f68-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libaddr2line-fb1df4cdd978991d.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_demangle-070595bb373ffce1.rlib[4](rustc_demangle-070595bb373ffce1.rustc_demangle.319f1cf397a9ecca-cgu.1.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_demangle-070595bb373ffce1.rlib[3](rustc_demangle-070595bb373ffce1.rustc_demangle.319f1cf397a9ecca-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd_detect-72eccc55aeb6dc6e.rlib[3](std_detect-72eccc55aeb6dc6e.std_detect.b917a1edde698b77-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/foo-fd00ad1dff52af6b.529zhzjdbavai3fn.rcgu.o': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libadler-2503ee2f726d439b.rlib[3](adler-2503ee2f726d439b.adler.9aa407738f930ee2-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libminiz_oxide-d07b686f8d54a430.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libmemchr-075960409c25bbb9.rlib[3](memchr-075960409c25bbb9.memchr.adf4ce8aa7930ef2-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_demangle-070595bb373ffce1.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_std_workspace_alloc-d4a4490e1effb483.rlib[3](rustc_std_workspace_alloc-d4a4490e1effb483.rustc_std_workspace_alloc.2e3ab25734ed68d6-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libadler-2503ee2f726d439b.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libhashbrown-e6b966447a347358.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libminiz_oxide-d07b686f8d54a430.rlib[3](miniz_oxide-d07b686f8d54a430.miniz_oxide.c3e4f4e376ceb04b-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_std_workspace_alloc-d4a4490e1effb483.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libunwind-8017996f774c6593.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libunwind-8017996f774c6593.rlib[3](unwind-8017996f774c6593.unwind.e4507e56c8db69a9-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libhashbrown-e6b966447a347358.rlib[3](hashbrown-e6b966447a347358.hashbrown.2979a5dc0df80385-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libmemchr-075960409c25bbb9.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libgimli-9049beec931fd184.rlib[7](gimli-9049beec931fd184.gimli.291f80e1c06160d3-cgu.4.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libgimli-9049beec931fd184.rlib[6](gimli-9049beec931fd184.gimli.291f80e1c06160d3-cgu.3.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd_detect-72eccc55aeb6dc6e.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_std_workspace_core-57c9b9461bb0a02d.rlib[3](rustc_std_workspace_core-57c9b9461bb0a02d.rustc_std_workspace_core.2cc70b459bc5d55b-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcfg_if-ab04255e62dd4d18.rlib[3](cfg_if-ab04255e62dd4d18.cfg_if.9512f2fb5bcdd678-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libobject-8770e67c8539abe4.rlib[5](object-8770e67c8539abe4.object.58425892dede8931-cgu.2.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liblibc-e3f8a8bc867e7d2f.rlib[3](libc-e3f8a8bc867e7d2f.libc.565c562bf8166800-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liblibc-e3f8a8bc867e7d2f.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libgimli-9049beec931fd184.rlib[5](gimli-9049beec931fd184.gimli.291f80e1c06160d3-cgu.2.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcompiler_builtins-ce1cb3c3fce0a16d.rlib[5](compiler_builtins-ce1cb3c3fce0a16d.compiler_builtins.6948197a790d2fa7-cgu.2.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcfg_if-ab04255e62dd4d18.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libgimli-9049beec931fd184.rlib[4](gimli-9049beec931fd184.gimli.291f80e1c06160d3-cgu.1.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libgimli-9049beec931fd184.rlib[3](gimli-9049beec931fd184.gimli.291f80e1c06160d3-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liballoc-85c3b697c47ff844.rlib[6](alloc-85c3b697c47ff844.alloc.2bb4af1538dd142e-cgu.3.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[18](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.15.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libobject-8770e67c8539abe4.rlib[4](object-8770e67c8539abe4.object.58425892dede8931-cgu.1.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[17](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.14.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcompiler_builtins-ce1cb3c3fce0a16d.rlib[4](compiler_builtins-ce1cb3c3fce0a16d.compiler_builtins.6948197a790d2fa7-cgu.1.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcompiler_builtins-ce1cb3c3fce0a16d.rlib[3](compiler_builtins-ce1cb3c3fce0a16d.compiler_builtins.6948197a790d2fa7-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libobject-8770e67c8539abe4.rlib[3](object-8770e67c8539abe4.object.58425892dede8931-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[16](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.13.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcompiler_builtins-ce1cb3c3fce0a16d.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libobject-8770e67c8539abe4.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libgimli-9049beec931fd184.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/librustc_std_workspace_core-57c9b9461bb0a02d.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[15](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.12.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[14](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.11.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[13](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.10.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[12](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.09.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[11](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.08.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[10](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.07.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[9](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.06.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[8](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.05.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[7](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.04.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[6](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.03.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[5](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.02.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[4](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.01.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[3](std-e730827ac25e8eb8.std.390e242b97fa85e2-cgu.00.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libstd-e730827ac25e8eb8.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liballoc-85c3b697c47ff844.rlib[5](alloc-85c3b697c47ff844.alloc.2bb4af1538dd142e-cgu.2.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liballoc-85c3b697c47ff844.rlib[4](alloc-85c3b697c47ff844.alloc.2bb4af1538dd142e-cgu.1.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liballoc-85c3b697c47ff844.rlib[3](alloc-85c3b697c47ff844.alloc.2bb4af1538dd142e-cgu.0.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/liballoc-85c3b697c47ff844.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[18](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.15.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[17](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.14.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[16](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.13.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[15](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.12.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[14](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.11.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[13](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.10.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[12](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.09.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[11](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.08.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[10](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.07.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[9](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.06.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[8](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.05.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[7](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.04.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[6](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.03.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[5](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.02.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[4](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.01.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[3](core-8349edf93c8d5e6a.core.b68d8c8fce132d46-cgu.00.rcgu.o)': found architecture 'arm64e.old', required architecture 'arm64e'
          ld: warning: ignoring file '$PROJECT/target/arm64e-apple-ios/debug/deps/libcore-8349edf93c8d5e6a.rlib[2](lib.rmeta)': found architecture 'arm64e.old', required architecture 'arm64e'
          Undefined symbols for architecture arm64e:
            "_main", referenced from:
                <initial-undefines>
          ld: symbol(s) not found for architecture arm64e
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

I feel fairly confident that we're passing the right arguments to the linker nowadays (this happens even with https://github.com/rust-lang/rust/pull/129369), so I suspect it's the object files that we generate that's the problem somehow, but I may be mistaken?

Meta

rustc +nightly --version --verbose:

rustc 1.83.0-nightly (26b5599e4 2024-09-06)
binary: rustc
commit-hash: 26b5599e4d6ed2b45152c60493c1788c0a27533d
commit-date: 2024-09-06
host: aarch64-apple-darwin
release: 1.83.0-nightly
LLVM version: 19.1.0

Happens as far back as +nightly-2023-11-22, the day after the PR introducing these merged, so it's definitely due to changes in Xcode, not because of a regression in rustc.

@rustbot label O-ios O-macos O-AArch64

CC target maintainer @arttet.

BlackHoleFox commented 3 weeks ago

The .old prefix in the warnings getting spammed would seem to hint that Apple has added a new identifier or ABI version for the arm64e target? This seems to indicate its an upstream LLVM limitation, perhaps.

Firefox has patched their LLVM build to set the correct arch flags based on Apple's LLVM output.

arttet commented 2 weeks ago

Hey @madsmtm,

You can handle it if you use the LLVM linker (lld).

--set rust.use-lld=true
./configure \
        --enable-option-checking \
        --enable-verbose-tests \
        --codegen-backends=llvm \
        --enable-codegen-tests \
        --enable-dist-src \
        --tools=cargo,clippy,rustdoc,rustfmt,rust-analyzer,analysis,src \
        --target=arm64e-apple-ios,aarch64-apple-ios,arm64e-apple-darwin,aarch64-apple-darwin \
        --set llvm.download-ci-llvm=true \
        --set build.verbose=0 \
        --set rust.channel=dev \
        --set rust.description="" \
        --set rust.use-lld=true \
        --dist-compression-formats=xz \
        --prefix=install