链接时,gcc可以使用多个内核吗? [英] Can gcc use multiple cores when linking?

查看:108
本文介绍了链接时,gcc可以使用多个内核吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,在使用GCC编译大量源文件时,可以使用-j来使用所有可用的内核.但是链接器呢?是否有类似的选项可以加快链接速度,或者GCC不支持多线程?在某些较大的项目中,这可能确实需要一段时间...(...,我讨厌等待!)

So when compiling tons of source files with GCC one can use -j to use all available cores. But what about the linker? Is there a similar option to speed up linking or does GCC not support multi-threading? In some larger projects it can really take a while ... (... and I hate to wait!)

编辑:感谢您指出-j是make的选项,而不是gcc/g ++.但这不能回答我的问题!我想知道gcc是否可以在链接程序时使用多线程!

Thanks for pointing out that -j is a option for make and not gcc/g++. But this does not answer my question! I would like to know if gcc can use multi threading while linking a program!

推荐答案

尝试

Try gold, which was developed by Ian Lance Taylor et al. from Google and released as part of GNU binutils package.

来自维基百科:

编写黄金的动机是使链接程序比GNU链接程序快,特别是对于用C ++编码的大型应用程序

The motivation for writing gold was to make a linker that is faster than the GNU linker, especially for large applications coded in C++

我必须承认我还没有尝试过它,但是在 WebKitGTK项目中提到了网页.

I must admit I haven't tried it myself yet but it's mentioned on WebKitGTK project webpage.

有关更多信息,请参阅由gold的作者撰写的文章:新的ELF链接器.

For more information see an article written by the author of gold: A New ELF Linker.

更重要的是,请参阅Sander Mathijs van Veen题为并发链接的有关增量/并行/并发链接的工作. GNU Gold Linker 及其参考书目.

More importantly, see the work on incremental / parallel / concurrent linking by Sander Mathijs van Veen titled Concurrent Linking with the GNU Gold Linker and the bibliography therein.

这篇关于链接时,gcc可以使用多个内核吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