LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 03-04-2011, 02:16 PM   #1
frank zhu
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Rep: Reputation: 0
ch5:10 - gcc 4.5.1 pass 2 compile error


Hi,
I am using lfsliveCD 6.3 and followed book v6.7. Thanks for helping out.

-- version check on host output as --

bash, version 3.2.17(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils) 2.20.1.20100303
bison (GNU Bison) 2.3
/usr/bin/yacc -> /usr/bin/yacc
bzip2, Version 1.0.4, 20-Dec-2006.
Coreutils: 6.9
diff (GNU diffutils) 2.8.1
GNU find version 4.2.31
GNU Awk 3.1.5
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 4.1.2
GNU C Library stable release version 2.5.1
grep (GNU grep) 2.5.1
gzip 1.3.12
Linux version 2.6.22.5 (root@kerrek) (gcc version 4.1.2) #1 SMP Sat Dec 29 22:40:37 GMT 2007
m4 (GNU M4) 1.4.10
GNU Make 3.81
patch 2.5.4
Perl version='5.8.8';
GNU sed version 4.1.5
tar (GNU tar) 1.18
Texinfo: makeinfo (GNU texinfo) 4.9
Compilation OK


--- make error message: ---

mkdir: created directory `../gcc-build'
*** This configuration is not supported in the following subdirectories:
target-libada gnattools target-libgfortran target-libffi target-zlib target-libjava target-libobjc target-libgomp target-boehm-gc
(Any other directories should still work fine.)
press any key to continue..configure: WARNING: fixed-point is not supported for this target
Links are now set up to build a native compiler for i686-pc-linux-gnu.
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: cannot check for properly working vsnprintf when cross compiling, will assume it's ok
...
configure: error: in `/mnt/lfs/sources/gcc-build/i686-pc-linux-gnu/libstdc++-v3':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make[1]: *** [configure-target-libstdc++-v3] Error 1
make: *** [all] Error 2

--- config.log errors: ---

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.64. Invocation command line was

$ ../gcc-4.5.1/configure --prefix=/tools --with-local-prefix=/tools --enable-clocale=gnu --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-languages=c,c++ --disable-libstdcxx-pch --disable-multilib --disable-bootstrap --disable-libgomp --with-gmp-include=/mnt/lfs/sources/gcc-build/gmp --with-gmp-lib=/mnt/lfs/sources/gcc-build/gmp/.libs --without-ppl --without-cloog

## --------- ##
## Platform. ##
## --------- ##

hostname = lfslivecd
uname -m = i686
uname -r = 2.6.22.5
uname -s = Linux
uname -v = #1 SMP Sat Dec 29 22:40:37 GMT 2007

/usr/bin/uname -p = unknown
/bin/uname -X = unknown

/bin/arch = i686
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /tools/bin
PATH: /bin
PATH: /usr/bin

...

configure:6004: checking how to run the C preprocessor
configure:6035: i686-lfs-linux-gnu-gcc -B/tools/lib/ -E conftest.c
configure:6035: $? = 0
configure:6049: i686-lfs-linux-gnu-gcc -B/tools/lib/ -E conftest.c
conftest.c:10:28: fatal error: ac_nonexistent.h: No such file or directory
compilation terminated.
configure:6049: $? = 1
configure: failed program was:
| /* confdefs.h */

...

configure:6475: checking libelf.h usability
configure:6475: i686-lfs-linux-gnu-gcc -B/tools/lib/ -c -g -O2 -I/usr/include/libelf -I/usr/include/libelf conftest.c >&5
conftest.c:53:20: fatal error: libelf.h: No such file or directory
compilation terminated.
configure:6475: $? = 1
configure: failed program was:
| /* confdefs.h */

...

configure:6487: checking gelf.h usability
configure:6487: i686-lfs-linux-gnu-gcc -B/tools/lib/ -c -g -O2 -I/usr/include/libelf -I/usr/include/libelf conftest.c >&5
conftest.c:53:18: fatal error: gelf.h: No such file or directory
compilation terminated.
configure:6487: $? = 1
configure: failed program was:
| /* confdefs.h */

...
 
Old 03-05-2011, 04:19 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

I'm not able to find what the problem might be with the above info.

A few pointers/questions:

- Did you remove the gcc source and build dir before starting with pass 2 (the leftovers from pass 1). You should.
- Are you sure you did not make any mistakes with the given commands in chapter 5.10 (copy/paste those if at all possible).
- Did you unpack the GMP, MPFR and MPC packages in the gcc source directory (and _not_ the gcc-build directory).

