在项目中使用arm-none-eabi-gcc交叉编译链编译程序时报错: checking host system type... arm-none-eabi checking for a BSD-compatible install... /usr/bin/install -c checking for arm-none-eabi-gcc... /opt/Ambalink/gcc-arm-none-eabi-4_9-2015q3-amba-20160323/bin/arm-none-eabi-gcc checking whether the C compiler works... no configure: error: C compiler cannot create executables See `config.log' for more details123456 通过查看config.log,显示以下错误: configure:4447: checking whether the C compiler works configure:4469: /opt/Ambalink/gcc-arm-none-eabi-4_9-2015q3-amba-20160323/bin/arm-none-eabi-gcc -fPIC conftest.c >&5 /opt/Ambalink/gcc-arm-none-eabi-4_9-2015q3-amba-20160323/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/lib/libc.a(lib_a-ex it.o): In function `exit': exit.c:(.text.exit+0x2c): undefined reference to `_exit' collect2: error: ld returned 1 exit status configure:4473: $? = 1 configure:4511: result: no configure: failed program was:12345678 资料显示: 根据查到的以上资料,在CFLAGS选项中添加–specs=nosys.specs参数即可解决以上问题。 注意:使用arm-none-eabi-gcc交叉编译链只能编译ARM 架构的裸机系统(包括 ARM Linux 的 boot、kernel,不适用编译 Linux 应用 Application) |
|