【问题标题】:Compiling libsndfile for STM32F4xx Discovery Board为 STM32F4xx 探索板编译 libsndfile
【发布时间】:2018-03-18 07:01:29
【问题描述】:

我正在尝试为 STM32F 板交叉编译 libsndfile。我找到了this SO 问题,但我在配置步骤中遇到了问题。

我已经用apt install gcc-arm-none-eabi安装了交叉编译工具。

我跑了./autogen.sh 然后export CC=arm-none-eabi-gcc./configure --host=arm-none-eabi。我还尝试了上述 SO 问题中的其他主机选项。

但配置返回:

checking for arm-none-eabi-gcc... arm-none-eabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/arun/build/libsndfile':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log 显示:

configure:4135: arm-none-eabi-gcc    conftest.c  >&5
 /usr/lib/gcc/arm-none-eabi/4.9.3/../../../arm-none-eabi/lib/libc.a(lib_a-exit.o): In function `exit':
/build/newlib-5zwpxE/newlib-2.2.0+git20150830.5a3d536/build/arm-none-eabi/newlib/libc/stdlib/../../../../../newlib/libc/stdlib/exit.c:70: 
undefined reference to `_exit'
collect2: error: ld returned 1 exit status

这导致了another SO 问题,因此我手动编辑了配置并将--specs=nosys.specs 添加到 ac_compile 和 ac_link 变量中。但我仍然看到错误。

libsndfile 的作者suggested 设置了CFLAGS 和LDFLAGS,但我不确定将它们设置为什么。

目前不确定还可以尝试什么。有人能指出我正确的方向吗?

谢谢

【问题讨论】:

    标签: gcc arm cross-compiling stm32f4discovery libsndfile


    【解决方案1】:

    通过在运行./configure --host=arm-none-eabi之前设置export LDFLAGS="specs=nosys.specs"解决了配置问题

    【讨论】:

      猜你喜欢
      • 2016-12-12
      • 2012-07-19
      • 1970-01-01
      • 1970-01-01
      • 2011-09-18
      • 2020-08-10
      • 2012-12-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多