Replacing ld with gold - any experience?

后端 未结 8 820
你的背包
你的背包 2020-11-28 04:32

Has anyone tried to use gold instead of ld?

gold promises to be much faster than ld, so it may help speeding up test cycles fo

相关标签:
8条回答
  • 2020-11-28 05:20

    As a Samba developer, I have been using the gold linker almost exclusively on Ubuntu, Debian, and Fedora since several years now. My assessment:

    • gold is many times (felt: 5-10 times) faster than the classical linker.
    • Initially, there were a few problems, but the have gone since roughly Ubuntu 12.04.
    • The gold linker even found some dependency problems in our code, since it seems to be more correct than the classical one with respect to some details. See, e.g. this Samba commit.

    I have not used gold selectively, but have been using symlinks or the alternatives mechanism if the distribution provides it.

    0 讨论(0)
  • 2020-11-28 05:26

    Can gcc/g++ directly call gold.?

    Just to complement the answers: there is a gcc's option -fuse-ld=gold (see gcc doc). Though, AFAIK, it is possible to configure gcc during the build in a way that the option will not have any effect.

    0 讨论(0)
提交回复
热议问题