交叉编译时 gcc 支持库失败

发布于 2024-08-27 07:55:10 字数 675 浏览 4 评论 0原文

我正在尝试交叉编译 gcc 4.4.3,它是跨库的。我已经设置了交叉编译所需的所有环境变量(AS、CC、CXX、AR、RANLIB、STRIP),并对许多其他内容使用了相同的设置,所有这些都运行良好。

现在 gcc 本身编译也没有问题,但支持库确实让我困惑。当使用 make all 时,除了编译良好的 libgcc 之外,请给我:
配置:错误:C 编译器无法创建可执行文件

config.log 中全部失败的点是:
configure:2569: 检查 C 编译器默认输出文件名
配置:2572:i686-pc-gnu-gcc -g -march=i686 -O2 -pipe -mtune=generic conftest.c >&5
/home/lnz/abs-hurd/cross/cross/libexec/gcc/i686-pc-gnu/4.4.3/cc1:加载共享库时出错:libc.so.0.3:无法打开共享对象文件:没有这样的文件或目录

这里的问题似乎是 cc1 正在尝试加载用于目标的 libc。 ldd 确认此 cc1 不会尝试加载 libc.so.0.3(链接到 libc.so.6)。 lib 目录中也没有缺少 libc.so.0.3。 当尝试从命令行配置使用完全相同的命令时,一切正常。

对此提供帮助会很棒,我已经研究了好几天了,没有任何进展。

I'm trying to cross-compile gcc 4.4.3 and it's cross libraries. I have set all the Environment Variables needed for cross-compilation (AS, CC, CXX, AR, RANLIB, STRIP) and used the same setup for a lot of other stuff already, all of which worked fine.

Now gcc itself also compiles without a problem but the support libraries are really puzzling me. When using make all of them, except for libgcc which compiles fine, give me:
configure: error: C compiler cannot create executables

The point in config.log where they all fail is:
configure:2569: checking for C compiler default output file name
configure:2572: i686-pc-gnu-gcc -g -march=i686 -O2 -pipe -mtune=generic conftest.c >&5
/home/lnz/abs-hurd/cross/cross/libexec/gcc/i686-pc-gnu/4.4.3/cc1: error while loading shared libraries: libc.so.0.3: cannot open shared object file: No such file or directory

The Problem here seems to be that cc1 is trying to load the libc used for the target. ldd confirms that this cc1 does not try to load libc.so.0.3 (linked to libc.so.6). libc.so.0.3 is not missing from the lib dir either.
When trying the exact same command configure uses from command line everything works fine.

Help with this would be great, I've been looking at this for days without any progress.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

驱逐舰岛风号 2024-09-03 07:55:10

你尝试过 strace 吗?当然,您可能想要对此进行一些过滤:-)。

Have you tried strace yet? You'll presumably want to do some filtering on that :-), of course.

关于从前 2024-09-03 07:55:10

当然,在我搜索了 4 天之后,我在 google 中找到了它,在发布到这里后 30 分钟 -.-

我要做的就是将 RPATH_ENVVAR 设置为我的 LD_LIBRARY_PATH,因为显然 configure 在交叉编译时使用目标库目录。

Of course after I search for 4 days I find it in google 30mins after posting here -.-

What I had to do was set RPATH_ENVVAR to my LD_LIBRARY_PATH because apparently configure uses the target library dir when cross-compiling.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文