[更新 20150825:编译 genmddeps.o 时似乎存在编译器 - 汇编器不匹配;使用的编译器是g++
已安装的版本,但使用的汇编器位于配置为Ubuntu 4.9.2-10ubuntu13
的构建目录中,因此从编译器传入的选项会出错。完整的命令在本文末尾的最终代码块中。我(还)不清楚为什么有本地副本以及为什么不够聪明不使用它....]./as
riscv64-unknown-elf
--64
as
g++
也许有一些简单的东西我配置错误,但如果是这样,它就会通过多次尝试而溜走。任何帮助,将不胜感激。
我一直在尝试构建火箭芯片树,并且在构建 riscv 工具时出现问题。似乎正在发生的事情是一个非法选项被传递给 riscv 汇编程序,导致失败:
/home/kevin/Working/rocket-chip/riscv/riscv64-unknown-elf/bin/as: unrecognized option '--64'
make[3]: *** [build/genmddeps.o] Error 1
make[2]: *** [all-gcc] Error 2
make[1]: *** [all] Error 2
make: *** [stamps/build-gcc-newlib] Error 2
考虑到使用 riscv 作为二进制而不是系统 x86_64 作为二进制,Configure 似乎并不认为它是交叉编译:
Configuring in ./gcc
...
checking whether we are cross compiling... no
路径似乎设置正确:
> echo $TOP
/home/kevin/Working/rocket-chip
> echo $RISCV
/home/kevin/Working/rocket-chip/riscv
> echo $PATH
.:~/bin:~/scripts:.:~/bin:~/scripts:/home/kevin/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/kevin/Working/rocket-chip/riscv/bin
(附带说明,下载 gcc-5.2.0 后,我在构建过程中看到一些 shell 测试错误:
/bin/sh: 1: test: false: unexpected operator
不确定这是一种症状还是已知行为。)
该系统是 Ubuntu 15.04,在 Win* 机器上的 VMware 播放器下运行。我在 tcsh 中运行,但同样的事情也发生在 bash 中。通过探索 riscv 更改,似乎所需的选项是 --m64 而不是 --64 但我不确定 --64 在构建/配置文件中来自哪里,因为它没有显示在实际构建中编译器的命令。构建日志中构建指令的完整序列是:
make[3]: Entering directory '/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/build-gcc-newlib/gcc'
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h" DEFINES="" \
/bin/bash /home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/mkconfig.sh config.h
TARGET_CPU_DEFAULT="" \
HEADERS="options.h insn-constants.h config/elfos.h config/newlib-stdint.h config/riscv/riscv.h config/riscv/elf.h config/initfini-array.h defaults.h" DEFINES="LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" \
/bin/bash /home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/mkconfig.sh tm.h
TARGET_CPU_DEFAULT="" \
HEADERS="config/riscv/riscv-protos.h tm-preds.h" DEFINES="" \
/bin/bash /home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/mkconfig.sh tm_p.h
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h" DEFINES="" \
/bin/bash /home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/mkconfig.sh bconfig.h
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/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc -I/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/build -I/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/../include -I/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/../libcpp/include \
-o build/genmddeps.o /home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/src/newlib-gcc/gcc/genmddeps.c
Makefile:2428: recipe for target 'build/genmddeps.o' failed
make[3]: Leaving directory '/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/build-gcc-newlib/gcc'
Makefile:4112: recipe for target 'all-gcc' failed
make[2]: Leaving directory '/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/build-gcc-newlib'
Makefile:867: recipe for target 'all' failed
make[1]: Leaving directory '/home/kevin/Working/rocket-chip/riscv-tools/riscv-gnu-toolchain/build/build-gcc-newlib'
Makefile:214: recipe for target 'stamps/build-gcc-newlib' failed