'Compiler cannot create executables'

Declan Moriarty junk_mail at iol.ie
Wed Aug 31 05:50:48 PDT 2005

Recently, Somebody Somewhere wrote these words
> Declan wrote on the 28.8.05 
> > I would first try compiling binutils-2.14 as per ch.6 of the book
> > (i.e.  --prefix=/usr --enable-shared or whatever the instructions
> > were I fail to see the value of the chroot. The idea of that is to
> > point at the new root dir, so your new system won't be installed
> > over the old one which is what you want when you're making a new
> > LFS. You are simply employing the compiler, hoping against hope that
> > it will fix your old system. 
> >  
> > For this compile, I would add /tools/lib and any other /tools lib
> > directories on top of /etc/ld.so.conf, and rerun ldconfig. I would
> > also mangle the path on the console you are building with thusly
> > PATH=/tools:$PATH; 
> >  
> > Then  try the make install. 
> >  
> > It may well barf on the includes(/tools/include), which I reckon
> > means another compile option (--INCLUDEDIR=/tools/include ?) or else
> > hacking the makefile 
> Can't get it any further than 'configure' at present, I'm getting the
> following error.   Is this a glibc mismatch, can't be, there're both
> the same? 
> /tools/lib/libc.so.6: undefined reference to
> `___tls_get_addr at GLIBC_2.3' collect2: ld returned 1 exit status ***
> The command '/tools/bin/gcc -o conftest -g -O2   conftest.c' failed.
> *** You must set the environment variable CC to a working compiler. 

conftest.c is a test file that the configure writes to test the
compiler. Your failure is because the old system is getting in. It looks
like your path or CC is bad.

1. On the same root console, do all of the following, and correct it if 
anything barfs. This is off the top of my head.

export CC=/tools/bin/gcc &&
export CXX=/tools/bin/c++ &&
export CPP=/tools/bin/cpp &&
PATH=/tools:$PATH &&
mv /etc/ld.so.conf /etc/ld.so.conf.bak &&
cat /tools/lib > /etc/ld.so.conf &&
cat /etc/ld.so.conf.bak >> /etc/ld.so.conf &&

Then try ./configure --help. If you can the include path, set it as
/tools/include. If you can specify ls, specify /tools/bin/ld.

Add those 2 instructions to the chapter 6 instructions and try again.

2. If this fails, do the ./configure & make in the chroot, and do the 
make install in the normal system instead of the chroot.

3. If this fails, copy in ld from the /tools directory and try that

	With best Regards,

	Declan Moriarty.

More information about the blfs-support mailing list