Replacing ld with gold - any experience?(用黄金替换 ld - 有经验吗?)
问题描述
有没有人尝试使用 gold 代替ld?
gold 承诺比ld,因此它可能有助于加快大型 C++ 应用程序的测试周期,但它可以用作 ld 的直接替代品吗?
gold promises to be much faster than ld, so it may help speeding up test cycles for large C++ applications, but can it be used as drop-in replacement for ld?
gcc/g++可以直接调用gold吗?
是否有任何已知的错误或问题?
Are there any know bugs or problems?
虽然 gold 是 GNU binutils 的一部分,但我在 Web 上几乎找不到成功故事"甚至Howtos".
Although gold is part of the GNU binutils since a while, I have found almost no "success stories" or even "Howtos" in the Web.
(更新:添加了指向黄金的链接和解释它的博客条目)
推荐答案
目前它正在 Ubuntu 10.04 上编译更大的项目.在这里,您可以轻松地安装它并将其与 binutils-gold 包集成(如果删除该包,您将获得旧的 ld).然后gcc会自动使用gold.
At the moment it is compiling bigger projects on Ubuntu 10.04. Here you can install and integrate it easily with the binutils-gold package (if you remove that package, you get your old ld). Gcc will automatically use gold then.
一些经验:
- gold 不在
/usr/local/lib 中搜索 - gold 不假定 pthread 或 rt 之类的库,必须手动添加它们
- 它更快并且需要更少的内存(后者对于具有大量提升等的大型 C++ 项目很重要)
什么不起作用:它不能编译内核的东西,因此没有内核模块.如果 Ubuntu 更新了 fglrx 等专有驱动程序,它会通过 DKMS 自动执行此操作.这会因 ld-gold 而失败(您必须移除黄金,重新启动 DKMS,重新安装 ld-gold.
What does not work: It cannot compile kernel stuff and therefore no kernel modules. Ubuntu does this automatically via DKMS if it updates proprietary drivers like fglrx. This fails with ld-gold (you have to remove gold, restart DKMS, reinstall ld-gold.
这篇关于用黄金替换 ld - 有经验吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:用黄金替换 ld - 有经验吗?
基础教程推荐
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何检查GTK+3.0中的小部件类型? 2022-11-30
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- 常量变量在标题中不起作用 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 我有静态或动态 boost 库吗? 2021-01-01
