LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   error while compiling gcc4.5.3 on rhel x86_64 (https://www.linuxquestions.org/questions/linux-software-2/error-while-compiling-gcc4-5-3-on-rhel-x86_64-a-897915/)

pix9 08-17-2011 03:44 PM

error while compiling gcc4.5.3 on rhel x86_64
 
hello,
Friends, I am facing error while compiling gcc4.5.3 on rhel 6.0, following are some of pre required information. whic I think would be useful for you to analyze problem.(I'm doing this whole thing on virtual machine running under kvm rhel6.0)

$ uname -r
2.6.32-71.el6.x86_64

$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.4 20100726 (Red Hat 4.4.4-13) (GCC)


Initaly I stared with just installing gcc and some group of "developement tools" available from local repo but as I faced dependencies error eventully I endedup compiling other libraries and packages like mpfr, mpc libelf, ppl etc. All these custome compiles are kept on my user's home directory have mentioned their versions on their folder-name itselfe


Following is the command I have used while configuring gcc

./configure --prefix=/usr/local --sysconfdir=/etc --with-mpfr=/home/student/mpfr-3.0.1/ --with-mpc=/home/student/mpc-0.8.2/ --with-libelf=/home/student/libelf-0.8.12/ --with-ppl=/home/student/ppl-0.11.2/


After above command I have run this

make > ~/gcc.out 2> ~/gcc.err

I am going to post some important part of this files in here and for rest I will posted their output on pastebin and provide links to keep it short overe here.


I think this can be a quick help (taken from config.log)
$ grep error config.log
conftest.c:18: error: 'choke' undeclared (first use in this function)
conftest.c:18: error: (Each undeclared identifier is reported only once
conftest.c:18: error: for each function it appears in.)
conftest.c:18: error: expected ';' before 'me'
conftest.c:10:25: error: cloog/cloog.h: No such file or directory
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
stage2_werror_flag=''


Links to file posted on pastebin
gcc.out
http://pastebin.com/AQiAUJ7W

gcc.err
http://pastebin.com/EJx1MUT4

config.log
http://pastebin.com/HbzMerBk

Thank you
Pushkar

knudfl 08-18-2011 03:11 AM

1) There can be no "./configure". GCC requires a build folder outside the source.

2) --prefix=/usr/local : Not usable.
Binaries and libraries will mix up with the system compiler in /usr/.
→ --prefix=/usr/local/gcc453/ can be used.
Then make links to /usr/bin/, like
cd /usr/bin/ && ln -s /usr/local/gcc453/bin/gcc gcc453
&& ln -s /usr/local/gcc453/bin/g++ g++453

3) gmp, mpfr, mpc must be unpacked into the gcc-4.5.3/ source folder.
( Same versions as the RHEL system gmp, mpfr, mpc if possible.)


The configure line goes like this :
../gcc-4.5.3/configure --prefix=/usr/local/gcc453 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs

More info here, post # 2
http://www.linuxquestions.org/questi...-1-a-842567/#2

..

pix9 08-18-2011 04:58 AM

Thank you for your reply, I will try it tonight, and let you know the results :)


Thank you
Pushakar

pix9 08-18-2011 01:14 PM

well My friend I have tried as you said. but results are still the same.

$ pwd
/tmp/gcc-4.5.3

$ make clean

$ ../gcc-4.5.3/configure --prefix=/home/student/gcc-4.5.3/ --sysconfdir=/etc --with-mpfr=/home/student/mpfr-3.0.1/ --with-mpc=/home/student/mpc-0.8.2/ --with-libelf=/home/student/libelf-0.8.12/ --with-ppl=/home/student/ppl-0.11.2/ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib

$ make > ~/gcc.out 2> ~/gcc.err

but out put is same.

