User Tools

Site Tools


gcc_on_irix

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
gcc_on_irix [2019/02/02 19:31]
raion
gcc_on_irix [2019/02/02 22:26] (current)
raion
Line 1: Line 1:
 =====GCC on IRIX===== =====GCC on IRIX=====
 Some versions of GCC are available and working for IRIX. Officially, support for GCC was removed in 2011 for the 4.8.x releases as per GCC's support policy. All known working versions are prior to this.  Some versions of GCC are available and working for IRIX. Officially, support for GCC was removed in 2011 for the 4.8.x releases as per GCC's support policy. All known working versions are prior to this. 
 +
 +====Compiling====
 +This section will cover compiling various GCC versions IRIX 6.5.22 or later. ​
 +
 +===4.7.3===
 +**Prerequisites**:​
 +  *texinfo
 +  *m4
 +  *bsdtar (from libarchive) or gtar
 +  *gcc 4.3.x or newer.
 +
 +This guide assumes the /opt/local prefix. ​
 +
 +First, set the kernel'​s argument space:
 +<​code>​
 +systune ncargs 65536</​code>​
 +
 +Check the LD_LIBRARY_PATH to ensure GCC libs are in PATH. 
 +
 +Make a directory in /var/tmp for the build. Then run:
 +<​code>​
 +ftp ftp://​ftp.gmplib.org/​pub/​gmp-5.1.3/​gmp-5.1.3.tar.bz2
 +ftp ftp://​ftp.gnu.org/​gnu/​binutils/​binutils-2.23.2.tar.bz2
 +ftp ftp://​ftp.gnu.org/​gnu/​mpfr/​mpfr-3.1.2.tar.bz2
 +ftp ftp://​ftp.gnu.org/​gnu/​mpc/​mpc-1.0.1.tar.gz
 +ftp ftp://​ftp.gnu.org/​gnu/​gcc/​gcc-4.7.3/​gcc-4.7.3.tar.bz2
 +tar jxf gmp-5.1.3.tar.bz2 && tar jxf binutils-2.23.2.tar.bz2 && tar jxf mpfr-3.1.2.tar.bz2 && tar zxf mpc-1.0.1.tar.gz && tar jxf gcc-4.7.3.tar.bz2
 +rm *.tar.bz2 *.tar.gz
 +</​code>​
 +
 +libgomp must be patched. ​ Create /​opt/​local/​patches/​gcc473-libgomp.patch with this inside:
 +<​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. ​ */
 +</​code>​
 +dwarf2cfi.c must be patched in order to prevent an error during the GCC build. ​ Create /​opt/​local/​patches/​gcc473-dwarf2cfi.patch
 +<​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.
 +</​code>​
 +
 +Now begin building the various components.
 +
 +GNU MP:
 +<​code>​
 +./configure --prefix=/​opt/​local/​gcc473 --enable-cxx CPPFLAGS=-fexceptions ac_cv_type_uint_least32_t=no
 +gmake
 +gmake install
 +</​code>​
 +
 +MPFR:
 +<​code>​
 +./configure --prefix=/​opt/​local/​gcc473 --with-gmp-include=/​opt/​local/​gcc473/​include --with-gmp-lib=/​opt/​local/​gcc473/​lib
 +gmake
 +gmake install
 +</​code>​
 +
 +MPCL:
 +<​code>​
 +./configure --prefix=/​opt/​local/​gcc473 --with-gmp-include=/​opt/​local/​gcc473/​include --with-gmp-lib=/​opt/​local/​gcc473/​lib --with-mpfr-include=/​opt/​local/​gcc473/​include --with-mpfr-lib=/​opt/​local/​gcc473/​lib
 +gmake
 +gmake install
 +</​code>​
 +
 +Now binutils:
 +<​code>​
 +cd .. && mkdir bu-objs && cd bu-objs
 +
 +../​binutils-2.23.2/​configure --prefix=/​opt/​local/​gcc473 --enable-obsolete --with-gmp-include=/​opt/​local/​gcc473/​include --with-gmp-lib=/​opt/​local/​gcc473/​lib --with-mpfr-include=/​opt/​local/​gcc473/​include --with-mpfr-lib=/​opt/​local/​gcc473/​lib --with-mpc-include=/​opt/​local/​gcc473/​lib --with-mpc-lib=/​opt/​local/​gcc473/​lib --without-ppl --without-cloog --without-isl --disable-werror
 +gmake
 +gmake install
 +</​code>​
 +
 +Now GCC:
 +<​code>​
 +cd ../​gcc-4.7.1 && patch < /​opt/​local/​patches/​gcc473-libgomp.patch && cd gcc && patch < /​opt/​local/​patches/​gcc473-dwarf2cfi.patch
 +
 +cd /​var/​tmp/​gccbuild && mkdir gcc-objs && cd gcc-objs
 +
 +../​gcc-4.7.3/​configure --prefix=/​opt/​local/​gcc473 --enable-obsolete --with-as=/​opt/​local/​gcc473/​bin/​as --with-gnu-as --with-gmp-include=/​opt/​local/​gcc473/​include --with-gmp-lib=/​opt/​local/​gcc473/​lib --with-mpfr-include=/​opt/​local/​gcc473/​include --with-mpfr-lib=/​opt/​local/​gcc473/​lib --with-mpc-include=/​opt/​local/​gcc473/​include --with-mpc-lib=/​opt/​local/​gcc473/​lib --enable-languages=c,​c++ --without-ppl --without-cloog --without-isl --without-gnu-ld --with-ld=/​usr/​bin/​ld --with-abi=n32
 +gmake
 +gmake install
 +</​code>​
 +
 +To run the testsuites:
 +
 +<​code>​
 +gmake check-gcc-c
 +gmake check-target-libgomp
 +gmake check-gcc-c++
 +gmake check-target-libstdc++-v3
 +</​code>​
 +
 +Larbob'​s tests yielded:
 +
 +<​code>​
 +=== gcc Summary ===
 +
 +# of expected passes ​           75096
 +# of unexpected failures ​       24
 +# of expected failures ​         112
 +# of unsupported tests          1236
 +/​var/​tmp/​gccbuild/​gcc-objs/​gcc/​xgcc ​ version 4.7.3 (GCC)</​code>​
  
 ====Known Bugs==== ====Known Bugs====
gcc_on_irix.txt ยท Last modified: 2019/02/02 22:26 by raion