Building everything in-tree:
This is broken with SGUG builds and patches. There's also some crucial omissions that were made, likely not intentional, that caused some weird issues with this. This is not a dig against them, mind you, just me sharing what I've learnt:
Patching GMP:
https://pkgsrc-bugs.netbsd.narkive.com/b...ld-on-irix
These patches must be applied to make GMP build in tree.
Patching Libgomp:
Originally brought to my attention by Larbob, libgomp on IRIX doesn't properly detect multiple CPUs.
Code:
diff -urnp libgomp-orig/config/posix/proc.c libgomp/config/posix/proc.c
*** libgomp-orig/config/posix/proc.c Sat Dec 8 14:57:52 2012
--- libgomp/config/posix/proc.c Sat Dec 8 14:58:43 2012
***************
*** 38,43 ****
--- 38,48 ----
#endif
+ #ifdef __sgi
+ #define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
+ #endif
+
+
/* At startup, determine the default number of threads. It would seem
this should be related to the number of cpus online. */
To fix bootstrapping builds, you need to patch gcc/dwarf2cfi.c:
Code:
--- dwarf2cfi.c 2012-01-10 00:28:55.000000000 -0800
+++ dwarf2cfi_patch.c 2018-07-20 14:42:17.251616220 -0700
@@ -1240,6 +1240,10 @@
add_cfi_restore (regno);
update_row_reg_save (cur_row, regno, NULL);
+ if (REG_P (INCOMING_RETURN_ADDR_RTX)
+ && regno == dwf_regno (INCOMING_RETURN_ADDR_RTX)
+ && regno != DWARF_FRAME_RETURN_COLUMN)
+ reg_save (DWARF_FRAME_RETURN_COLUMN, regno, 0);
}
/* A subroutine of dwarf2out_frame_debug, process a REG_CFA_WINDOW_SAVE.
Make sure download_prerequists symlinks everything. On GCC 4.9.x and before, you can use Cloog for graphite optimizations. I don't recommend ppl, because it's a pain to build in tree, unless you patch getopt.h to include libxg's <compat/getopt.h> which I've never tested, and add -lxg to ppl to add getopt support. isl though, is fine. symlink cloog to your actual unpacked cloog directory name.
For libstdc++v3, SGUG's RSE includes patches that add to sections of configure and acinclude.m4 $OPT_LDFLAGS to prevent pthread linking issues.
https://raw.githubusercontent.com/sgidev...pp01.patch
https://raw.githubusercontent.com/sgidev...pp02.patch
You may need to manually find and apply the lines on older versions, but I'll be releasing standalone, compound patches for helping with this. I will also explicitly be cleaning up a lot of messiness in danielhams' didbs packages (many things in there only apply to MINGW/DJGPP, which is not relevant for us) as well as looking into trying to get GNAT working perhaps. I can't guarantee it, though. If someone who knows alt languages wants Fortran, ObjC, or even Java support, I can try to help. I'm not thrilled about this, mind you, because GCC is annoying in places, but I've accepted that this is pragmatic to go ahead and use the stuff SGUG's userbase has graciously tested, and perhaps some of what I reveal here can be given back to them if they want. All I would ask for is credit for any issues I independently discover, the stuff here though, just lift straight up since I don't know who originally discovered some of these patches.
I also recommend not doing what I did, not realizing it can break things, and build in a separate directory from GCC's tree. I used dejagnu from didbs, but I suspect Nekoware's would work too.
Expect the new GCC soonish. i want to see if it can compile newer versions of GCC without compounding erroneous builds, and I have a mountain of older GCC patches and notes and forum posts to go through, plus help from a friend. GCC 4.8.5 testsuite results:
https://pastebin.com/dXmcaeUv -- some of these are probably due to removed support for IRIX. I'd like to get them minimized, so if anyone has any ideas or helpful stuff I may have overlooked, I'd appreciate 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.