On Mon, Aug 24, 2015 at 11:38:25AM +0300, mostafa yasin wrote: > Dear Colleagues, > When i try to compile GCC-4.9.2 - Pass 2 using the make command, i found the > bellow error. Please how to solve this issue.
[ snipping to what is important ] > The version of the book being used:- LFS-Book 7.7 > In future, please can can you fit your text into lines of 72 characters or less in width ? i.e. add new lines, and omit the enormous number of blank spaces which you are using to indent some of your lines. Thanks. > > > The host distribution and version being used to create LF: > Red Hat Enterprise Linux Server release 5.4 for 32bit > > The package or section the problem was encountered in: > GCC-4.9.2 - Pass 2 > > checking for gawk... gawk > checking whether make sets $(MAKE)... yes > checking for i686-pc-linux-gnu-gcc... > /mnt/lfs/sources/7.7/gcc-build/./gcc/xgcc > -B/mnt/lfs/sources/7.7/gcc-build/./gcc/ -B/tools/i686-pc-linux-gnu/bin/ > -B/tools/i686-pc-linux-gnu/lib/ -isystem /tools/i686-pc-linux-gnu/include > -isystem /tools/i686-pc-linux-gnu/sys-include > checking for C compiler default output file name... a.out > checking whether the C compiler works... configure: error: in > `/mnt/lfs/sources/7.7/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[1]: Leaving directory `/mnt/lfs/sources/7.7/gcc-build' > make: *** [all] Error 2 > > Best Regards, > > Mostafa YasinLinux system engineer I'm snipping the rest, because it is the _wrong_ config.log 8) A few packages, primarily binutils and gcc, run 'configure' in multiple subdirectories, and each of these runs produces its own config.log. In this case, you are in a libstdc++-v3 directory, /mnt/lfs/sources/7.7/gcc-build/i686-pc-linux-gnu/libstdc++-v3 What you need to do is go into that directory and look at config.log. Most of it will not be interesting. What you need to do is find the error message "cannot run C compiled programs" and then look at the lines above that. There will be some other error message, usually from the compiler or the linker, possibly related to a missing file or library. Sometimes, the error will be obvious. If not, please post the lines which lead up to it (configure will assemble a program fragment and then try to compile it and perhaps try to execute it), together with the message. But first, please read the rest of my reply. I was going to stop here, but while I was trimming your original post I noticed things which look odd. I was surprised to see your host's gcc mentioned in the main config.log - at this stage we use the pass 1 cross-toolchain to build a native toolchain. I took a look at my own log (from x86_64) and I think things are wrong: > configure:3973: checking for gcc > configure:3989: found /usr/bin/gcc > configure:4000: result: gcc > configure:4229: checking for C compiler version > configure:4238: gcc --version >&5 > gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-55) > Copyright (C) 2006 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. > You should be using the -lfs- version of gcc here. Did you omit the variables before configure ? : CC=$LFS_TGT-gcc \ CXX=$LFS_TGT-g++ \ AR=$LFS_TGT-ar \ RANLIB=$LFS_TGT-ranlib > configure:8242: checking for ar > configure:8258: found /tools/bin/ar > configure:8269: result: ar > configure:8383: checking for as > configure:8399: found /tools/bin/as > configure:8410: result: as > configure:8524: checking for dlltool > configure:8554: result: no > configure:8665: checking for ld > configure:8681: found /tools/bin/ld > configure:8692: result: ld Again, these should all be -lfs- Please review what you have done (bash history, i.e. as user lfs 'history | less' or just cursor-up to go back (then cursor-down) ) and compare it to the book. Check that you set the environment variables correctly, then check what you did for each part of the build. ĸen -- This one goes up to eleven: but only on a clear day, with the wind in the right direction. -- http://lists.linuxfromscratch.org/listinfo/lfs-support FAQ: http://www.linuxfromscratch.org/blfs/faq.html Unsubscribe: See the above information page Do not top post on this list. A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail? http://en.wikipedia.org/wiki/Posting_style
