On Mon, Jun 8, 2026, at 1:14 PM, Iain Sandoe wrote:
>> On 8 Jun 2026, at 17:59, Jeffrey Law <[email protected]> wrote:
>> On 6/8/2026 7:26 AM, Iain Sandoe wrote:
>>> 
>>>> On 8 Jun 2026, at 14:02, Pietro Monteiro <[email protected]> wrote:
>>>> 
>>>> The Algol 68 frontend adds a section with information on exported
>>>> modes and procedures to libraries and object files.  Instead of
>>>> erroring out when encountering a Mach-O library keep reading it so the
>>>> frontend can find the exports section.
>>>> 
>>>> libiberty/ChangeLog:
>>>> 
>>>> * simple-object-mach-o.c (MACH_O_MH_DYLIB): New definition.
>>>> (simple_object_mach_o_match):
>>> OK from a Darwin PoV (but I’m not sure if I can OK libiberty changes).
>> Given it's mach-o, it seems like you're likely in the best position to 
>> review.  So, yea I think you ought to be able to OK libiberty changes.
>
> @ Jeff : thanks.
>
> @pietro, I don’t think you have mentioned how this has been tested.

Sorry, I only had a small note in the original email. I tested this
patch and the A68 frontend ones together on x86_64 darwin.  Before, the
FE would always fail to compile anything in darwin. After applying the
patch so it searches for export sections on .dylib files and this
libiberty one, the FE sucessfully finds libga68.dylib and its export
section.  The full testsuite for Algol 68 is now passing on x86_64
darwin.

> There is a substantial difference between an MH_OBJECT (or convenience 
> library containing multiple MH_OBJECTS) and an MH_DYLIB (or any other 
> of the Mach-O dynamic objects).
>
> This is because MH_OBJECT files only contain one segment command .. and 
> one can iterate through the sections looking for both segment and 
> section.
>
> for an MH_DYLIB (or MH_BUNDLE) you would need to traverse the load 
> commands looking for the __GNU_A68 segment (and then traverse that 
> segment sections looking for __a68_exports).  It is possible that we 
> already have sufficient flexibility in simple-object to accommodate 
> this - but it should be checked / tested.

We do! simple-object.c:simple_object_find_section() ends up using
simple-object-mach-o.cc:simple_object_mach_o_find_sections(), which goes
through all load commands and searches for the matching section.

> Assuming a positive test-result, the patch is OK.

Thanks! Assuming a positive test result in the GCC-16 branch may I
backport this patch to it too? The ga68 breakage on darwin is on GCC 16
too.

> thanks,
> Iain

Thanks for all the reviews and help. I went down the darwin rabbit hole
because some people interested in ga68 asked about aarch64-darwin
support, so I was building one of your aarch64 darwin branches.

pietro

Reply via email to