simonjwright / distributing-gcc

Binary releases of GCC (native and cross) on macOS; also, the scripts/Makefiles used for producing them.
BSD 3-Clause "New" or "Revised" License
40 stars 0 forks source link

Link failure on macOS 12.5.1 with gcc-12.1.0-aarch64 #4

Closed rod-chapman closed 2 years ago

rod-chapman commented 2 years ago

I'm trying to build ada-mode for EMACS (the 7.3beta release), and I'm getting some weird linker failure. This is on a 2021 MacBook Pro with the Apple M1 Pro CPU.

Link [archive] libwisi.a [index] libwisi.a [link] wisitoken-bnf-generate.adb 0 0x1022d81a0 assert_rtn + 140 1 0x10215fa8c mach_o::relocatable::Parser::parse(mach_o::relocatable::ParserOptions const&) + 4536 2 0x102131d38 mach_o::relocatable::Parser::parse(unsigned char const, unsigned long long, char const, long, ld::File::Ordinal, macho::relocatable::ParserOptions const&) + 148 3 0x10217c180 archive::File::makeObjectFileForMember(archive::File::Entry const) const + 1084 4 0x10217bac8 archive::File::File(unsigned char const, unsigned long long, char const, long, ld::File::Ordinal, archive::ParserOptions const&) + 856 5 0x10217402c archive::parse(unsigned char const, unsigned long long, char const*, long, ld::File::Ordinal, archive::ParserOptions const&) + 388 6 0x10219a6d0 ld::tool::InputFiles::makeFile(Options::FileInfo const&, bool) + 2016 7 0x10219d360 ZN2ld4tool10InputFilesC2ER7Options_block_invoke + 56 8 0x198e3c1f4 _dispatch_client_callout2 + 20 9 0x198e4f954 _dispatch_apply_invoke + 224 10 0x198e3c1b4 _dispatch_client_callout + 20 11 0x198e4da04 _dispatch_root_queue_drain + 680 12 0x198e4e104 _dispatch_worker_thread2 + 164 13 0x198ffc324 _pthread_wqthread + 228 A linker snapshot was created at: /tmp/wisitoken-bnf-generate-2022-09-27-195153.ld-snapshot ld: Assertion failed: (_file->_atomsArrayCount == computedAtomCount && "more atoms allocated than expected"), function parse, file macho_relocatable_file.cpp, line 2061. collect2: error: ld returned 1 exit status gprbuild: link of wisitoken-bnf-generate.adb failed gprbuild: failed command was: /opt/gcc-12.1.0-aarch64/bin/gcc wisitoken-bnf-generate.o -Wl,-filelist,/private/var/folders/83/zx9jk1g53wjcr2xvycvs7xjh0000gr/T/GNAT-TEMP-000016.TMP libwisi.a /opt/gcc-12.1.0-aarch64/lib/gnatcoll.static/libgnatcoll.a /opt/gcc-12.1.0-aarch64/lib/gpr/static/gpr/libgpr.a /opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_schema.static/libxmlada_schema.a /opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_dom.static/libxmlada_dom.a /opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_sax.static/libxmlada_sax.a /opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_input.static/libxmlada_input_sources.a /opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_unicode.static/libxmlada_unicode.a -L/Users/rodchap/.emacs.d/elpa/wisi-4.0beta1.0.20220711.185552/obj/ -L/Users/rodchap/.emacs.d/elpa/wisi-4.0beta1.0.20220711.185552/obj/ -L/opt/gcc-12.1.0-aarch64/lib/gnatcoll.static/ -L/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_dom.static/ -L/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_sax.static/ -L/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_unicode.static/ -L/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_input.static/ -L/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_schema.static/ -L/opt/gcc-12.1.0-aarch64/lib/gpr/static/gpr/ -L/opt/gcc-12.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/12.1.0/adalib/ /opt/gcc-12.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/12.1.0/adalib/libgnarl.a /opt/gcc-12.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/12.1.0/adalib/libgnat.a -lm -Wl,-rpath,@executable_path//obj -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/gnatcoll.static -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_dom.static -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_sax.static -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_unicode.static -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_input.static -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/xmlada/xmlada_schema.static -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/gpr/static/gpr -Wl,-rpath,/opt/gcc-12.1.0-aarch64/lib/gcc/aarch64-apple-darwin21/12.1.0/adalib -o /Users/rodchap/.emacs.d/elpa/wisi-4.0beta1.0.20220711.185552//wisitoken-bnf-generate

Any ideas?

simonjwright commented 2 years ago

Works for me. But ...

I think this might just be related to this; I certainly had to revert to Command Line Tools 13.4 to work round PR106961 (I normally don't install Xcode).

It could be that the update referenced in this comment will do the trick ...

Looks like it! Installed Command Line Tools 14.1 Beta 3, ada-mode built OK, the ACATS problem in PR106961 goes away.

Get the CLTs using your free Apple Developer account to log in to their More Downloads page (I see there's also Xcode 14.1 Beta 3, also dated 27/9/2022, so the choice is open, but if you have Xcode 14 & want to try the smaller CLT download first, you need to at least move /Applications/Xcode.app out of the way, because the 12.1.0 compiler will look for Xcode first, then CLTs).

rod-chapman commented 2 years ago

Got it ... the newest CLT seems to fix the problem. Thanks.