【发布时间】:2020-11-12 13:07:43
【问题描述】:
我正在关注 gcc 裸机交叉编译器构建过程。下面是关于 ARM GCC 阶段 1 的说明。
5. Configure, build and install ARM GCC stage 1. This step creates a
bootstrap ARM toolchain without any of the standard C libraries. Note that
in the following commands any text within square brackets must only be used
when building the arm-none-eabi (or armeb-none-eabi) toolchain.
You do not type the square brackets themselves, only the text between them.
$ cd build-<target>/gcc_stage1
$ ../../gcc-linaro-5.3-2016.05/configure --target=<target> \
--prefix=<install_dir> \
--with-arch=armv8-a \
[--with-fpu=crypto-neon-fp-armv8] \
--disable-multilib \
--disable-werror \
--enable-languages=c \
--disable-shared \
--without-headers \
--with-newlib \
--with-gnu-as \
--with-gnu-ld
$ make all-gcc <-- error here "--64"
$ make install-gcc
$ cd ../..
关于配置,我给出了命令
../../gcc-linaro-5.3-2016.05/configure --target=arm-none-eabi --prefix=/opt/arm-toolchain --with-arch=armv8-a --with-fpu=crypto-neon-fp-armv8 --disable-multilib --disable-werror --enable-languages=c --disable-shared --without-headers --with-newlib --with-gu-as --with-gnu-ld
然后,当我运行make all-gcc 时,出现以下错误。 (为简洁起见只显示最后一部分,此日志是在第二次发出命令后,因此只显示最后一个错误部分。
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h" DEFINES="" \
/bin/bash ../../../gcc-linaro-5.3-2016.05/gcc/mkconfig.sh config.h
config.h is unchanged
TARGET_CPU_DEFAULT="TARGET_CPU_generic" \
HEADERS="options.h insn-constants.h config/dbxelf.h config/elfos.h config/arm/unknown-elf.h config/arm/elf.h config/arm/bpabi.h config/newlib-stdint.h config/arm/aout.h config/vxworks-dummy.h config/arm/arm.h config/initfini-array.h defaults.h" DEFINES="LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4" \
/bin/bash ../../../gcc-linaro-5.3-2016.05/gcc/mkconfig.sh tm.h
tm.h is unchanged
TARGET_CPU_DEFAULT="" \
HEADERS="config/arm/arm-protos.h config/arm/aarch-common-protos.h tm-preds.h" DEFINES="" \
/bin/bash ../../../gcc-linaro-5.3-2016.05/gcc/mkconfig.sh tm_p.h
tm_p.h is unchanged
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h" DEFINES="" \
/bin/bash ../../../gcc-linaro-5.3-2016.05/gcc/mkconfig.sh bconfig.h
bconfig.h is unchanged
g++ -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../../gcc-linaro-5.3-2016.05/gcc -I../../../gcc-linaro-5.3-2016.05/gcc/build -I../../../gcc-linaro-5.3-2016.05/gcc/../include -I../../../gcc-linaro-5.3-2016.05/gcc/../libcpp/include \
-o build/genmddeps.o ../../../gcc-linaro-5.3-2016.05/gcc/genmddeps.c
/opt/arm-toolchain/arm-none-eabi/bin/as: unrecognized option '--64'
Makefile:2428: recipe for target 'build/genmddeps.o' failed
make[1]: *** [build/genmddeps.o] Error 1
make[1]: Leaving directory '/home/ckim/Downloads/arm-toolchain/build-arm-none-eabi/gcc_stage1/gcc'
Makefile:4108: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2
日志显示了我在正确使用之前构建的as。我在网上搜索但找不到相同的案例。谁能给我一些想法?
【问题讨论】:
标签: gcc compilation arm