GCC builds for i686 ################### In this directory, GCC builds for Linux i686 systems are provided. They encompass compilers for the c, c++ and fortran languages built on a x86_64 Linux system with glibc 2.17, doing a 32bit-only build as described in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42345#c17 The provided binaries need glibc 2.17 or newer. For most desktop Linux installations and newer enterprise Linux distributions (from RHEL 7 and SLES 12 onwards), this requirement should be no problem. The builds need fairly new auxiliary libraries however. If your system does not provide up-to-date libraries of libgmp, libmpfr, libmpc and libisl, you can find them in the archive gcc-infrastructure-32bit.tar.xz. The provided binaries expect binutils with plugin support (ld 2.21 or newer), otherwise you might encounter an error like "collect2: fatal error: cannot find 'ld'" when compiling. However, you can disable plugin support so the provided GCC binaries work also with older binutils. Simply use the option "-fno-use-linker-plugin" when you compile your programs. Compression: The provided archives are compressed with xz (http://tukaani.org/xz/), which is an upcoming compression standard for Linux platforms. On newer Linux distributions, xz is installed per default, and from version 1.22 on, tar provides transparent decompression just like for gzip and bzip2. For systems not providing xz, binaries are provided in the archive xz-32bit.tar.gz. In the directory releases, you will find builds of official releases of GCC. In the directory nightlies, you will find daily builds of GCC trunk. The snapshots directory provides weekly to two-weekly builds of shapshots as found in ftp://gcc.gnu.org/pub/gcc/snapshots/. The sources you will find in the sources directory of the x86_64 builds. For these builds, libraries contain debug information. Builds are lto- and gold-enabled. Trunk builds contain debug information. For illustration, here are the commands for trunk builds: CC="gcc -march=i686 -m32 -Wa,--32" CXX="g++ -march=i686 -m32 -Wa,--32" \ LDFLAGS="-Wl,--library-path -Wl,/usr/lib" ../gcc-trunk-source/gcc/configure \ --enable-languages=c,c++,fortran \ --enable-checking=release \ --disable-libstdcxx-pch --enable-libgomp \ --enable-lto --enable-gold --with-plugin-ld=gold \ --prefix=/usr/local/gcc-trunk i686-linux make -j4 BOOT_CFLAGS="-g -O2" bootstrap2-lean install & use: -------------- Libraries: If you don't have all the needed auxiliary libraries, unpack gcc-infrastructure-32bit.tar.xz in a directory you like. If this directory is not a standard directory, you will either have to edit /etc/ld.so.conf and run ldconfig, or set LD_LIBRARY_PATH appropriately. Compiler: Just unpack the archive in a directory you like. You may need to update the PATH variable to point to the bin directory of gcc: export PATH=my_new_gcc_directory/bin:$PATH If you do not perform static program builds, you may need to update LD_LIBRARY_PATH, use the ldconfig mechanism or use the -rpath link option: gfortran -Wl,--rpath,my_new_gcc_directory/lib -o myprogram myprogram.f The rpath approach does not work out-of-the-box, as libgfortran.so.*.0.0 and lib*san.so.*.0.0 have the wrong rpaths built in after installing in a custom location. This results in libquadmath.so to be not found. You can however adjust the rpath of libgfortran and lib*san using patchelf (http://nixos.org/patchelf.html; to be able to debug libgfortran itself, you need version 0.7 or newer): for f in libcc1.so.0.0.0 libgfortran.so.*.0.0 lib*san.so.*.0.0; do patchelf --set-rpath my_new_gcc_directory/lib my_new_gcc_directory/lib/$f done Happy hacking!