[Clfs-dev] problems cross compiling gcc

Luís Vitório Cargnini lvcargnini at gmail.com
Thu Dec 27 10:45:42 PST 2007


well before start let me introduce my env variables:
export CLFS="/opt/arm-linux/arm-linux-gnueabi"
export CLFS_CROSSTOOLS="/opt/arm-linux/bin"
export CLFS_HOST="i686-pc-linux-gnu"
export CLFS_TARGET="arm-linux-gnueabi"

well my binutils 2.18 compiled but, with different arguments not exactly
like the book, I used the following:
AR=ar AS=as ../../sources/binutils-2.18/configure --prefix=/opt/arm-linux
--target=${CLFS_TARGET}   --enable-shared --host=i686

I don't know why, but was the only way to it configure and compilate, after
this I did the glibc-headers install,gcc-static, glibc-arm and now I stoped
in the gcc-arm (chapter 5.9), I used the default compilation line in the
book and get the following result after make:

hecking whether stripping libraries is possible... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking command to parse
/home/lvcargnini/puc/instramed/toolchain/build/gcc-arm/./gcc/nm output...
failed
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
appending configuration tag "CXX" to libtool
checking for exception model to use... call frame
checking for compiler with PCH support... no
checking for enabled PCH... no
checking for underlying I/O to use... stdio
checking for ANSI C header files... no
checking for sys/types.h... no
checking for sys/stat.h... no
checking for stdlib.h... no
checking for string.h... no
checking for memory.h... no
checking for strings.h... no
checking for inttypes.h... no
checking for stdint.h... no
checking for unistd.h... no
checking for C locale to use... generic
checking for std::allocator base class... new
configure: "C" header strategy set to c_std
checking for enabled long long specializations... yes
checking wchar.h usability... no
checking wchar.h presence... yes
configure: WARNING: wchar.h: present but cannot be compiled
configure: WARNING: wchar.h:     check for missing prerequisite headers?
configure: WARNING: wchar.h: see the Autoconf documentation
configure: WARNING: wchar.h:     section "Present But Cannot Be Compiled"
configure: WARNING: wchar.h: proceeding with the preprocessor's result
configure: WARNING: wchar.h: in the future, the compiler will take
precedence
configure: WARNING:     ## ----------------------------------------- ##
configure: WARNING:     ## Report this to the package-unused lists.  ##
configure: WARNING:     ## ----------------------------------------- ##
checking for wchar.h... yes
checking for mbstate_t... no
checking wctype.h usability... no
checking wctype.h presence... yes
configure: WARNING: wctype.h: present but cannot be compiled
configure: WARNING: wctype.h:     check for missing prerequisite headers?
configure: WARNING: wctype.h: see the Autoconf documentation
configure: WARNING: wctype.h:     section "Present But Cannot Be Compiled"
configure: WARNING: wctype.h: proceeding with the preprocessor's result
configure: WARNING: wctype.h: in the future, the compiler will take
precedence
configure: WARNING:     ## ----------------------------------------- ##
configure: WARNING:     ## Report this to the package-unused lists.  ##
configure: WARNING:     ## ----------------------------------------- ##
checking for wctype.h... yes
checking for enabled wchar_t specializations... no
checking for ISO C99 support in <math.h>... no
checking complex.h usability... no
checking complex.h presence... yes
configure: WARNING: complex.h: present but cannot be compiled
configure: WARNING: complex.h:     check for missing prerequisite headers?
configure: WARNING: complex.h: see the Autoconf documentation
configure: WARNING: complex.h:     section "Present But Cannot Be Compiled"
configure: WARNING: complex.h: proceeding with the preprocessor's result
configure: WARNING: complex.h: in the future, the compiler will take
precedence
configure: WARNING:     ## ----------------------------------------- ##
configure: WARNING:     ## Report this to the package-unused lists.  ##
configure: WARNING:     ## ----------------------------------------- ##
checking for complex.h... yes
checking for ISO C99 support in <complex.h>... no
checking for ISO C99 support in <stdio.h>... no
checking for ISO C99 support in <stdlib.h>... no
checking for ISO C99 support in < wchar.h>... no
checking for fully enabled ISO C99 support... no
configure: Debug build flags set to -g3 -O0
checking for additional debug build... no
checking for extra compiler flags for building...
checking for thread model used by GCC... posix
checking for atomic builtins... no
checking for g++ that supports -ffunction-sections -fdata-sections... yes
checking nan.h usability... no
checking nan.h presence... no
checking for nan.h... no
checking ieeefp.h usability... no
checking ieeefp.h presence... no
checking for ieeefp.h... no
checking endian.h usability... no
checking endian.h presence... yes
configure: WARNING: endian.h: present but cannot be compiled
configure: WARNING: endian.h:     check for missing prerequisite headers?
configure: WARNING: endian.h: see the Autoconf documentation
configure: WARNING: endian.h:     section "Present But Cannot Be Compiled"
configure: WARNING: endian.h: proceeding with the preprocessor's result
configure: WARNING: endian.h: in the future, the compiler will take
precedence
configure: WARNING:     ## ----------------------------------------- ##
configure: WARNING:     ## Report this to the package-unused lists.  ##
configure: WARNING:     ## ----------------------------------------- ##
checking for endian.h... yes
checking sys/isa_defs.h usability... no
checking sys/isa_defs.h presence... no
checking for sys/isa_defs.h... no
checking machine/endian.h usability... no
checking machine/endian.h presence... no
checking for machine/endian.h... no
checking machine/param.h usability... no
checking machine/param.h presence... no
checking for machine/param.h... no
checking sys/machine.h usability... no
checking sys/machine.h presence... no
checking for sys/machine.h... no
checking for sys/types.h... (cached) no
checking fp.h usability... no
checking fp.h presence... no
checking for fp.h... no
checking float.h usability... no
checking float.h presence... yes
configure: WARNING: float.h: present but cannot be compiled
configure: WARNING: float.h:     check for missing prerequisite headers?
configure: WARNING: float.h: see the Autoconf documentation
configure: WARNING: float.h:     section "Present But Cannot Be Compiled"
configure: WARNING: float.h: proceeding with the preprocessor's result
configure: WARNING: float.h: in the future, the compiler will take
precedence
configure: WARNING:     ## ----------------------------------------- ##
configure: WARNING:     ## Report this to the package-unused lists.  ##
configure: WARNING:     ## ----------------------------------------- ##
checking for float.h... yes
checking for endian.h... (cached) yes
checking for inttypes.h... (cached) no
checking locale.h usability... no
checking locale.h presence... yes
configure: WARNING: locale.h: present but cannot be compiled
configure: WARNING: locale.h:     check for missing prerequisite headers?
configure: WARNING: locale.h: see the Autoconf documentation
configure: WARNING: locale.h:     section "Present But Cannot Be Compiled"
configure: WARNING: locale.h: proceeding with the preprocessor's result
configure: WARNING: locale.h: in the future, the compiler will take
precedence
configure: WARNING:     ## ----------------------------------------- ##
configure: WARNING:     ## Report this to the package-unused lists.  ##
configure: WARNING:     ## ----------------------------------------- ##
checking for locale.h... yes
checking for float.h... (cached) yes
checking for stdint.h... (cached) no
checking for g++ that supports -ffunction-sections -fdata-sections... yes
checking for ld version... 21800
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
make[1]: Leaving directory
`/home/lvcargnini/puc/instramed/toolchain/build/gcc-arm'
make: *** [all] Error 2


according your previous mail :
>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' ?

this is an old parameter to set the path to include directory, just this

>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.

take a look on my variables on beginning of message, in true I putting LFS
inside /opt/arm-linux/arm-linux-gnueabi and cross-tools inside
/opt/arm-linux (like crosstool, similar to denx too)


 >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.

I agree but my structure seems to be correct (is similar to Denx structure)


On Dec 26, 2007 7:11 PM, Ken Moffat < zarniwhoop at ntlworld.com> wrote:

> On Wed, Dec 26, 2007 at 05:19:40PM -0200, Luís Vitório Cargnini wrote:
> > well according to the book
> > http://cross-lfs.org/view/clfs-sysroot/arm/cross-tools/binutils.html:
> > this is the result after make:
> >           && mv BLD-POTFILES-t BLD-POTFILES )
> > cd .. \
> >           && CONFIG_FILES=po/Makefile.in:po/Make-in \
> >              CONFIG_HEADERS= /bin/sh ./config.status
> > config.status: creating po/Makefile.in
> > config.status: executing depfiles commands
> > config.status: executing libtool commands
> > config.status : executing default-1 commands
> > config.status: executing bfd_stdint.h commands
> > config.status: executing default commands
> > make[3]: Leaving directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218/bfd/po'
> > make[3]: Entering directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218/bfd/po'
> > make[3]: Nothing to be done for `info'.
> > make[3]: Leaving directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218/bfd/po'
> > make[3]: Entering directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218/bfd'
> > make[3]: Nothing to be done for `info-am'.
> > make[3]: Leaving directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218/bfd'
> > make[2]: *** [info-recursive] Error 1
> > make[2]: Leaving directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218/bfd'
> > make[1]: *** [all-bfd] Error 2
> > make[1]: Leaving directory
> > `/home/lvcargnini/puc/instramed/toolchain/build/binutils218'
> > make: *** [all] Error 2
> >
> >
> > how to fix this ?
> > this was  I tried the  binutils 2.17 instead of 2.18
> >
>  Please note that we often get upset with people who top-post:
> putting a reply underneath the appropriate part of the text helps
> people follow what is being written.
>
>  Also, you hadn't explained that 2.18 had failed, and you haven't
> commented on why you were using a different --prefix for what you
> posted earlier.  This means everybody has to guess, and we will
> often guess wrongly, so please help us to help you.  Any other
> variations or problems with it that you'd like to mention ?  Thanks.
>
>  But, the reason why binutils-2.18 is failing ?  Can't tell - all we
> can see from what you posted above is that a /bin/sh ./config.status
> command ran, apparently in bfd/po, and that it was trying to make the
> info pages. Perhaps it had an error that didn't result in an error
> message in your log (unlikely).  Probably, somewhere before that
> (perhaps a long way) should be the original error.  Trimming the
> output is good, perhaps leave a few lines ahead of the original
> 'Error' or 'error' to show any failing command or interesting
> messages, then snip anything afterwards, it probably isn't going to
> bring any useful information (but log the output to a file so that
> you can go back if somebody needs to ask for more details).
>
>  If you can't find anything, have a look at the config.status script
> (probably in bfd/po or else in bfd ? ) - look at what it does, if
> nothing strikes you as obviously wrong (e.g. trying to run a command
> from an unset variable) try instrumenting it in an editor, e.g. to
> echo text telling you where it is, and what it is going to do, with
> the values of any variables, and the return value in "$?" after
> running commands.  That is long-winded and tedious, but you need to
> identify where the problem is.  With luck, if you have to do this
> you'll get lucky and spot something which looks odd.
>
>  Because it is in the info area, I wonder if your host system is
> missing the info headers (texinfo-dev or a similarly-named package),
> or perhaps has a too-old version.  But a quick look into the
> toplevel configure script suggests it will use the 'missing' program
> in the toplevel if makeinfo is older than 4.4.  That is supposed to
> touch the output file so that an empty file exists it none was
> present.
>
>  I think there used to be a bug where something got confused by
> versions of makeinfo with a double-digit second level ( 4.10, 4.11).
> I never saw that, so I don't know what the symptoms are, but maybe
> the original error message will point to that sort of thing.  If so,
> I would be tempted to try the binutils branch update patch we are
> using in trunk:
>
> http://trac.cross-lfs.org/browser/trunk/patches/binutils-2.18-branch_update-3.patch
>
>  If that allows 2.18 to build, I think a better solution (unless
> the patch arrives in the -sysroot book in the meantime) would be to
> identify where in the configure script(s) the error happened, then
> compare that test to the new version and produce a patch for just that
> part of the file (the sed which checks the version) and use that in
> your build.  I say that because the branch_update patches are on the
> bleeding edge, and for a project with few visible users (-sysroot) you
> could end up with other problems on a little-used architecture.  Of
> course, if you are happy to debug any resulting problems, testing
> the branch update is better for the long-term health of the project.
>
>  If you are able to pin this down to a too-new version of makeinfo
> on the host, please raise a ticket against binutils in clfs-sysroot
> (unless that gets updated first).
>
>  And if I was totally wide of the mark and the problem is something
> else entirely, please disregard the previous 4 paragrahs ;-)
>
> ĸen
> --
> das eine Mal als Tragödie, das andere Mal als Farce
> _______________________________________________
> Clfs-dev mailing list
> Clfs-dev at lists.cross-lfs.org
> http://lists.cross-lfs.org/listinfo.cgi/clfs-dev-cross-lfs.org
>



-- 
------------------------------------------------------------------------------
Thanks && Regards
M.Sc. B.Sc. Luís Vitório Cargnini
IEEE Member
Electrical Engineer Faculty @ PUCRS
Ipiranga Avenue, 6681 – Building 30
P.O. Box: 90619-900 – Porto Alegre/RS
Phone: +55 51 3320 3500  extension: 7696
---------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.clfs.org/pipermail/clfs-dev-clfs.org/attachments/20071227/d837ac36/attachment-0001.htm>


More information about the Clfs-dev mailing list