$ grep error config.log
conftest.c:18: error: 'choke' undeclared (first use in this function)
conftest.c:18: error: (Each undeclared identifier is reported only once
conftest.c:18: error: for each function it appears in.)
conftest.c:18: error: expected ';' before 'me'
conftest.c:10:25: error: cloog/cloog.h: No such file or directory
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
stage2_werror_flag=''

$ tail ~/gcc.err
Applying io_quotes_use to rdma/ib_user_mad.h
Applying io_quotes_use to mtd/ubi-user.h
Applying io_quotes_use to sys/raw.h
Applying io_quotes_use to sys/mount.h
configure: error: in `/tmp/gcc-4.5.3/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2

technically I didn't found much of diffrence in the log files, if You still want to exermine them I can upload them.

Thank you
Pushkar

pix9 08-18-2011 01:30 PM

ok now trying to work out by extracting mpc mprf gmp source in gcc's directory

ok this is what I Have tried just now. followed by error

$ cd /tmp/
$ tar -xjvf ~/source/gcc-4.5.3.tar.bz2
$ cd gcc-4.5.3/
$ tar -xjvf ~/source/gmp-5.0.2.tar.bz2
$ mv gmp-5.0.2/ gmp
$ tar -xjvf ~/source/mpfr-3.0.1.tar.bz2
$ mv mpfr-3.0.1/ mpfr
$ tar -xzvf ~/source/mpc-0.8.2.tar.gz
$ mv mpc-0.8.2/ mpc
$ tar -xjvf ~/source/ppl-0.11.2.tar.bz2
$ mv ppl-0.11.2/ ppl
$ tar -xzvf ~/source/libelf-0.8.12.tar.gz
$ mv libelf-0.8.12/ libelf
$ ../gcc-4.5.3/configure --prefix=/home/student/gcc-4.5.3/ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs

$ make > ~/gcc.out 2> ~/gcc.err
$ grep error config.log
conftest.c:10:25: error: cloog/cloog.h: No such file or directory
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
stage2_werror_flag=''


grep error ~/gcc.err
ppl_c_Octagonal_Shape_mpq_class.cc:423: internal compiler error: Segmentation fault
../../src/ppl.hh:76408: internal compiler error: Segmentation fault

Thank you
Pushkar

knudfl 08-18-2011 03:28 PM

Quote:

$ pwd
/tmp/gcc-4.5.3
Not recommended. Default would be /home/student/tmp/
And in /home/student/tmp/ : 2 folders >> gcc-4.5.3/ and gcc-build/.
Quote:

$ make clean
Won't do. You will have to delete "gcc-4.5.3/" and start from scratch.
Quote:

--sysconfdir=/etc
GCC install no files to /etc/. GCC has no "sysconfdir".
Quote:

--with-mpfr=/home/student/mpfr-3.0.1/ --with-mpc=/home/student/mpc-0.8.2/
Will not work. Use the text in post # 2.
Quote:

--with-libelf=/home/student/libelf-0.8.12/ --with-ppl=/home/student/ppl-0.11.2/
Don't. Install elfutils-libelf-devel with yum.
( ppl : I don't know. May be usable, if you install ppl to /usr/ or /usr/local/.)

Other info http://www.linuxfromscratch.org/lfs/view/stable/
http://www.linuxfromscratch.org/lfs/...ter06/gcc.html

..

pix9 08-19-2011 02:27 AM

@knudfl
I have also tried to compile it via method similar to that of mentioned is post #2. Tho I have not followed exact instructions, right now I am going to read once again web-links give by you. And will try to exactly follow your as per your instructions. Please check the post #5 and tell me if there is any thing wrong in that method apart from those which you have mentioned in above post.Thank you for your valuable time and suggestions I'm learning new things from you. :)

Thank you.
Pushkar

pix9 08-19-2011 03:46 AM

I have tried to exactly follow the steps mentioned in this link: http://www.linuxfromscratch.org/lfs/...ter06/gcc.html
This is outcome.

$ pwd
/home/student
$ mkdir tmp
$ cd tmp/
$ mkdir gcc-build
$ tar -xjvf ../source/gcc-4.5.3.tar.bz2
$ cd gcc-4.5.3/
$ sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in
$ case `uname -m` in i?86) sed -i 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in ;; esac
$ sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
$ cd ../gcc-build/
$ tar -xjvf ../../source/mpfr-3.0.1.tar.bz2
$ mv mpfr-3.0.1/ mpfr
$ tar -xzvf ../../source/mpc-0.8.2.tar.gz
$ mv mpc-0.8.2/ mpc
$ tar -xjvf ../../source/gmp-5.0.2.tar.bz2
$ mv gmp-5.0.2/ gmp
$ tar -xjvf ../../source/ppl-0.11.2.tar.bz2
$ mv ppl-0.11.2/ ppl
$ tar -xzvf ~/source/libelf-0.8.12.tar.gz
$ mv libelf-0.8.12/ libelf
$ cd ../gcc-build/
$ ../gcc-4.5.3/configure --prefix=/usr --libexecdir=/usr/lib --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --disable-bootstrap --with-system-zlib
$ grep error -n config.log

161:conftest.c:10:25: error: cloog/cloog.h: No such file or directory
163:conftest.c:16: error: 'choke' undeclared (first use in this function)
164:conftest.c:16: error: (Each undeclared identifier is reported only once
165:conftest.c:16: error: for each function it appears in.)
166:conftest.c:16: error: expected ';' before 'me'
195:conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
212:conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
772:stage2_werror_flag=''

$ make

gcc -c -g -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.5.3/gcc -I../../gcc-4.5.3/gcc/. -I../../gcc-4.5.3/gcc/../include -I../../gcc-4.5.3/gcc/../libcpp/include -I/home/student/tmp/gcc-build/./gmp -I/home/student/tmp/gcc-4.5.3/gmp -I/home/student/tmp/gcc-build/./mpfr -I/home/student/tmp/gcc-4.5.3/mpfr -I/home/student/tmp/gcc-4.5.3/mpc/src -I../../gcc-4.5.3/gcc/../libdecnumber -I../../gcc-4.5.3/gcc/../libdecnumber/bid -I../libdecnumber -I/home/student/tmp/gcc-build/./ppl/src -I/home/student/tmp/gcc-build/./ppl/interfaces/C -D__LIBELF_INTERNAL__ -I/home/student/tmp/gcc-build/./libelf/lib -I/home/student/tmp/gcc-4.5.3/libelf/lib insn-attrtab.c -o insn-attrtab.o
../../gcc-4.5.3/gcc/config/i386/i386.md: In function ‘internal_dfa_insn_code’:
../../gcc-4.5.3/gcc/config/i386/i386.md:360: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
The bug is not reproducible, so it is likely a hardware or OS problem.
make[2]: *** [insn-attrtab.o] Error 1
make[2]: Leaving directory `/home/student/tmp/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/student/tmp/gcc-build'
make: *** [all] Error 2




