Hi everyone, I'm trying to build a gcc 4.9.3 cross-toolchain for x86_64-*-linux-gnu target and get weird errors during configuration of libstdc++-v3. Assuming that I have my sysroot under $(MY_SYSROOT) I have cross binutils installed there and glibc-2.13 installed under $(MY_SYSROOT)/lib and $(MY_SYSROOT)/lib64 for 32- and 64-bit versions respectively. For some reason ld won't search for libc under $(MY_SYSROOT)/lib64: > configure:3898: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include -o conftest -g -O2 -pipe conftest.c >&5 > $(MY_SYSROOT)/bin/ld: skipping incompatible $(MY_SYSROOT)/lib/libc.so when searching for -lc > $(MY_SYSROOT)/bin/ld: skipping incompatible $(MY_SYSROOT)/lib/libc.a when searching for -lc > $(MY_SYSROOT)/bin/ld: cannot find -lc > collect2: error: ld returned 1 exit status > configure:3901: $? = 1 The part of config.log for libstdc++-v3 up to this place is attached. What could be the issue and how can I fix this? Best regards, Dmitry Perov. -- C уважением, Дмитрий Перов.
This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by package-unused configure version-unused, which was generated by GNU Autoconf 2.64. Invocation command line was $ /home/dima/projects/linux-x86_64/build/toolchain/gcc/src/libstdc++-v3/configure --cache-file=./config.cache --with-cross-host=x86_64-unknown-linux-gnu --prefix=/home/dima/projects/linux-x86_64/install/toolchain --enable-build-with-cxx --enable-plugins --enable-gold --enable-lto --enable-threads=posix --enable-c99 --enable-long-long --enable-multilib --enable-multiarch --disable-nls --disable-libssp --disable-shared --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libstdcxx-pch --with-glibc-version=2.13 --with-headers=yes --with-gnu-as --with-gnu-ld --with-sysroot=$(MY_SYSROOT) --with-native-system-header-dir=/include --with-pkgversion=vendorname --with-bugurl=support@xxxxxxxxxxxxxx --with-system-zlib --with-ppl=/home/dima/projects/linux-x86_64/build/staging/toolchain/ppl --with-isl=/home/dima/projects/linux-x86_64/build/staging/toolchain/isl --with-libelf=/home/dima/projects/linux-x86_64/build/staging/toolchain/libelf --with-host-libstdcxx=-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm --enable-languages=c,c++,lto --program-transform-name=s&^&x86_64-vendorname-linux-gnu-& --disable-option-checking --with-target-subdir=x86_64-vendorname-linux-gnu --build=x86_64-unknown-linux-gnu --host=x86_64-vendorname-linux-gnu --target=x86_64-vendorname-linux-gnu --srcdir=../../../src/libstdc++-v3 ## --------- ## ## Platform. ## ## --------- ## hostname = dmitry-perov uname -m = x86_64 uname -r = 3.10.0-327.36.3.el7.x86_64 uname -s = Linux uname -v = #1 SMP Mon Oct 24 16:09:20 UTC 2016 /usr/bin/uname -p = x86_64 /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /home/dima/projects/linux-x86_64/build/staging/toolchain/autoconf-2.64/bin PATH: /home/dima/projects/linux-x86_64/install/toolchain/bin PATH: /usr/lib64/qt-3.3/bin PATH: /home/dima/perl5/bin PATH: /usr/local/bin PATH: /usr/local/sbin PATH: /usr/bin PATH: /usr/sbin PATH: /bin PATH: /sbin PATH: /home/dima/bin ## ----------- ## ## Core tests. ## ## ----------- ## configure:2766: creating cache ./config.cache configure:2932: checking build system type configure:2946: result: x86_64-unknown-linux-gnu configure:2966: checking host system type configure:2979: result: x86_64-vendorname-linux-gnu configure:2999: checking target system type configure:3012: result: x86_64-vendorname-linux-gnu configure:3097: checking for a BSD-compatible install configure:3165: result: /usr/bin/install -c configure:3176: checking whether build environment is sane configure:3226: result: yes configure:3275: checking for x86_64-vendorname-linux-gnu-strip configure:3302: result: $(MY_SYSROOT)/bin/strip configure:3367: checking for a thread-safe mkdir -p configure:3406: result: /usr/bin/mkdir -p configure:3419: checking for gawk configure:3446: result: gawk configure:3457: checking whether make sets $(MAKE) configure:3479: result: yes configure:3566: checking for x86_64-vendorname-linux-gnu-gcc configure:3593: result: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include configure:3862: checking for C compiler version configure:3871: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include --version >&5 xgcc (vendorname) 4.9.3 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:3882: $? = 0 configure:3871: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include -v >&5 Reading specs from /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/specs COLLECT_GCC=/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc COLLECT_LTO_WRAPPER=/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/lto-wrapper Target: x86_64-vendorname-linux-gnu Configured with: ../src/configure --prefix=/home/dima/projects/linux-x86_64/install/toolchain --target=x86_64-vendorname-linux-gnu --enable-build-with-cxx --enable-languages=c,c++ --enable-plugins --enable-gold --enable-lto --enable-threads=posix --enable-c99 --enable-long-long --enable-multilib --enable-multiarch --disable-nls --disable-libssp --disable-shared --disable-decimal-float --disable-libffi --disable-libgomp --disable-libmudflap --disable-libquadmath --disable-libstdcxx-pch --with-glibc-version=2.13 --with-headers=yes --with-gnu-as --with-gnu-ld --with-sysroot=$(MY_SYSROOT) --with-native-system-header-dir=/include --with-pkgversion='vendorname' --with-bugurl=support@xxxxxxxxxxxxxx --with-system-zlib --with-mpfr=/home/dima/projects/linux-x86_64/build/staging/toolchain/mpfr --with-gmp=/home/dima/projects/linux-x86_64/build/staging/toolchain/gmp --with-mpc=/home/dima/projects/linux-x86_64/build/staging/toolchain/mpc --with-ppl=/home/dima/projects/linux-x86_64/build/staging/toolchain/ppl --with-isl=/home/dima/projects/linux-x86_64/build/staging/toolchain/isl --with-cloog=/home/dima/projects/linux-x86_64/build/staging/toolchain/cloog --with-libelf=/home/dima/projects/linux-x86_64/build/staging/toolchain/libelf --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' Thread model: posix gcc version 4.9.3 (vendorname) configure:3882: $? = 0 configure:3871: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include -V >&5 xgcc: error: unrecognized command line option '-V' xgcc: fatal error: no input files compilation terminated. configure:3882: $? = 1 configure:3871: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include -qversion >&5 xgcc: error: unrecognized command line option '-qversion' xgcc: fatal error: no input files compilation terminated. configure:3882: $? = 1 configure:3898: /home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/xgcc -B/home/dima/projects/linux-x86_64/build/toolchain/gcc/build/./gcc/ -B$(MY_SYSROOT)/bin/ -B$(MY_SYSROOT)/lib/ -isystem $(MY_SYSROOT)/include -isystem $(MY_SYSROOT)/sys-include -o conftest -g -O2 -pipe conftest.c >&5 $(MY_SYSROOT)/bin/ld: skipping incompatible $(MY_SYSROOT)/lib/libc.so when searching for -lc $(MY_SYSROOT)/bin/ld: skipping incompatible $(MY_SYSROOT)/lib/libc.a when searching for -lc $(MY_SYSROOT)/bin/ld: cannot find -lc collect2: error: ld returned 1 exit status configure:3901: $? = 1