Building GCC on FC4

This week Mozilla bought be a brand-spankin-new uber-powerful computer. I’m still getting to love it’s wonderfulness. I rearranged my machines so that the new machine (dual Athlon64, 4gig RAM) is running WinXP, my former Windows machine (Athlon64, 1gig RAM) is running FC4 (x64_64), and I’m going to retire my rather ancient Athlon1.2gig box which is running RH9.

The new Fedora Core has been giving me fits. First of all I couldn’t get the DVD image burned until the fifth try, for unknown reasons. Then the anaconda installer didn’t like some combination of custom install options I gave it. I finally broke down and told it to do a default “Workstation” install, and it finally installed.

Next, I tried to get both of my video cards to work in this machine. No dice. If I set the AGP card as the primary card in CMOS, I can’t get the secondary (PCI) card to display anything at all. If I set the PCI card as primary, I can get it to show up the first restart, but after that it doesn’t work again. Funnily, occasionally the boot sequence tells me that it found new hardware, please enter my root password. But I can never seem to enter it correctly…

Now, I’m running into the GCC 4.0 bug where hidden-visibility symbols are not compiled correctly, leading to the following error:
/usr/bin/ld: jsapi.o: relocation R_X86_64_PC32 against `memset@@GLIBC_2.2.5′ can not be used when making a shared object; recompile with -fPIC
Shaver said that this bug was fixed on the gcc4.0.x cvs, so I tried to build GCC from CVS. I can’t. I try the following configure steps:

CFLAGS="-m64" ../4.0.1-branch/configure --prefix=/builds/gcc/4.0.1-branch-installed --enable-languages=c,c++ --host=x86_64-redhat-linux --enable-shared --enable-__cxa_atexit --with-system-zlib

Compilation fails after a while with the following error:

./xgcc -B./ -B/builds/gcc/4.0.1-branch-installed/x86_64-redhat-linux/bin/ -isystem /builds/gcc/4.0.1-branch-installed/x86_64-redhat-linux/include -isystem /builds/gcc/4.0.1-branch-installed/x86_64-redhat-linux/sys-include -L/builds/gcc/4.0.1-branch-objdir/gcc/../ld -O2 -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I32 -I../../4.0.1-branch/gcc -I../../4.0.1-branch/gcc/32 -I../../4.0.1-branch/gcc/../include -I../../4.0.1-branch/gcc/../libcpp/include  -m32 -g0 -finhibit-size-directive -fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss -fno-unit-at-a-time -fno-omit-frame-pointer -fno-asynchronous-unwind-tables \
   -c ../../4.0.1-branch/gcc/crtstuff.c -DCRT_BEGIN \
  -o 32/crtbegin.o
In file included from /usr/include/features.h:337,
                 from /usr/include/stdio.h:28,
                 from ../../4.0.1-branch/gcc/tsystem.h:90,
                 from ../../4.0.1-branch/gcc/crtstuff.c:64:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

Does anyone know why, when I configured explicitly with -m64, it is still compiling with -m32 and looking for the 32-bit headers (which do not exist on this system)?

Update: 7-Sep-2005:

A helpful soul (pinskia) on told me to use –disable-multilib and I seem to be in business. I would still like to figure out what I would need to install to get multilib working. Obviously redhat has multilib.

Atom Feed for Comments 6 Responses to “Building GCC on FC4”

  1. Shaun savage Says:

    Please install CentOS 4.1 on your new machine. It is stable and a good development platform. A dual boot is easy to do, if you still want Win stuff. But xulrunner will be used in linux embedded systems more that MSwindows.

    BS responds: Why would I want another OS? My FC4 box is powerful enough for next few years to do any amount of XULRunner development. And it is ridiculous to think that XULRunner will be more used in Linux embedded systems than on Windows: much of the early XULRunner adoption will be with Firefox and with intranet and corporate application deployment, and that is still a predominantly Windows-centric install base.

  2. Todd Says:

    Yep, SimoHealth for example plans to ship our next version using xulrunner, and that’s primarily a windows app.

  3. Arun Sharma Says:

    Or install this rpm:

  4. Brandon Barker Says:

    This also helped me build a stage 3 prerelease of gcc 4.2 on OpenSuSE 10.2.

  5. Thomas Chevrier Says:

    Any news on this? I have the same problem!

  6. Peter Says:

    –disable-multilib implied –enable-compilation-of-gcc-4-2-1 ;-)

    great! Thanks for making this public. configure –help does not tell about this :-(

Leave a Reply