构建 libc (newlib) 结果 "cannot find -lc"

Building libc (newlib) results in "cannot find -lc"

我为 sh3eb-elf 目标构建了一个交叉编译器。现在我需要一个 libc 实现。但是,当我想要构建 newlib 时,configure 失败了。

运行 配置:

../newlib-cygwin/configure --host=sh3eb-elf

失败了。快速浏览 config.log:

configure:4435: sh3eb-elf-gcc    conftest.c  >&5
[...]/sh3eb-elf/sh3eb-elf/lib/gcc/sh3eb-elf/8.1.0/../../../../sh3eb-elf/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
configure:4439: $? = 1

显然链接器没有找到 libc 这正是我首先要在这里构建的。我一头雾水。。。难道configure的参数不对吗?

我不确定为什么,但正如 Chrono Kitsune 指出的那样,使用 --target=sh3eb-elf 就可以了。