我安装了 GNU ARM 嵌入式工具链 gcc-arm-none-eabi
当我对来自 https://github.com/ChibiOS/ChibiOS-RT 的演示项目之一运行 make 时
我收到此链接器错误
main.c: In function 'Thread1':
main.c:36:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
main.c: In function 'Thread2':
main.c:53:1: warning: no return statement in function returning non-void [-Wreturn-type]
}
^
Linking build/ch.elf
main.c: In function 'main':
main.c:58:5: internal compiler error: Segmentation fault
int main(void) {
^
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/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
最佳答案
GCC 4.8 不支持同时启用 LTO
和 ggdb
。只需禁用一个或另一个即可。
尝试配置您的 Makefile:
USE_LTO = no
或
USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16
没有 -ggdb 标志
关于c - 编译 ARM 演示项目时出现链接器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24021164/