[Clfs-dev] problems cross compiling gcc

Ken Moffat zarniwhoop at ntlworld.com
Wed Dec 26 08:35:26 PST 2007


On Wed, Dec 26, 2007 at 10:35:06AM -0200, Luís Vitório Cargnini wrote:
> Dear fellows I having the following problem:
[...]
> checking for ld version... 21700
> checking for ld that supports -Wl,--gc-sections... configure: error:
> Link tests are not allowed after GCC_NO_EXECUTABLES.
> make[1]: *** [configure-target-libstdc++-v3] Error 1

 Apparently, your version of binutils (2.17) does not support the
version of gcc you are trying to compile.
> 
>  my configure  line is :
> ../../sources/gcc-4.2.1/configure --enable-cross
> --prefix=/opt/arm-linux --host=${CLFS_HOST} --target=${CLFS_TARGET}
> --disable-multilib --with-sysroot=${CLFS} --disable-nls
> --enable-shared --enable-languages=c,c++ --enable-__cxa_atexit
> --enable-c99 --enable-long-long --enable-threads=posix
> --with-headers=${CLFS_TARGET}/usr/include
> 
> Thanks for any help
> 
 You seem to be a _long_ way from  any of the clfs books!  You seem
to be nearest to clfs-sysroot, so I'll list the changes I think
might be important:

1. Your binutils is the wrong version.  Alternatively, you did
indeed build 2.18 - if that is the case, something is wrong because
configure has found the 2.17 version.

2. I'm not familiar with the sysroot build, and you haven't made it
easy for me by saying _which_  build of gcc this is.  The final
options make it look like the compile in "installing system
software", but what is the '--enable-cross' and why do you need to
pass '--with-headers' ?

3. You are installing this compiler into /opt/arm-linux : the
sysroot book puts the initial compilers into ${CLFS}/cross-tools and
the final compiler into ${CLFS}/user.  If /opt/arm-linux is the same
as ${CLFS} you are putting the compiler into the root of the system
tree.

 If all you are trying to do is build a cross-compiler for a kernel,
your prefix makes sense but you are overdoing things - no need for
c++ or posix threads: just follow the _principles_ in the _trunk_
books (any of the 32-bit books, since we don't do arm there) :
headers, cross-binutils, cross-gcc-static - that's all.

 If you are trying to build a full system, messing around with the
prefix is very likely to break your build.  The sysroot book lets you
put ${CLFS} anywhere, so /opt/arm-linux is suitable if you have write
permission there (~/arm-linux is probably better for most people) but
you cannot go deviating from the book's structure (/opt-arm-linux
instead of /opt/arm-linux/cross-tools or /opt/arm-linux/usr) and
expect it to just work.

4. Alternatively, this is the embedded book and your compiler
(4.2.1) is a lot newer than what is in the book (although your
binutils is the correct version) and again you are installing it to
a different place.

 For clfs development books, I don't think it would be appropriate
for me to tell you to FBBG - often, there will be some breakage
(that's what happens with multiple architectures), but you _do_ need
to know *why* you are deviating from what is in the book, and to
understand what might happen.

ĸen
-- 
das eine Mal als Tragödie, das andere Mal als Farce



More information about the Clfs-dev mailing list