使用cygwin(windows)的i686的GCC交叉编译器 - 在构建GCC时失败

问题描述 投票:0回答:1

我试图从windows PC(cygwin)交叉编译linux - i686-elf平台的gcc。根据工具链步骤,我已成功编译:

  1. binutils使用 /binutils-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --with-sysroot --disable-nls --disable-werror
  2. 基本的gcc第一步使用 gcc-x.y.z/configure --target=$TARGET --prefix="$PREFIX" --disable-nls --enable-languages=c,c++ --without-headers
  3. linux标头使用 make headers_install ARCH=i386 CROSS_COMPILE=i386-linux- INDTALL_HDR_PATH=my/path/
  4. glibc使用 CC=${TARGET}-gcc ../glibc-2.29/configure --target=$TARGET --host=i686-pc-linux-gnu --prefix=$PREFIX --with-headers=my/path/然后,make install-headers
  5. 现在,在使用:qazxsw poi构建海湾合作委员会的第二部分时

我收到以下错误:

../gcc-7.4.0/configure --target=$TARGET --prefix=$PREFIX --with-sysroot=$HOME/opt/cross --disable-libssp --disable-libgomp --disable-libmudflap --enable-languages=c,c++ --disable-multilib

我试过make[2]: Entering directory '/home/MyPcUserName/src/build-gcc/i686-elf/libgcc - If this is the top-level multilib, build all the other multilibs. ln -s ../../../gcc-7.4.0/libgcc/enable-execute-stack-empty.c enable-execute-stack.c ln -s ../../../gcc-7.4.0/libgcc/unwind-generic.h unwind.h ln -s ../../../gcc-7.4.0/libgcc/config/no-unwind.h md-unwind-support.h ln -s ../../../gcc-7.4.0/libgcc/config/i386/sfp-machine.h sfp-machine.h ln -s ../../../gcc-7.4.0/libgcc/gthr-single.h gthr-default.h DEFINES='' HEADERS='' \ ../../../gcc-7.4.0/libgcc/mkheader.sh > tmp-libgcc_tm.h /bin/sh ../../../gcc-7.4.0/libgcc/../move-if-change tmp-libgcc_tm.h libgcc_tm.h echo timestamp > libgcc_tm.stamp /home/MyPcUserName/src/build-gcc/./gcc/xgcc -B/home/MyPcUserName/src/build-gcc/./gcc/ -B/home/MyPcUserName/opt/cross/i686-elf/bin/ -B/home/MyPcUserName/opt/cross/i686-elf/lib/ -isystem /home/MyPcUserName/opt/cross/i686-elf/include -isystem /home/MyPcUserName/opt/cross/i686-elf/sys-include -g -O2 -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -fpic -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -fpic -I. -I. -I../.././gcc -I../../../gcc-7.4.0/libgcc -I../../../gcc-7.4.0/libgcc/. -I../../../gcc-7.4.0/libgcc/../gcc -I../../../gcc-7.4.0/libgcc/../include -DHAVE_CC_TLS -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c ../../../gcc-7.4.0/libgcc/libgcc2.c -fvisibility=hidden -DHIDE_EXPORTS In file included from /home/MyPcUserName/opt/cross/usr/include/bits/libc-header-start.h:33:0, from /home/MyPcUserName/opt/cross/usr/include/stdio.h:27, from ../../../gcc-7.4.0/libgcc/../gcc/tsystem.h:87, from ../../../gcc-7.4.0/libgcc/libgcc2.c:27: /home/MyPcUserName/opt/cross/usr/include/features.h:474:10: fatal error: gnu/stubs.h: No such file or directory #include <gnu/stubs.h> ^~~~~~~~~~~~~ compilation terminated. make[2]: *** [Makefile:491: _muldi3.o] Error 1 make[2]: Leaving directory '/home/MyPcUserName/src/build-gcc/i686-elf/libgcc' make[1]: *** [Makefile:11875: all-target-libgcc] Error 2 make[1]: Leaving directory '/home/MyPcUserName/src/build-gcc' make: *** [Makefile:893: all] Error 2 来禁用mulilib,以便在64位PC上忽略这个gnu问题。我试图再次重建所有这些,但我仍然面临着这个问题。如果有人可以提供帮助,请告诉我。非常感谢你的时间

linux gcc cross-compiling i386
1个回答
0
投票

在建立--disable-multilib之后,我们不应该直接开始建设GCC的第二部分。相反,如下所示,glibc应该遵循更少的步骤:

glibc

然后,我们可以开始构建GCC的第二部分。

© www.soinside.com 2019 - 2024. All rights reserved.