Linux From ScratchThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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 */
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.
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
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?
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...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.