I would suggest removing the source and build dir and try chapter 5.10 from the beginning.

Hope this helps.
 
Old 03-07-2011, 07:36 AM   #3
frank zhu
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
hi,
1. Yes I did.
2. Actually rather than typing, I use shell script and pasted below. My PC is i686 32 bit so 64bit operations are omitted. I compared with book and didn't found any difference.
3. Yes.

Thanks for any further help!

== gcc2.sh ==
#!/bin/bash
tar -xjf gcc-4.5.1.tar.bz2
cd gcc-4.5.1
patch -Np1 -i ../gcc-4.5.1-startfiles_fix-1.patch

cp -v gcc/Makefile.in{,.orig}
sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in

cp -v gcc/Makefile.in{,.tmp}
sed 's/^T_CFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp > gcc/Makefile.in

for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.h)
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_INCLUDE_DIR
#define STANDARD_INCLUDE_DIR 0
#define STANDARD_STARTFILE_PREFIX_1 ""
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done
tar -jxf ../mpfr-3.0.0.tar.bz2
mv -v mpfr-3.0.0 mpfr
tar -jxf ../gmp-5.0.1.tar.bz2
mv -v gmp-5.0.1 gmp
tar -zxf ../mpc-0.8.2.tar.gz
mv -v mpc-0.8.2 mpc

mkdir -v ../gcc-build
cd ../gcc-build

CC="$LFS_TGT-gcc -B/tools/lib/" \
AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib \
../gcc-4.5.1/configure --prefix=/tools \
--with-local-prefix=/tools --enable-clocale=gnu \
--enable-shared --enable-threads=posix \
--enable-__cxa_atexit --enable-languages=c,c++ \
--disable-libstdcxx-pch --disable-multilib \
--disable-bootstrap --disable-libgomp \
--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
--without-ppl --without-cloog

time { make && make install && ln -vs gcc /tools/bin/cc; }

Last edited by frank zhu; 03-07-2011 at 07:44 AM.
 
Old 03-07-2011, 08:19 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

If this is your first LFS build I would strongly suggest not using scripts. Especially the one in post #3!! I do not see _any_ error checking whatsoever on the successful completion of the commands, if one of the commands fails, the script will keep running and you won't have any idea what will happen in that scenario. The LFS book does contain the occasional mistake (wrong version number, tarring a tar.gz instead of a tar.bz2 file etc).

If at all possible copy and paste the individual sections. If all is ok, do the next section.

I also noticed the following: You are building gcc 4.5.1, the 6.7 stable book points to gcc 4.5.2.......

I can only assume you also used scripts for the previous parts, which makes it all but impossible to determine if and where things could have gone wrong.

2 questions:

- What does the LFS_TGT variable hold?
- What file-system are you building LFS on?
 
Old 03-07-2011, 10:15 AM   #5
frank zhu
LQ Newbie
 
Registered: Mar 2011
Posts: 10

Original Poster
Rep: Reputation: 0
hi

As I am building lfs, the current stable version move on to 6.8, which will build gcc 4.5.2. The 6.7 version still points to gcc 4.5.1

reply to your questions
1. LFS_TGT=i686-lfs-linux-gnu
2. the file system is ext3 type, i followed lfs book to create a separate partition and format it to ext3, then mount it.

I understand your points about scripts. Yes I created all scripts and run them by
bash gcc2.sh 2> errlog

and check the errlog and try to save the typing and typo error when I have to do it multiple times.

Anyway I will have to try to remake the gcc 4.5.1 pass 2 by typing and typing...

Last edited by frank zhu; 03-07-2011 at 10:18 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc second pass does not compile. LFS version 6.4 5.12 arielsegal Linux From Scratch 18 06-15-2009 11:12 AM
unable to compile gcc 4.1.2 pass 1 version 6.3 Abdou_ENSI Linux From Scratch 2 01-30-2009 11:28 AM
GCC pass 1 error mugwump84 Linux From Scratch 2 05-10-2005 05:21 PM
gcc make error in ch5.5 of LFS 6.0 Barnette Linux From Scratch 5 01-03-2005 11:09 AM
Chapter 5, GCC pass 1: compile failure Electrode Linux From Scratch 0 08-16-2003 07:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 10:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration