69

Okay, so, I switched from ubuntu 12.04 64-bit to 32-bit and installed build-essential.

I then compiled and installed GMP-5.0.5, MPFR-3.1.1, MPC-1.0, ISL-0.10 and CLOOG-0.17.0. I checked out a copy of the main gcc trunk and attempted to build it with the following configure line (from a separate directory):

../svnsrc/configure --prefix=/usr/GCC/svn --enable-__cxa_atexit --with-plugin-ld=/usr/bin/ld.gold --enable-threads=posix --enable-werror --enable-build-with-cxx --with-gmp=/usr/GCC/prereq/svn --with-mpfr=/usr/GCC/prereq/svn --with-mpc=/usr/GCC/prereq/svn --with-isl=/usr/GCC/prereq/svn --with-cloog=/usr/GCC/prereq/svn --enable-languages=c,c++

Configure ran fine and so I ran make && make check. This ran fine for a while, but then it failed with the following error:

/home/matt/GCC/svnbuild/./gcc/xgcc -B/home/matt/GCC/svnbuild/./gcc/ -B/usr/GCC/svn/i686-pc-linux-gnu/bin/ -B/usr/GCC/svn/i686-pc-linux-gnu/lib/ -isystem /usr/GCC/svn/i686-pc-linux-gnu/include -isystem /usr/GCC/svn/i686-pc-linux-gnu/sys-include    -g -O2 -O2  -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector   -fpic -mlong-double-80 -I. -I. -I../.././gcc -I../../../svnsrc/libgcc -I../../../svnsrc/libgcc/. -I../../../svnsrc/libgcc/../gcc -I../../../svnsrc/libgcc/../include -I../../../svnsrc/libgcc/config/libbid -DENABLE_DECIMAL_BID_FORMAT -DHAVE_CC_TLS  -DUSE_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../svnsrc/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS
In file included from /usr/include/stdio.h:28:0,
                 from ../../../svnsrc/libgcc/../gcc/tsystem.h:88,
                 from ../../../svnsrc/libgcc/libgcc2.c:29:
/usr/include/features.h:324:26: fatal error: bits/predefs.h: No such file or directory
 #include <bits/predefs.h>
                          ^
compilation terminated.
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/matt/GCC/svnbuild/i686-pc-linux-gnu/libgcc

I looked around, but everything I seemed to find was that this error was caused on x86_64, by not installing gcc-multilib, because Ubuntu and Debian use the mutiarch system, separating the libraries. Okay, fine...but I'm using i686, so why would I need the 64-bit libraries? Any help would be appreciated. Thanks.

mmoran
  • 1,001
  • 1
  • 8
  • 16

2 Answers2

123

Try doing a

sudo apt-get install gcc-multilib

I don't think that installing a 32-bit system changes the architecture of your computer, because your computer will always be a 64-bit machine. Installing the 64-bit version of Ubuntu should only give better multi-core performance. Since your computer is still a 64-bit computer, you probably need a C compiler that will compile on 64-bit machines. Hence the gcc-multilib. I think.

kdazzle
  • 4,190
  • 3
  • 24
  • 27
  • I did so and while it got rid of the error, I got a new one about gnu/stubs-32.h which is in `libc6-dev`. I'm just going to go back to a 64 bit 12.04. Thanks! Accepting because it did get rid of the error. – mmoran Sep 29 '12 at 17:25
  • 2
    Hmm, so you already tried doing what this suggests? http://stackoverflow.com/questions/7412548/gnu-stubs-32-h-no-such-file-or-directory – kdazzle Sep 29 '12 at 22:56
  • 1
    how is 64-bit related to multiprocessing (core use) ? – Janus Troelsen Jan 28 '13 at 11:28
  • 1
    The main change from 32-bit to 64-bit is how much memory the system can use, not multiprocessing. 32-bit systems support ~2GB of memory, whereas 64-bit systems can support up to 16 exabytes (though technically 64-bit Intel and AMD machines only address 48-bits for a max of 256 TB, which is still good enough... for now). – Dan Albert Jul 05 '13 at 18:28
  • Note I got this error on a 64 bit system too. So don't think this is a 32, 64 bit issue. But installing that package indeed solves the issue. – Calmarius Aug 01 '13 at 16:37
  • 2
    @DanAlbert: 32-bit systems support a VM model based on the PAGE_OFFSET macro value defined within the kernel (only configurable at kernel build time (usually via CONFIG_VM_SPLIT)). A typical default for 32-bit systems on Linux is a "3:1" VM split, implying 3GB usermode virtual memory and 1GB kernelmode VM. It could be 2:2, could be 1:3. – kaiwan Mar 24 '14 at 11:41
  • How about in Ubuntu 10.04 ? – DU Jiaen Aug 03 '16 at 06:35
5

the gcc-multilib trick didn't work out for me. Instead, setting this in the build environment did the trick:

C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
zultron
  • 326
  • 4
  • 4