LLVM/Clang build available
#1
LLVM/Clang build available
Updated: 16 Dec 2021

There are updated builds (version 14.0.0-pre5.2 or newer) available in two forms:

I've been using this for a while to build a variety of things and haven't run into any compiler-related issues.  There are a few env related issues occasionally that are still to be resolved (libcxx provides a hacky vasprintf that may conflict with some other compat library that provides one), but in general it seems stable!  Please enjoy, and if you run into problems, file bugs for me at https://github.com/vvuk/llvm-project/issues

The standalone tarballs use the /usr/sgug prefix that mirrors the rpm releases, but don't require anything from SGUG; if you're not using the RPM environment (you should, so easy!), just treat it as a "sgug" vendor directory Smile

This compiler supports both N32 and 64-bit ABIs, but it's only really stable for N32.  It _will_ compile 64-bit binaries, and I include a full libcxx build for 64-bit, but the codegen there is known to be buggy; at the very least, it will commonly emit unaligned loads/stores that need MIPS_FIXADE to be enabled.

I'll be tracking LLVM releases and will aim to get to a stable 14.0.0 release when LLVM itself releases LLVM 14.


Original/older content:

Hi folks!  After a bunch of work, I just got a working clang that's able to self-compile itself, and has been able to compile a bunch of things I've thrown at it.  Thanks to aurxenon for kicking off this idea Smile

You'll need:
http://misc.bitops.com/irix/llvm-irix-093021.tar.gz
http://misc.bitops.com/irix/llvm-gcc-includes.tar.gz

untar both in /, they'll create /usr/sgug/llvm and /usr/lib/clang (with some includes). Both of this stuff will be fixed, very soon there will be a single tarball for /usr/llvm, as well as a RPM for the SGUG distribution.

You'll have to add /usr/sgug/llvm/bin to PATH, and /usr/sgug/llvm/lib/mips64-sgi-irix6.5-gnuabin32 to LD_LIBRARYN32_PATH and
and /usr/sgug/llvm/lib/mips64-sgi-irix6.5 to LD_LIBRARY64_PATH for libc++.

The default target is mips64-sgi-irix6.5-gnuabin32, i.e. the N32 abi. If you set -target=mips64-sgi-irix6.5, that will build for the 64-bit ABI. Both should work. This isn't a final build of any kind, there are still some tweaks to do, and some packaging fixes -- as well as cleaning up the borrowed gcc fixed-includes headers.

Please let me know what breaks -- I'm looking for feedback / bug reports at this point to see if there's anything major that's broken.

(Edit: holy crap are is this forum's formatting annoyingly broken; sorry 'bout the initial colours)
(This post was last modified: 12-16-2021, 10:56 PM by vvuk. Edit Reason: Updated info in top post )
vvuk
O2

Trade Count: (0)
Posts: 43
Threads: 4
Joined: Aug 2021
Location: California
Find Reply
10-01-2021, 04:53 AM
#2
RE: LLVM/Clang build available
Hi vvuk, not a bug report, nor feedback, but just a warm-heartedly "Great Job Man!"
TruHobbyist
Developer

Trade Count: (0)
Posts: 195
Threads: 21
Joined: May 2018
Find Reply
10-01-2021, 07:47 AM
#3
RE: LLVM/Clang build available
Nice!

Can the LLVM compiler be used to bootstrap itself?
jan-jaap
SGI Collector

Trade Count: (0)
Posts: 1,048
Threads: 37
Joined: Jun 2018
Location: Netherlands
Website Find Reply
10-01-2021, 08:02 AM
#4
RE: LLVM/Clang build available
(10-01-2021, 08:02 AM)jan-jaap Wrote:  Can the LLVM compiler be used to bootstrap itself?

Yes, this build is self-bootstrapped (cross-compiled on Linux by clang just for speed, but at some point I'm going to do a build on IRIX just to see how much ram/time it takes).
vvuk
O2

Trade Count: (0)
Posts: 43
Threads: 4
Joined: Aug 2021
Location: California
Find Reply
10-01-2021, 04:06 PM
#5
RE: LLVM/Clang build available
Hey vvuk -- there's a longstanding bug with pasting text where it copies the style of the text. So the way to fix this is to "paste as plaintext"

I can't really do anything about it without breaking stylesheets that are light themed, which isn't a really acceptable solution.

For now, just paste as plaintext.

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,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
10-01-2021, 05:02 PM
#6
RE: LLVM/Clang build available
Also, congrats from me on the both of you getting this working. I would immediately do a tardis but my current living situation has me separated from my machines so I simply am not able to at the moment but I will do it at some point.

Once you have something that doesn't rely on SGUG path or libs I will gladly host it on our servers. The reason why I mandate that is purely because they would not currently reciprocate builds that rely on libs Nekoware or others require.

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,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
10-01-2021, 05:05 PM
#7
RE: LLVM/Clang build available
Congrats, folks. There's a lot of effort involved in a project like this. I'm really impressed that you've got it working.

SGI:  Indigo, Indigo2, Octane, Origin 300
Sun:  SPARCstation 20 (x4), Ultra 2, Blade 2500, T5240
HP:  9000/380, 425e, C8000
Digital: DECstation 5000/125, PWS 600au
jpstewart
Developer

Trade Count: (1)
Posts: 444
Threads: 6
Joined: May 2018
Location: SW Ontario, CA
Find Reply
10-01-2021, 11:06 PM
#8
RE: LLVM/Clang build available
Because vvuk and others mentioned it, I finally buckled down and got to looking at this. I found an old plaintext.js mod for sceditor, and hacked it to work with our sceditor used by MyBB (The MyBB SCEditor is customized)

I've tested with both Gecko and Webkit browsers, it appears to work fine. If you notice a browser where it chokes, lemme know.

Hopefully those of us who've been dealing with having to "Paste as plaintext" can be saved now that extra headache.

Thank you to vvuk and others who've been asking me to look into fixing it.

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,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
10-06-2021, 04:09 AM
#9
RE: LLVM/Clang build available
I've just put some updated builds up at http://misc.bitops.com/llvm-rpms -- there's RPMS for the SGUG environment (also soon available just via tdnf), and two tarballs -- one a linux cross-compiler, and one the irix build itself. Seems to work well for most things I've thrown at it so far, but please report bugs as issues over at https://github.com/vvuk/llvm-project !
vvuk
O2

Trade Count: (0)
Posts: 43
Threads: 4
Joined: Aug 2021
Location: California
Find Reply
11-23-2021, 04:43 AM
#10
RE: LLVM/Clang build available
I could build you a tardist of this likely -- it's not a big deal and would allow easier install/uninstall for users who aren't using RSE (Such as myself)

What work remains to be done as far as getting multilib support fixed? What kind of C++ projects are working?

Any "gotchas" we should know about?

If you can, it'd be also great if we could get a full "bootstrap" env we could use to build LLVM outside of using any external tools. I know that's a tall order, and I'm not expecting you to offer it necessarily. But failing that, a list of what we need to build LLVM on IRIX, patches against a stable version, and general "procedure" would be fabulous. I am interested in building a wiki article on this after all. It would also be nice to know how you built your Linux xcomp env.

Comments on the tardist packaging:

I understand that you're limited on time and everything. But /usr/sgug for a tarball is problematic. It's another include path, for instance.

I'd suggest /usr/llvm or something if you're offering an independent distribution, or for nekoware users, /usr/nekoware/llvm.

I'm willing to do this I just need ot know what the heck is actually needed to bootstrap.

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,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
11-23-2021, 05:01 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)