arm-none-eabi-gcc 4.8 分段错误(ChibiOS-RT)

5

编译ChibiOS-RT项目时,使用arm-none-eabi-gcc 4.8在链接时出现以下错误:

../../../../test/rt/test.c: In function 'TestThread':
../../../../test/rt/test.c:314:7: internal compiler error: Segmentation fault: 11
 msg_t TestThread(void *p) {
   ^
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper: arm-none-eabi-gcc returned 1 exit status
/usr/gcc-arm-none-eabi-4_8-2013q4/bin/../lib/gcc/arm-none-eabi/4.8.3/../../../../arm-none-eabi/bin/ld: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [build/ch.elf] Error 1

使用arm-none-eabi-gcc 4.7不会出现这种情况。

这是操作系统构建文件之一,因此我不想干扰它 -- 而且我从未见过gcc本身在构建时遇到分段错误。此外,即使是完全没有更改的项目,也会发生这种情况,例如根ChibiOS存储库中的任何一个项目。

有关诊断此问题的任何建议吗?


1
首先,这个问题是每次使用这个编译器链接这个特定的东西都会发生吗?如果不是,那么你可能有坏的内存条。其次,请尝试清除并重新安装arm-none-eabi-gcc-4.8和任何版本的binutils。如果这两个都无法解决问题,那么你可能发现了一个真正的编译器和/或链接器错误,你应该咨询gcc-help@gcc.gnu.org以获取如何报告它的建议。 - zwol
ICE是一个bug;GCC本身就认识到有些问题。如果它在4.7中正常工作,请返回4.7,并使用它来构建4.8或4.9。这很奇怪;通常,GCC会通过构建自身及其支持库来进行充分的测试。 - Jonathan Leffler
1个回答

4
GCC 4.8不支持同时启用和。请禁用其中一个。
尝试配置您的Makefile:
USE_LTO = no

或者

USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16

没有-ggdb标志


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接