building GCC - please check method, and results so far over multiple platforms

Toebs Douglass
Mon Apr 10 08:36:00 GMT 2017

Hi, everyone.

I am currently working to build every released version of GCC, starting
with 4.1.2, on four different platforms - aarch64, arm, mipsel and x86_64.

(I have abandoned the effort to also build glibc.)

I have been making builds over the weekend with a few successes but with
a large number of failures, and I would like to describe how I am
building here, to see if anyone can spot any mistakes.

Below the description of how I am building are the results so far - I
thought they might be a bit interesting.

1. download the source for a GCC release (into say "/tmp/src/")

2. download the matching libmpfr, libgmp and libmpc sources (I assume a
given GCC goes with the latest versions of those libraries which had
been released by the time the GCC was released)

3. place the lib sources in the root GCC directory (renaming them to
remove the part of their directory names which are version numbers)

4. making a temporary directory outside of the GCC source ("/tmp/gcc")

5. set the following environment variables (where the target/build/host
is x86_64-linux-gnu);

setenv CC gcc
setenv LIBRARY_PATH /usr/lib/x86_64-linux-gnu
setenv C_INCLUDE_PATH /usr/include/x86_64-linux-gnu
setenv CPLUS_INCLUDE_PATH /usr/include/x86_64-linux-gnu

6. changing to that temporary directory and issuing the following
configure command, where "a.b.c" is the version of GCC, i.e. "4.2.0",
and where the final install is going to be on an NFS mount, and where
the platform in this case is x86_64-linux-gnu;

/tmp/src/gcc-a.b.c./configure --build=x86_64-linux-gnu
--disable-multilib --disable-werror --disable-libvtv
--disable-decimal-float --disable-libgomp --disable-libquadmath
--disable-multiarch --enable-threads=posix --enable-languages=c
--enable-lto --host=x86_64-linux-gnu --target=x86_64-linux-gnu
--program-suffix=-a.b.c --prefix=/mnt/nfs/gcc/gcc-a.b.c/

7. make (with a decent value for -j :-)

8. make install

The results so far (aarch64 support came with GCC 4.8.0, so "na" for
earlier versions), the failures are described below;

	arm	aarch64	mipsel	x86_64
6.2.0		ok
5.2.0	fail1			ok
4.9.2	fail1	ok		ok
4.8.5		ok
4.8.0		ok
4.7.4		na
4.7.3		na
4.7.2	fail3	na
4.7.1		na
4.7.0		na
4.6.4	fail7	na
4.6.3		na
4.6.2		na
4.6.1		na
4.6.0		na
4.5.4	fail5	na
4.5.3		na
4.5.2		na
4.5.1		na
4.5.0		na
4.4.7	fail5	na	fail6
4.4.6		na
4.4.5		na
4.4.4		na
4.4.3		na
4.4.2		na
4.4.1		na
4.4.0		na
4.3.6	fail4	na	fail4
4.3.5		na
4.3.4		na
4.3.3		na
4.3.2		na
4.3.1		na
4.3.0		na
4.2.4	fail2	na	fail6
4.2.3		na
4.2.2		na
4.2.1		na
4.2.0	fail2	na	fail6	ok
4.1.2		na

1. undefined reference to `__gmpn_invert_limb'
   - GMP bug (on ARM at least), may start with 5.1, end not known
   - can be manually fixed by modifying GMP source

2. /usr/include/arm-linux-gnueabihf/gnu/stubs.h:7:29: error:
gnu/stubs-soft.h: No such file or directory
   followed by
   /usr/include/arm-linux-gnueabihf/bits/types.h:134: internal compiler
error: Segmentation fault

3. checking whether to use setjmp/longjmp exceptions... unknown
   configure: error: unable to detect exception model

4. checking for gmp internal files... configure: error: header files
gmp-impl.h and longlong.h not found

5. /tmp/src/gcc/gcc-4.4.7/libgcc/../gcc/config/arm/ieee754-df.S:499:
Error: selected processor does not support ARM mode `mvfeqd f0,#0.0'

6. /home/ci20/tmp/src/gcc/gcc-4.2.0/gcc/config/mips/linux-unwind.h:80:
error: field ‘info’ has incomplete type

7. configure: error: libgmp not found or uses a different ABI (including
static vs shared).

Note 4.1.2 is a bit awkward to build as it has problems with make after
3.7.9, where the built-in rules changed, and so I've left it alone for
now, and that many/most earlier <= 4.x.x builds fail if a modern texinfo
is installed, and that many/most later >= 5.x.x builds fail if texinfo
is not installed.  All the results here are with texinfo installed/not
installed as needed by the given version of GCC.

For me, releases earlier to 4.7.3 are important since they use the
earlier atomic intrinsics API.  As you can see, I have tried to build
the latest bugfix release of every major.minor release prior to 4.7.3
and they have all failed.  I will once I'm finished with other builds
put more attention into the most promising of them and try to make it work.

More information about the Gcc-help mailing list