LLVM on IRIX - Chris Hanson
#1
LLVM on IRIX - Chris Hanson
I am on the LLVM-dev mailing list, and Chris Hanson, a gentleman on there did some research into this:

Quote:
Just in case anyone is interested…

I recently got an SGI Octane, installed Irix 6.5.30 and MIPSpro 7.4.4, and was frustrated by the lack of a modern C/C++ compiler. (I wanted to build CMake so I could build some other software, but it requires C++11 which postdates MIPSpro.)

So on my Linux box, I built clang, compiler_rt, and lld from LLVM master, pointed them at a sysroot made from my Octane, and was able to compile a hello world MIPS n64 .o and executable with it, with no changes to any of the LLVM projects.

Unfortunately the compiled .o won’t link using the MIPSpro tools, and the executable won’t run, in both cases it appears because there are ELF features unsupported by MIPSpro’s linker and Irix’s runtime loader.

This says to me that someone who knows ELF better than I could probably just do some work on lld and get a toolchain running that can target Irix, and probably even run there.

-- Chris

I did advise him of the GNU BFD/ld ports on IRIX, just to see what happens, but generally the responses I've gotten from LLVM devs indicates that they will accept any patches upstream for LLVM and the LLVM utilities like lld to get it working on IRIX, as long as the changes are maintained by someone. So unlike GCC, this is a good long term option.

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,264
Threads: 537
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-06-2019, 03:16 AM
#2
RE: LLVM on IRIX - Chris Hanson
I’ve posted a couple of more specific questions on the cfe-dev list and gotten things pretty well off the ground. An experienced C/C++ developer (especially one comfortable working on developer tools) should be blue to easily replicate what I’ve done.

To make an Irix SDK all I did was tar up the following paths (which got a bunch extra too) from my Irix 6.5.30f + MIPSpro 7.4.4m installation and untar them in a directory on my Linux box:

/usr/include
/lib
/lib32
/lib64
/usr/lib
/usr/lib32
/usr/lib64

I don’t think I’m missing anything from this that I’d need to build against to create working Irix o32, n32, or n64 executables. (My first goal is to use clang on Linux to build a working n64 executable, since that’s what would needed to run clang itself on Irix...)
Eschaton
O2

Trade Count: (0)
Posts: 6
Threads: 1
Joined: Apr 2019
Location: San Jose, CA
Find Reply
11-10-2019, 12:30 AM
#3
RE: LLVM on IRIX - Chris Hanson
Hi Chris!

Welcome to the forum! Happy to have you here. If there's anything I or anyone else here can do to help you, we're all ears.

Thank you for your dedication. I'm sure some of the more experienced IRIX guys (i.e. Mrthinlysliced maybe???) can help with this endeavor.

If you need a beer money fund or something, by all means, let me know. I'll throw a few dollars in the pot myself.

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,264
Threads: 537
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-10-2019, 04:17 AM
#4
RE: LLVM on IRIX - Chris Hanson
I absolutely cannot take any form of compensation for what I’m trying to do, it’s possible I may not even be able to release it.

However, if I can inspire other people to dive into LLVM/clang for this stuff, that’d be wonderful.
Eschaton
O2

Trade Count: (0)
Posts: 6
Threads: 1
Joined: Apr 2019
Location: San Jose, CA
Find Reply
11-11-2019, 09:59 PM
#5
RE: LLVM on IRIX - Chris Hanson
Well shit, that sucks. But I guess that comes part and parcel with working for a big tech company.

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,264
Threads: 537
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-11-2019, 11:40 PM
#6
RE: LLVM on IRIX - Chris Hanson
Interesting, and Cool!
-Mike
mgtremaine
Octane

Trade Count: (0)
Posts: 53
Threads: 6
Joined: May 2018
Find Reply
11-14-2019, 10:34 PM
#7
RE: LLVM on IRIX - Chris Hanson
This is very intriguing, I've often wondered about the possibility of compiling binary patchfiles for MIPSPro to add capability that it lacks due to it's age, but if we can start from scratch using this approach more's the better. This needs some serious cogitating...

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,266
Threads: 42
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
11-15-2019, 07:41 AM
#8
RE: LLVM on IRIX - Chris Hanson
The thing about LLVM that makes it better than GCC is that they're willing to accept patches upstream and the license of LLVM is significantly better.

I'm not the biggest fan of ASL 2.0 - but it's miles ahead of GPLv2/3

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,264
Threads: 537
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-15-2019, 08:41 PM
#9
RE: LLVM on IRIX - Chris Hanson
On Nekochan quite a while ago someone posted that MIPS authorized and/or assigned some of it's compiler engineers to make contributions to GCC. I never looked into it so maybe it was just a rumor, do you know if there are any MIPS engineers working on LLVM?

It's been awhile since I looked, but last time I did MIPS was still charging vast fortunes for access to their own proprietary compilers, so I don't really see where it's an advantage to them to make GCC or LLVM (or *any* compiler for that matter) better able to generate efficient MIPS code.

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,266
Threads: 42
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
11-24-2019, 11:07 PM
#10
RE: LLVM on IRIX - Chris Hanson
There are MIPS engineers working on LLVM.
Eschaton
O2

Trade Count: (0)
Posts: 6
Threads: 1
Joined: Apr 2019
Location: San Jose, CA
Find Reply
11-28-2019, 07:43 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)