$ grep -i error config.log

conftest.c:10:25: error: cloog/cloog.h: No such file or directory
conftest.c:16: error: 'choke' undeclared (first use in this function)
conftest.c:16: error: (Each undeclared identifier is reported only once
conftest.c:16: error: for each function it appears in.)
conftest.c:16: error: expected ';' before 'me'
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
conftest.c:10:28: error: ac_nonexistent.h: No such file or directory
stage2_werror_flag=''

Thank you
Pushkar

knudfl 08-19-2011 06:03 AM

"GCC 4.5.3 for EL 6"
 
! The versions must be these : gmp-4.3.1 , mpfr-2.4.1 , ppl-0.10.2 !
Mpc-0.8.2 is OK. ( Is compiled into the binaries and then not used any more.)

libelf and ppl has nothing to do in the gcc-4.5.3/ folder.
The ppl packages (ppl and cloog-ppl) must be installed :
cloog-ppl-devel.x86.64 (0.15.7-1.2.el6) , ppl-devel.x86_64 (0.10.2-11.el6).

**elf must be elfutils-0.152 : rpmbuild --rebuild elfutils-0.152-1.el6.src.rpm
http://ftp.redhat.com/pub/redhat/lin...-1.el6.src.rpm
( http://ftp.redhat.com/pub/redhat/lin...t/en/os/SRPMS/ )
.. and then install the 5 packages elfutils-0.152-1.el6.x86_64.rpm
elfutils-libelf-0.152-1.el6.x86_64.rpm elfutils-libs-0.152-1.el6.x86_64.rpm
elfutils-devel-0.152-1.el6.x86_64.rpm elfutils-libelf-devel-0.152-1.el6.x86_64.rpm
Or get them here http://ftp.scientificlinux.org/linux...4/os/Packages/


cd gcc-4.5.3/ && mv gmp* gmp && mv mpfr* mpfr && mv mpc* mpc
&& cd ../ && mkdir gcc-build && cd gcc-build/ &&
../gcc-4.5.3/configure --prefix=/usr/local/gcc453 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs
&& make : No errors. ( Make time = 2 hours, Pentium D 3.2 GHz.)
# make install : OK too.

..

pix9 08-20-2011 10:25 AM

It didn't worked even the way mentioned in post above, will retry from scratch and update this post with logs and stuffs if it fails again.
I have 1 question!!
I am trying all this stuff on virtual machine. if I try those on base machine could it change things?(ie change failure to success)"my basic understanding tell me that things should not differ on actual machine and virtual machine when virtual machine is fully virtualized"

Thank You
Pushkar

knudfl 08-20-2011 10:50 AM

Possible causes for errors : Some text change in the configure line.
The only option for editing is the "--prefix".

If you replace or omit the "$(pwd)" stuff, things go wrong.
( The location for the 2 times '$(pwd)' is actually the gcc-build/ folder.)

And # 'yum install cloog-ppl-devel elfutils' is a must.

GCC doesn't care, if it's an hd installed OS or a virtual one.

..

pix9 08-20-2011 11:28 AM

Quote:

Originally Posted by knudfl (Post 4447611)
! The versions must be these : gmp-4.3.1 , mpfr-2.4.1 , ppl-0.10.2 !
Mpc-0.8.2 is OK. ( Is compiled into the binaries and then not used any more.)

well when I was going through prequisite.html file from INSTALL section I have found that minimum version of gmp-4.3.2 and mpfr-2.4.2 is required. :)

