comp.lang.ada
 help / color / mirror / Atom feed
From: Kenneth Wolcott <kennethwolcott@gmail.com>
Subject: Re: GNAT linking and macOS
Date: Fri, 29 Sep 2023 19:30:27 -0700 (PDT)	[thread overview]
Message-ID: <e2a2223e-621e-4987-95b3-61e3349a9238n@googlegroups.com> (raw)
In-Reply-To: <lybkdmm2s2.fsf@pushface.org>

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

  parent reply	other threads:[~2023-09-30  2:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 19:30 GNAT linking and macOS moi
2023-09-28 13:32 ` Simon Wright
2023-09-28 21:00   ` Simon Wright
2023-09-29 20:19     ` hn...@yahoo.de
2023-09-29 20:26     ` hn...@yahoo.de
2023-09-30  0:51       ` moi
2023-09-30 14:20       ` Simon Wright
2023-09-30  2:30     ` Kenneth Wolcott [this message]
2023-09-30 13:55       ` Simon Wright
2023-09-30 23:57         ` Kenneth Wolcott
2023-10-01  7:57           ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox