c - 编译 gcc-5.2.0 时出现问题

标签 c gcc raspberry-pi raspbian linux-from-scratch

我正在尝试为 Raspberry PI 2 构建自己的 lfs 系统。

作为其中的一部分,我尝试在 Raspberry PI 2 上编译 gcc,并以 raspbian 作为基本操作系统。

我可以使用 lfs 开发版本上的说明构建 binutils。但是在编译 gcc 时出现以下错误

g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc-5.2.0/gcc -I../../gcc-5.2.0/gcc/. -I../../gcc-5.2.0/gcc/../include -I../../gcc-5.2.0/gcc/../libcpp/include -I/mnt/lfs/sources/gcc-build/./gmp -I/mnt/lfs/sources/gcc-5.2.0/gmp -I/mnt/lfs/sources/gcc-build/./mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpc/src  -I../../gcc-5.2.0/gcc/../libdecnumber -I../../gcc-5.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-5.2.0/gcc/../libbacktrace   -o except.o -MT except.o -MMD -MP -MF ./.deps/except.TPo ../../gcc-5.2.0/gcc/except.c   
g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc-5.2.0/gcc -I../../gcc-5.2.0/gcc/. -I../../gcc-5.2.0/gcc/../include -I../../gcc-5.2.0/gcc/../libcpp/include -I/mnt/lfs/sources/gcc-build/./gmp -I/mnt/lfs/sources/gcc-5.2.0/gmp -I/mnt/lfs/sources/gcc-build/./mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpc/src  -I../../gcc-5.2.0/gcc/../libdecnumber -I../../gcc-5.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-5.2.0/gcc/../libbacktrace   -o explow.o -MT explow.o -MMD -MP -MF ./.deps/explow.TPo ../../gcc-5.2.0/gcc/explow.c   
g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc-5.2.0/gcc -I../../gcc-5.2.0/gcc/. -I../../gcc-5.2.0/gcc/../include -I../../gcc-5.2.0/gcc/../libcpp/include -I/mnt/lfs/sources/gcc-build/./gmp -I/mnt/lfs/sources/gcc-5.2.0/gmp -I/mnt/lfs/sources/gcc-build/./mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpc/src  -I../../gcc-5.2.0/gcc/../libdecnumber -I../../gcc-5.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-5.2.0/gcc/../libbacktrace   -o expmed.o -MT expmed.o -MMD -MP -MF ./.deps/expmed.TPo ../../gcc-5.2.0/gcc/expmed.c   
../../gcc-5.2.0/gcc/wide-int.h: In function 'long long unsigned int choose_multiplier(long long unsigned int, int, int, long long unsigned int*, int*, int*)':                                               
../../gcc-5.2.0/gcc/wide-int.h:798:57: warning: array subscript is below array bounds [-Warray-bounds]                                                                                                       
../../gcc-5.2.0/gcc/wide-int.h:798:57: warning: array subscript is below array bounds [-Warray-bounds]                                                                                                       
g++ -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I. -I../../gcc-5.2.0/gcc -I../../gcc-5.2.0/gcc/. -I../../gcc-5.2.0/gcc/../include -I../../gcc-5.2.0/gcc/../libcpp/include -I/mnt/lfs/sources/gcc-build/./gmp -I/mnt/lfs/sources/gcc-5.2.0/gmp -I/mnt/lfs/sources/gcc-build/./mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpfr/src -I/mnt/lfs/sources/gcc-5.2.0/mpc/src  -I../../gcc-5.2.0/gcc/../libdecnumber -I../../gcc-5.2.0/gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc-5.2.0/gcc/../libbacktrace   -o expr.o -MT expr.o -MMD -MP -MF ./.deps/expr.TPo ../../gcc-5.2.0/gcc/expr.c           
../../gcc-5.2.0/gcc/expr.c: In function 'void store_constructor(tree, rtx, int, long long int)':                                                                                                             
../../gcc-5.2.0/gcc/expr.c:6529:1: internal compiler error: output_operand: invalid shift operand                                                                                                            
Please submit a full bug report,                                                                                                                                                                             
with preprocessed source if appropriate.                                                                                                                                                                     
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.                                                                                                                                            
Preprocessed source stored into /tmp/ccAUc9Pu.out file, please attach this to your bugreport.                                                                                                                
Makefile:1065: recipe for target 'expr.o' failed                                                                                                                                                             
make[2]: *** [expr.o] Error 1                                                                                                                                                                                
make[2]: Leaving directory '/mnt/lfs/sources/gcc-build/gcc'                                                                                                                                                  
Makefile:4105: recipe for target 'all-gcc' failed                                                                                                                                                            
make[1]: *** [all-gcc] Error 2                                                                                                                                                                               
make[1]: Leaving directory '/mnt/lfs/sources/gcc-build'                                                                                                                                                      
Makefile:858: recipe for target 'all' failed                                                                                                                                                                 
make: *** [all] Error 2 

我尝试通过查看 expr.c 文件来追踪错误原因,但找不到问题。我已将“/tmp/ccAUc9Pu.out”上传到 http://turl.ca/dcfansr

有人可以帮助我如何调试问题的确切原因

最佳答案

通过运行版本检查 http://www.linuxfromscratch.org/lfs/view/stable-systemd/prologue/hostreqs.html 检查所有系统要求是否已安装后,我遇到了同样的问题并重新启动系统后它就可以工作了。

关于c - 编译 gcc-5.2.0 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33053730/

相关文章:

gcc - Ansible安装-clang : error: unknown argument: '-mno-fused-madd'

python - 如何在C/C++程序中加载内核模块

c - 大型头文件 c++ 中字符串常量之前的语法错误

从 system() 更改为 exec(),它会加速我的代码吗?

c - GCC C vector 扩展 : How to move contents of a vector to the left by one element?

c++ - 将字符串写入 ostream

c - 在arduino中拆分字符串以滚动液晶屏

c - 检查和修改 C 中的内存地址

linux - 使用 Android NDK 构建的 native 可执行文件与使用 gcc-arm for Raspbian(pi-tools)为 Raspberry Pi 构建的本地可执行文件有何不同

Docker-compose:/usr/local/bin/docker-compose:第1行:否:找不到命令