Eglibc 在尝试交叉编译时无法编译目标文件的后缀

Eglibc 在尝试交叉编译时无法编译目标文件的后缀

我目前正在阅读 Trac 的 CLFS 书。尝试配置 32 位版本的 EGLIBC-2.15 时,使用以下选项:

BUILD_CC="gcc" CC="${CLFS_TARGET}-gcc ${BUILD32}" \
AR="${CLFS_TARGET}-ar" RANLIB="${CLFS_TARGET}-ranlib" \
CFLAGS="-march=$(cut -d- -f1 <<< $CLFS_TARGET32) -mtune=generic -g -O2" \
../eglibc-2.15/configure --prefix=/tools \
--host=${CLFS_TARGET32} --build=${CLFS_HOST} \
--disable-profile --enable-add-ons \
--with-tls --enable-kernel=2.6.0 --with-__thread \
--with-binutils=/cross-tools/bin --with-headers=/tools/include \
--cache-file=config.cache

我得到以下输出:

configure: loading cache config.cache
checking build system type... x86_64-cross-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-gcc... x86_64-unknown-linux-gnu-gcc -m32
checking for suffix of object files... configure: error: in `/mnt/lfs/sources/eglibc-build':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

config.log 内容如下:

configure:1879: loading cache config.cache
configure:2029: checking build system type
configure:2047: result: x86_64-cross-linux-gnuconfigure: loading cache config.cache
checking build system type... x86_64-cross-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for i686-pc-linux-gnu-gcc... x86_64-unknown-linux-gnu-gcc -m32
checking for suffix of object files... configure: error: in `/mnt/lfs/sources/eglibc-build':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
configure:2069: checking host system type
configure:2084: result: i686-pc-linux-gnu
configure:2115: checking for i686-pc-linux-gnu-gcc
configure:2142: result: x86_64-unknown-linux-gnu-gcc -m32
configure:2414: checking for C compiler version
configure:2422: x86_64-unknown-linux-gnu-gcc -m32 --version >&5
../eglibc-2.15/configure: line 2424: x86_64-unknown-linux-gnu-gcc: command not found
configure:2426: $? = 127
configure:2433: x86_64-unknown-linux-gnu-gcc -m32 -v >&5
../eglibc-2.15/configure: line 2435: x86_64-unknown-linux-gnu-gcc: command not found
configure:2437: $? = 127
configure:2444: x86_64-unknown-linux-gnu-gcc -m32 -V >&5
../eglibc-2.15/configure: line 2446: x86_64-unknown-linux-gnu-gcc: command not found
configure:2448: $? = 127
configure:2452: checking for suffix of object files
configure:2478: x86_64-unknown-linux-gnu-gcc -m32 -c -march=i686 -mtune=generic -g -O2  conftest.c >&5
../eglibc-2.15/configure: line 2480: x86_64-unknown-linux-gnu-gcc: command not found
configure:2482: $? = 127
configure: failed program was:
| /* confdefs.h.  */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "http://sourceware.org/bugzilla/"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2496: error: in `/mnt/lfs/sources/eglibc-build':
configure:2499: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.

尝试将 CC 参数设置为“gcc $BUILD32”进行编译会让我走得更远,尽管它确实抱怨丢失了三元组。然而,这样做给了我:

checking for __builtin_expect... no
configure: error: support for __builtin_expect needed

我现在迷失了,所以任何建议将不胜感激。

答案1

需要手动输入arm7..-gcc的路径;它不认识${CLFS_TARGET}-gcc。相反,使用:

CC="/mnt/clfs/cross-tools/bin/armv7l-unknown-linux-gnueabihf-gcc" 

相关内容