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.
I am trying to build lfs 6.2 and until chapter 6.11 I had no big problems making it work.
But I can not compile binutils.
this is the error I get trying to make:
Code:
root:/sources/binutils-build# make tooldir=/usr
mkdir -p -- ./libiberty
Configuring in libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo
checking for perl... perl
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-ar... ar
checking for i686-pc-linux-gnu-ranlib... ranlib
checking for i686-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
make: *** [configure-libiberty] Error 1
I can't figure out how to fix this?
any ideas?
Last edited by efus; 03-28-2007 at 02:47 PM.
Reason: problem solved
configure:595: checking host system type
configure:616: checking target system type
configure:634: checking build system type
configure:689: checking for a BSD compatible install
configure:742: checking whether ln works
configure:766: checking whether ln -s works
configure:1809: checking for gcc
configure:1922: checking whether the C compiler (gcc ) works
configure:1938: gcc -o conftest conftest.c 1>&5
configure:1964: checking whether the C compiler (gcc ) is a cross-compiler
configure:1969: checking whether we are using GNU C
configure:1978: gcc -E conftest.c
configure:1997: checking whether gcc accepts -g
configure:2064: checking for gnatbind
configure:2129: checking whether compiler driver understands Ada
configure:2162: checking how to compare bootstrapped objects
configure:2260: checking for correct version of gmp.h
configure:2273: gcc -c -g -O2 conftest.c 1>&5
configure:2263:17: error: gmp.h: No such file or directory
configure: In function 'main':
configure:2267: error: 'choke' undeclared (first use in this function)
configure:2267: error: (Each undeclared identifier is reported only once
configure:2267: error: for each function it appears in.)
configure:2267: error: syntax error before 'me'
configure: failed program was:
#line 2262 "configure"
#include "confdefs.h"
#include "gmp.h"
int main() {
I know the gmp.h is just a bsd thing.
So it must be the "choke" and "me" whitch must be the problem?
[EDIT]
line 2266-2268 in the configure file looks like this:
GMP is not a bsd thing, it’s GNU’s multiple-precision arithmetic library. It should not be needed at this point. Are you sure you configured correctly?
As osor stated. GMP would only be needed in LFS if you want to build gcc to include the FORTRAN compiler. Did you run the configure script at all? Your original post shows that you were trying to compile binutils, but your errors are all configure script errors. I haven't built binutils in awhile and don't remember whether make calls the configure script again.
Are you in the chroot correctly and did you adjust the toolchain correctly (try the sanity check). Why is the prefix /usr/local/stow/binutils-2.16.1? Can you post your full configure output.
@Arow: I think binutils’ Makefile will call configure recursively in certain directories (in this case, the problem seems to be with libiberty).
I got no errors in the sanity check.
I chroot'ed like it said in the book.
I use stow as package manager, therefor the prefix.
This is the configure output:
Code:
root:/sources/binutils-build# ../binutils-2.16.1/configure --prefix=/usr/local/stow/binutils-2.16.1 --enable-shared
loading cache ./config.cache
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking build system type... i686-pc-linux-gnu
checking for a BSD compatible install... (cached) /tools/bin/install -c
checking whether ln works... (cached) yes
checking whether ln -s works... (cached) yes
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... yes
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gnatbind... no
checking whether compiler driver understands Ada... (cached) no
checking how to compare bootstrapped objects... (cached) cmp --ignore-initial=16 $$f1 $$f2
checking for correct version of gmp.h... no
checking for bison... no
checking for bison... no
checking for byacc... no
checking for yacc... no
checking for gm4... (cached) m4
checking for flex... no
checking for flex... no
checking for lex... no
checking for makeinfo... (cached) makeinfo
checking for i686-pc-linux-gnu-ar... no
checking for ar... (cached) ar
checking for i686-pc-linux-gnu-as... no
checking for as... (cached) as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... (cached) dlltool
checking for i686-pc-linux-gnu-ld... (cached) /tools/lib/gcc/i686-pc-linux-gnu/4.0.3/../../../../i686-pc-linux-gnu/bin/ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... (cached) nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... (cached) ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... (cached) windres
checking for i686-pc-linux-gnu-objcopy... no
checking for objcopy... (cached) objcopy
checking for i686-pc-linux-gnu-objdump... no
checking for objdump... (cached) objdump
checking for i686-pc-linux-gnu-ar... no
checking for ar... (cached) ar
checking for i686-pc-linux-gnu-as... no
checking for as... (cached) as
checking for i686-pc-linux-gnu-dlltool... no
checking for dlltool... (cached) dlltool
checking for i686-pc-linux-gnu-ld... no
checking for ld... (cached) ld
checking for i686-pc-linux-gnu-nm... no
checking for nm... (cached) nm
checking for i686-pc-linux-gnu-ranlib... no
checking for ranlib... (cached) ranlib
checking for i686-pc-linux-gnu-windres... no
checking for windres... (cached) windres
checking whether to enable maintainer-specific portions of Makefiles... no
checking if symbolic links between directories work... (cached) yes
creating ./config.status
creating Makefile
It would be a good thing if you start looking at the problem with as least work as possible.
Several easy steps:
1. Have you chrooted correctly? Try running mount and see what is up.
2. Have you clear out all the compiler variables (LDFLAGS, CC, CFLAGS, etc...) check them with env.
3. Is the toolchain working properly? Look at the section 5.8 (correct me if I'm wrong) which covers the toolchain stuff.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.