如何构建 fat gcc46 libstdc++在 OS X 上?

发布于 2024-12-14 18:56:47 字数 1042 浏览 2 评论 0原文

我已经在我的 OS X 机器上成功构建并安装了 gcc 4.6.1,但我似乎无法让它为我创建一个胖/通用 libstdc++ 库。我怎样才能让它做到这一点?

默认的 /usr/lib/libstdc++.6.dylib 支持以下体系结构:

[host:~] nsteiner% file /usr/lib/libstdc++.6.dylib
/usr/lib/libstdc++.6.dylib: Mach-O universal binary with 3 architectures
/usr/lib/libstdc++.6.dylib (for architecture i386):     Mach-O dynamically linked shared library i386
/usr/lib/libstdc++.6.dylib (for architecture ppc7400):  Mach-O dynamically linked shared library ppc
/usr/lib/libstdc++.6.dylib (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64

我希望 gcc 为这些相同的体系结构提供 /usr/local/lib/libstdc++.6.dylib ,但我尝试 使用 --enable-multilib--with-multilib-list=i386,ppc,x86_64 配置--enable-targets=all 显然被误导了。 configuremake 都不会生成错误,但生成的只是:

[host:~] nsteiner% file /usr/local/lib/libstdc++.6.dylib
/usr/local/lib/libstdc++.6.dylib: Mach-O 64-bit dynamically linked shared library x86_64

I have successfully built and installed gcc 4.6.1 on my OS X box, but I can't seem to get it to create a fat/universal libstdc++ library for me. How do I make it do that?

The default /usr/lib/libstdc++.6.dylib supports the following architectures:

[host:~] nsteiner% file /usr/lib/libstdc++.6.dylib
/usr/lib/libstdc++.6.dylib: Mach-O universal binary with 3 architectures
/usr/lib/libstdc++.6.dylib (for architecture i386):     Mach-O dynamically linked shared library i386
/usr/lib/libstdc++.6.dylib (for architecture ppc7400):  Mach-O dynamically linked shared library ppc
/usr/lib/libstdc++.6.dylib (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64

I would like for gcc to give me a /usr/local/lib/libstdc++.6.dylib for those same architectures, but my attempts to configure with --enable-multilib or --with-multilib-list=i386,ppc,x86_64 or --enable-targets=all were clearly misguided. Neither configure nor make generate errors, but all that gets generated is this:

[host:~] nsteiner% file /usr/local/lib/libstdc++.6.dylib
/usr/local/lib/libstdc++.6.dylib: Mach-O 64-bit dynamically linked shared library x86_64

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

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

发布评论

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

评论(1

如梦亦如幻 2024-12-21 18:56:49

只有 Apple 的 GCC 4.2.1 仍然支持 fat 二进制文件。您必须采取额外的手动步骤(或提供非常好的包装脚本)来将所有源代码编译两次,并在生成的二进制文件上运行 lipo。

Only Apple's GCC 4.2.1 still supports fat binaries. You'll have to take additional manual steps (or provide damn good wrapper scripts) to compile all sources twice, and run lipo on the resulting binaries.

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