gonna try with those now :)

pix9 08-20-2011 03:34 PM

Well after going through the INSTALL manual I have downloaded specified versions of sources for required libs ie (gmp-4.3.2, mpfr-2.4.2, mpc-0.8.2, ppl-0.10.2, cloog-ppl-0.15.10) downloaded most of these from sources mentioned in perquisite.html file in INSTALL folder of gcc-4.5.3 source. I am not going to repate those extraction and configure steps here because those are same.

this time I have encountered while running make
following error (check line number 69)
http://pastebin.com/CGwKrNBj
which took me to following link
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45993

well retiring for tonight.
will come back with either solution or new errors tomorrow. :D

Thank you
Pushkar

pix9 08-21-2011 09:09 AM

Quote:

Originally Posted by knudfl (Post 4448640)
Possible causes for errors : Some text change in the configure line.
The only option for editing is the "--prefix".

If you replace or omit the "$(pwd)" stuff, things go wrong.
( The location for the 2 times '$(pwd)' is actually the gcc-build/ folder.)

And # 'yum install cloog-ppl-devel elfutils' is a must.

GCC doesn't care, if it's an hd installed OS or a virtual one.

..


sorry I missed out this post yesterday may be because of slow Internet connection or I was too much focused on reading my errors. saw this today. will dig about it :D
Hurray Got new thing to start with :D,
@knudfl
I really appreciae your patience, with someone noob like me :D , really Thankful to you :)
*prays successful compile this time* ok will document each and every step this time, well I have also mentioned some information in posts above :) hope you have gone through them :D

