From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-91-241.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:620a:a43:b0:773:af88:ed4e with SMTP id j3-20020a05620a0a4300b00773af88ed4emr68186qka.6.1696041027895; Fri, 29 Sep 2023 19:30:27 -0700 (PDT) X-Received: by 2002:a05:6870:b7b1:b0:1dc:8274:a1c with SMTP id ed49-20020a056870b7b100b001dc82740a1cmr2256095oab.10.1696041027664; Fri, 29 Sep 2023 19:30:27 -0700 (PDT) Path: eternal-september.org!news.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 29 Sep 2023 19:30:27 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=98.59.238.112; posting-account=oHOvdQoAAACYgyEBjgPNvKFOGxg8pNns NNTP-Posting-Host: 98.59.238.112 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: GNAT linking and macOS From: Kenneth Wolcott Injection-Date: Sat, 30 Sep 2023 02:30:27 +0000 Content-Type: text/plain; charset="UTF-8" Xref: news.eternal-september.org comp.lang.ada:65757 List-Id: Hi Simon; >I'd recommend taking a copy of /Library/Developer/CommandLineTools > before updating to 15.0. Well, I should have done this, but I didn't... > > It turns out there's an environment variable DEFAULT_LINKER, which with I tried this (xport DEFAULT_LINKER=/Library/Developer/CommandLineTools/usr/bin/ld-classic) and it did not help: Using: /opt/gcc-13.1.0-aarch64/bin/gnatmake --version GNATMAKE 13.1.0 -- This is from Rosetta Code: with Ada.Text_IO; use Ada.Text_IO; procedure Test_Short_Circuit is function A (Value : Boolean) return Boolean is begin Put (" A=" & Boolean'Image (Value)); return Value; end A; function B (Value : Boolean) return Boolean is begin Put (" B=" & Boolean'Image (Value)); return Value; end B; begin for I in Boolean'Range loop for J in Boolean'Range loop Put (" (A and then B)=" & Boolean'Image (A (I) and then B (J))); New_Line; end loop; end loop; for I in Boolean'Range loop for J in Boolean'Range loop Put (" (A or else B)=" & Boolean'Image (A (I) or else B (J))); New_Line; end loop; end loop; end Test_Short_Circuit; gnatmake test_short_circuit.adb gcc -c test_short_circuit.adb gnatbind -x test_short_circuit.ali gnatlink test_short_circuit.ali -macosx_version_min has been renamed to -macos_version_min ld: warning: ignoring duplicate libraries: '-lgcc' 0 0x10306b648 __assert_rtn + 72 1 0x102f9ffac ld::AtomPlacement::findAtom(unsigned char, unsigned long long, ld::AtomPlacement::AtomLoc const*&, long long&) const + 1204 2 0x102fb5924 ld::InputFiles::SliceParser::parseObjectFile(mach_o::Header const*) const + 15164 3 0x102fc304c ld::InputFiles::parseAllFiles(void (ld::AtomFile const*) block_pointer)::$_7::operator()(unsigned long, ld::FileInfo const&) const + 960 4 0x18e36d950 _dispatch_client_callout2 + 20 5 0x18e3821a4 _dispatch_apply_invoke_and_wait + 176 6 0x18e381464 _dispatch_apply_with_attr_f + 1176 7 0x18e381650 dispatch_apply + 96 8 0x10303d3b8 ld::AtomFileConsolidator::parseFiles(bool) + 292 9 0x102fde170 main + 9048 ld: Assertion failed: (resultIndex < sectData.atoms.size()), function findAtom, file Relocations.cpp, line 1336. collect2: error: ld returned 1 exit status gnatlink: error when calling /opt/gcc-13.1.0-aarch64/bin/gcc gnatmake: *** link failed. Are there any other workarounds to solve the inability to link? This does not only adversely affect Ada, but everything that uses a linker, BTW. Thanks, Ken Wolcott