LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Building gcc under FC4 (https://www.linuxquestions.org/questions/linux-software-2/building-gcc-under-fc4-471051/)

miggles 08-05-2006 11:42 AM

Building gcc under FC4
 
I am having the worst time trying to build gcc in an FC4 environment. I've built gcc in the past under IRIX, macosx, and even a cross-compiler for mips-tivo, but the FC4 build has me totally stumped. I have read stuff on the net that FC4's gcc is heavily patched and barely works, so maybe this is a futile exercise?


% uname -a
Linux migglespc 2.6.11-1.1369_FC4smp #1 SMP Thu Jun 2 23:16:33 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux

% gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)

% mkdir build411
% cd build411
% ../gcc-4.1.1/configure --enable-languages=c,c++ --prefix=${HOME}/gnu --host=x86_64-redhat-linux --enable-shared --enable-__cxa_atexit --with-system-zlib --disable-multilib
% make bootstrap
...
/bin/sh ../../gcc-4.1.1/gcc/mkconfig.sh tconfig.h
./xgcc -B./ -B/home/miggles/gnu/x86_64-redhat-linux/bin/ -isystem /home/miggles/gnu/x86_64-redhat-linux/include -isystem /home/miggles/gnu/x86_64-redhat-linux/sys-include -L/home/miggles/build411/gcc/../ld -O2 -O2 -m64 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -I. -I. -I../../gcc-4.1.1/gcc -I../../gcc-4.1.1/gcc/. -I../../gcc-4.1.1/gcc/../include -I../../gcc-4.1.1/gcc/../libcpp/include -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 ../../gcc-4.1.1/gcc/crtstuff.c -DCRT_BEGIN \
-o crtbegin.o
xgcc: braced spec body '-masm=intel %n`-mintel-syntax' is deprecated. Use `-masm=' is invalid
make[2]: *** [crtbegin.o] Error 1
make[2]: Leaving directory `/home/miggles/build411/gcc'
make[1]: *** [stage1_build] Error 2
make[1]: Leaving directory `/home/miggles/build411/gcc'
make: *** [bootstrap] Error 2



I even tried building gcc v4.0.2 using the **exact** configure shown via ``gcc -v'', and it also fails (details omitted):


...
In file included from ../../gcc-4.0.2/gcc/crtstuff.c:67:
../../gcc-4.0.2/gcc/unwind-dw2-fde.h:42: warning: type defaults to ‘int’ in declaration of ‘count’
../../gcc-4.0.2/gcc/unwind-dw2-fde.h:42: warning: data definition has no type or storage class
../../gcc-4.0.2/gcc/unwind-dw2-fde.h:44: error: syntax error before ‘}’ token
../../gcc-4.0.2/gcc/unwind-dw2-fde.h:67: error: syntax error before ‘size_t’


And speaking of gcc barely working on FC4, it looks like the 64-bit libstdc++ is seriously broken while 32-bit compiles seem to work. Even this simple code fails to link:


% cat junk.C
#include <iostream>

int main()
{
std::istream *a;
a->seekg(0, std::ios::beg);
return 0;
}

% g++ junk.C
/tmp/ccBI6HOo.o(.text+0x1e): In function `main':
junk.C: undefined reference to `std::basic_istream<char, std::char_traits<char> >::seekg(long long, std::_Ios_Seekdir)'
collect2: ld returned 1 exit status
% g++ -m32 junk.C


Is FC4 simply not ready for prime time when it comes to x86_64? Is FC5 any better? Thanks.

jlo_sandog 08-05-2006 05:00 PM

I just compiled your junk.c file 32 and 62 bit without faults. Not sure what to tell you. I dont compile a lot, but haven't had any problems when I tried.

miggles 08-07-2006 12:02 PM

jlo, did you compile using -m64? Maybe you are running FC4 on a 32-bit architecture which would default to the -m32.

This really looks to me like FC4 has a bad glibc-headers package.

jlo_sandog 08-08-2006 02:24 AM

As I wrote before, I compiled junk.c in 32bit (-m32) and 64 bit (-m64), and I'm running FC5 x86_64.


All times are GMT -5. The time now is 03:14 PM.