Gnu binutils - last working version
#1
Gnu binutils - last working version
For those interested, I've been gradually working my way through the binutils master GIT repository trying to discover what works, what doesn't, and what might be fixable.

* binutils2.17a does indeed work as widely reported, both gas and gld
* Recent binutils2.32 of course doesn't work - but surprisingly with a few little tweaks - gas (Gnu assembler) passes most tests
* binutils2.18a, 2.19a, 2.20.1a works for me too (although some require little patches)
* binutils2.21.1 - first version from the FTP I find where I can't build gcc using the gas/gld combination

That lead me to using bisection on the raw repository Biggrin

i.e. Start with a known good version that works and a version that doesn't and using binary search gradually home in on the commit that stopped things working.

I'd got a gcc set up to such that it would try to build using the snapshot I was doing the testing on and then it would try to see if the resulting executable works.

It took thirteen rounds of checkout, manually patch, manually build binutils, try and build gcc ....

Here's my initial findings:

* There was a commit 19 Sep 2010 that did some re-work of the BFD mips handling - First breaking commit
* The previous commit where I still see success in building gcc using gas/gld - is here
* The first bad change looks like modifications in the way that the global offset table is filled, lots of mentions of VxWorks, but presumably no-one tested or gave feedback to the maintainers about this breaking things on SGIs

The tests I've run against various versions of binutils and some patches can be found here.

I'm far from any kind of expert on ELF binaries and certainly not when it comes to Irix, but I'll continue digging to see what pops up. It would be nice to know if there are some simple changes that could fix this issue for that version -> maybe those changes can be rolled into the much more recent versions too.

Kr,

Mr TS.
mrthinlysliced
Unregistered

Trade Count: (0)
 
Reply
04-18-2019, 10:17 PM
#2
RE: Gnu binutils - last working version
I think the best thing to do is get lld or gnu gold working, gnu ld can't mix mipspro and GCC object files and is wasteful of memory compared to irix ld

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-19-2019, 01:48 AM
#3
RE: Gnu binutils - last working version
(04-19-2019, 01:48 AM)Raion Wrote:  I think the best thing to do is get lld or gnu gold working, gnu ld can't mix mipspro and GCC object files and is wasteful of memory compared to irix ld

The reasons I decided not to look into these two (at least for now, maybe llvm as a whole becomes interesting down the line)

* "lld" - now you have to port the version of cmake, llvm build infra and related python version and tools, then actually port the linker itself which hasn't ever supported irix

* "gnu gold" - this linker also hasn't ever historically supported irix - sure it compiles, but that's quite different to it ever having actively supported or produced working binaries on irix. I'm willing to hear different. A warning bell for me - this is possibly being moved to separate support package from regular binutils due to lack of ownership / follow up by google (see https://www.phoronix.com/scan.php?page=n...agnate-F31)

So for me the "best bet" right now is to get regular gnu ld into a state where we can support building + using vaguely modern gdb and gcc, at which point building other modern software starts to be easier.

Of course, we're all doing this for a hobby, right, so everyone's free to pursue their itch :-)
mrthinlysliced
Unregistered

Trade Count: (0)
 
Reply
04-20-2019, 09:17 AM
#4
RE: Gnu binutils - last working version
(04-20-2019, 09:17 AM)mrthinlysliced Wrote:  The reasons I decided not to look into these two (at least for now, maybe llvm as a whole becomes interesting down the line)

* "lld" - now you have to port the version of cmake, llvm build infra and related python version and tools, then actually port the linker itself which hasn't ever supported irix

Fair enough. Mach_kernel is working on LLVM in his spare time, so maybe hop in the discord and hit him up if you're curious.
(04-20-2019, 09:17 AM)mrthinlysliced Wrote:  * "gnu gold" - this linker also hasn't ever historically supported irix - sure it compiles, but that's quite different to it ever having actively supported or produced working binaries on irix. I'm willing to hear different. A warning bell for me - this is possibly being moved to separate support package from regular binutils due to lack of ownership / follow up by google (see https://www.phoronix.com/scan.php?page=n...agnate-F31)

So for me the "best bet" right now is to get regular gnu ld into a state where we can support building + using vaguely modern gdb and gcc, at which point building other modern software starts to be easier.

Don't get me wrong, diversity in our build utils are good, but the glaring issues with gnu ld make it a pretty bad choice compared to the default linker in IRIX. It's of course possible to fix those, but that means going through tens of thousands of lines of ld and bfd related code, with GNU never upstreaming those changes. So there's a lot that is good and bad here about them, just the unacceptable (in my view) issues with gnu ld means it's really only good for a gcc-only software distro such as the sgi dev pkgsrc stuff; that is, if they ever get around to packaging the software officially. It's this reason that I only am focusing on recipes for irisware that use the sgi linker/as; I think MIPSPro is worth trying for.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-20-2019, 09:28 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)