[uClibc]Re: buildroot: building the dev environment to run on the target

David Wuertele dave-gnus at bfnet.com
Tue Mar 4 17:11:06 UTC 2003


Me> This all appears to work fine for me up until the gcc-target/Makefile
Me> tries to run 'mipsel-linux-gcc -dumpspecs > tmp-specs'.  There is no
Me> mipsel-linux-gcc, and even if there were, it isn't what I would
Me> expect.  I would have expected it to want to run mipsel-uclibc-gcc at
Me> this point.  Why is it running mipsel-linux-gcc?

Erik> Welcome to the world of buggy configure scripts....  I must have
Erik> built the toolchains about 500 times trying to come up with a
Erik> combination that actually works.  Do the uclibc_toolchain.mk not
Erik> build for you as-is?  I know they work as-is when cross
Erik> compiling for arm, though I havn't tried with mipsel recently.

Actually, the toolchain compiles fine.  I don't need to make any
changes to the toolchain makefiles.  However, for every makefile
*except* for the toolchain I added --build= and --host=.  This makes
everything configure properly except for gcc-target.

When the gcc-target directory gets built, there is a Makefile inside
with the following lines:

# If GCC_FOR_TARGET is not overriden on the command line, then this
# variable is passed down to the gcc Makefile, where it is used to
# build libgcc2.a.  We define it here so that it can itself be
# overridden on the command line.
GCC_FOR_TARGET = mipsel-linux-gcc
AS_FOR_TARGET = mipsel-linux-as
etc....

These variables are not getting overridden, and I'm not sure what to
change to get them to be overridden.  I think that those variables are
dereferenced to get the "second stage compile" where the just-compiled
gcc is used to compile itself.  Of course, that's not going to happen
because the build architecture is different from the host
architecture.  During the gcc-target "./configure" run, I see the
following:

checking for gcc... mipsel-linux-gcc 

But the strange thing is that both gcc *and* mipsel-uclibc-gcc get used:

...
gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/libiberty/../include  -W -Wall -Wtraditional -pedantic /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/libiberty/regex.c
...
/opt/buildroot/buildroot/build/staging_dir/bin/mipsel-uclibc-gcc -c -DHAVE_CONFIG_H -g -O2 -I. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/libiberty/../include  -W -Wall -Wtraditional -pedantic /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/libiberty/regex.c
...

"gcc" itself looks like it only gets used a few times, then
mipsel-uclibc-gcc gets used for the majority of the compile.  Then,
things break when it tries to use mipsel-linux-gcc:

(SHLIB_LINK='mipsel-linux-gcc -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs -Wl,--soname=@shlib_so_name at .so.0.9.9 -Wl,--version-script=@shlib_map_file@ -o @shlib_dir@@shlib_so_name at .so.0.9.9 @multilib_flags@ @shlib_objs@ -lc && rm -f @shlib_base_name at .so && ln -s @shlib_dir@@shlib_so_name at .so.0.9.9 @shlib_base_name at .so' \
SHLIB_MULTILIB=''; \
/opt/buildroot/buildroot/build/staging_dir/bin/mipsel-uclibc-gcc -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/config -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/../include \
  -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/usr/lib/gcc-lib/\" -DDEFAULT_TARGET_VERSION=\"3.2.2\" -DDEFAULT_TARGET_MACHINE=\"mipsel-linux\" -DSTANDARD_BINDIR_PREFIX=\"/usr/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" `test "X${SHLIB_LINK}" = "X" || test "no" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` `test "X${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` \
  -c /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c -o gcc.o)
In file included from /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:154:
configargs.h:2: warning: string length `636' is greater than the length `509' ISO C89 compilers are required to support
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:651: warning: string length `1083' is greater than the length `509' ISO C89 compilers are required to support
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:681: warning: string length `792' is greater than the length `509' ISO C89 compilers are required to support
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:843: warning: string length `679' is greater than the length `509' ISO C89 compilers are required to support
In file included from specs.h:1,
                 from /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:873:
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/cp/lang-specs.h:38: warning: string length `914' is greater than the length `509' ISO C89 compilers are required to support
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:1428: warning: string length `992' is greater than the length `509' ISO C89 compilers are required to support
(SHLIB_LINK='mipsel-linux-gcc -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED  -shared -nodefaultlibs -Wl,--soname=@shlib_so_name at .so.0.9.9 -Wl,--version-script=@shlib_map_file@ -o @shlib_dir@@shlib_so_name at .so.0.9.9 @multilib_flags@ @shlib_objs@ -lc && rm -f @shlib_base_name at .so && ln -s @shlib_dir@@shlib_so_name at .so.0.9.9 @shlib_base_name at .so' \
SHLIB_MULTILIB=''; \
/opt/buildroot/buildroot/build/staging_dir/bin/mipsel-uclibc-gcc -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/config -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/../include \
  -DSTANDARD_STARTFILE_PREFIX=\"../../../\" -DSTANDARD_EXEC_PREFIX=\"/usr/lib/gcc-lib/\" -DDEFAULT_TARGET_VERSION=\"3.2.2\" -DDEFAULT_TARGET_MACHINE=\"mipsel-linux\" -DSTANDARD_BINDIR_PREFIX=\"/usr/bin/\" -DTOOLDIR_BASE_PREFIX=\"../../../../\" `test "X${SHLIB_LINK}" = "X" || test "no" != "yes" || echo "-DENABLE_SHARED_LIBGCC"` `test "X${SHLIB_MULTILIB}" = "X" || echo "-DNO_SHARED_LIBGCC_MULTILIB"` \
  -c /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gccspec.c -o gccspec.o)
/opt/buildroot/buildroot/build/staging_dir/bin/mipsel-uclibc-gcc -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H  -o xgcc gcc.o gccspec.o intl.o \
  prefix.o version.o    ../libiberty/libiberty.a
gcc.o: In function `set_spec':
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/gcc.c:1659: the 'strcmp' function supports only C|POSIX locales
/opt/buildroot/buildroot/build/staging_dir/bin/mipsel-uclibc-gcc -c -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H    -I. -I. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/. -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/config -I/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/../include /opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/cppmain.c -o cppmain.o
/opt/buildroot/buildroot/build/staging_dir/bin/mipsel-uclibc-gcc -DIN_GCC    -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wtraditional -pedantic -Wno-long-long  -DHAVE_CONFIG_H  -o cpp0 cppmain.o \
intl.o libcpp.a   ../libiberty/libiberty.a
libcpp.a(cpplex.o): In function `cpp_ideq':
/opt/buildroot/buildroot/toolchain_build/gcc-3.2.2/gcc/cpphash.h:444: the 'strcmp' function supports only C|POSIX locales
mipsel-linux-gcc -dumpspecs > tmp-specs
/bin/sh: mipsel-linux-gcc: command not found
make[2]: *** [specs] Error 127
make[2]: Leaving directory `/opt/buildroot/buildroot/build/gcc-target/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/opt/buildroot/buildroot/build/gcc-target'
make: *** [/opt/buildroot/buildroot/build/gcc-target/.compiled] Error 2

Dave




More information about the uClibc mailing list