Thank you
Pushkar

pix9 08-21-2011 01:14 PM

temperory victory :D :P
 
well good news this time :D compilation succeded even tho with errors it did compleated :D
well these are some of the logs I would like to let you guys know

I started with these steps
$ rpm -qa |grep cloog
cloog-ppl-0.15.7-1.2.el6.x86_64
cloog-ppl-devel-0.15.7-1.2.el6.x86_64

$ rpm -qa |grep elf
elfutils-libelf-0.152-1.el6.x86_64
elfutils-0.152-1.el6.x86_64
elfutils-libelf-devel-0.152-1.el6.x86_64
elfutils-libs-0.152-1.el6.x86_64
elfutils-devel-0.152-1.el6.x86_64

$ rpm -qa |grep gmp
gmp-devel-4.3.1-7.el6.x86_64
gmp-4.3.1-7.el6.x86_64
gmp-static-4.3.1-7.el6.x86_64

$ rpm -qa |grep mpc
libmpcdec-devel-1.2.6-6.1.el6.x86_64
libmpcdec-1.2.6-6.1.el6.x86_64

$ rpm -qa |grep mpfr
mpfr-devel-2.4.1-6.el6.x86_64
mpfr-2.4.1-6.el6.x86_64

$ rpm -qa |grep ppl-
cloog-ppl-0.15.7-1.2.el6.x86_64
ppl-0.10.2-11.el6.x86_64
cloog-ppl-devel-0.15.7-1.2.el6.x86_64
ppl-devel-0.10.2-11.el6.x86_64

$ ls ~/source/
cloog-ppl-0.15.10.tar.bz2 gcc-core-4.5.3.tar.bz2 libelf-0.8.12.tar.bz2 mpfr-2.4.2.tar.bz2
gcc-4.5.3.tar.bz2 gmp-4.3.2.tar.bz2 mpc-0.8.2.tar.bz2 ppl-0.10.2.tar.bz2

$ cd /home/student/tmp
$ tar -xjvf ~/source/gcc-4.5.3.tar.bz2
$ cd gcc-4.5.3/
$ tar -xjvf ~/source/gmp-4.3.2.tar.bz2
$ mv gmp-4.3.2/ gmp
$ tar -xjvf ~/source/mpfr-2.4.2.tar.bz2
$ mv mpfr-2.4.2/ mpfr
$ tar -xjvf ~/source/mpc-0.8.2.tar.bz2
$ mv mpc-0.8.2/ mpc
$ cd ../ && mkdir gcc-build && cd gcc-build/ &&
../gcc-4.5.3/configure --prefix=/usr/local/gcc453 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ --disable-multilib --with-system-zlib --with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs
&& make 2> ~/gcc.err

here while running make I was hit by an error, and the make process was stopped. I ran make command again, again it stoped and exited with error messeg with giving some output, I run make command once again :P and BINGO some avtivity started and continewed for around next 30 minuts and make exited with 0 exit status

then I run
$ make install
$ echo $?
0
I guess it has installed not sure how it will work tho. Hope it is good enough for compiling kernel 3.X :D

well here is the ~/gcc.err file output if any one intrested

http://pastebin.com/AK3CU2VU

Not declaring this solved until kernel 3.x is compiled sucessfully, well if this compilations throws any error in future, You will see me her again :D, well I also wanted to builtup rpm for this build any suggestion link refrences ? I want to migrate this gcc from vm to my host machine. Please suggest me some way, I would preffer to keep it preserved in from of rpm :D

Now next thing I need is to use this binaries for compiling new kernel. Can any one give me refrence of HoTo?, I am going to google it any way :D

Thank you
Pushkar


All times are GMT -5. The time now is 05:13 PM.