macho gas support

Iain Sandoe iain@sandoe.co.uk
Mon May 25 09:46:11 GMT 2026


Hi Alan,

> On 25 May 2026, at 10:35, Alan Modra <amodra@gmail.com> wrote:
> 
> ix86-darwin is the only remaining macho target supported by gas.  I'm
> not sure how much it is used nowadays, and judging by the number of
> x86 tests and mach-o tests that fail, it seems no one is actively
> maintaining the code.  So it's quite possible this series of patches I
> made fixing some issues was wasted time.  My interest in the port
> started with seeing a regression from commit cc28c46227cd.  Fixing
> that led to finding more problems.

Actually, the x86 binutils can be quite useful - I do build it from time-to-time
but not regularly (i.e. I keep the built tools for end-use).

> Of the three patches, I'm less confident in the correctness of the
> last one.  I do know that it is necessary to ignore subsections in at
> least obj_mach_o_force_reloc_sub_same, otherwise even the simplest
> assembly testcases won't assemble with -gdwarf2, but there may be some
> other situation where it is wrong to ignore subsections when
> processing debug info.

I will try to look at and test this - over the next week or two - is there a branch somewhere
I can checkout?

> I haven't tried to build gcc for i386-darwin, if that is even
> possible.

trunk is possible with a work-around for HJ’s bootstrap break caused by changes
to stack_chk_guard.

I build and test i686-darwin17 regularly and and the m32 mulilib on x86_64-darwin17
less frequently i686-darwin9 and x86_64-darwin10 and 16 with the 32b multilib,

So all open branches should bootstrap - and trunk will with a work-around.

thanks for working on this, I just don’t have the resources to do binutils as well
as GCC,

Iain


> 
> -- 
> Alan Modra



More information about the Binutils mailing list