【发布时间】:2021-01-28 13:46:41
【问题描述】:
我使用 Clang++/LLD 构建了一个非常简单的程序:
clang++ -fuse-ld=lld -o test test.cpp
我跑了 readelf 来确认 LLD 确实被用作链接器,正如 https://releases.llvm.org/11.0.0/tools/lld/docs/index.html 中提到的那样:
$ readelf --string-dump .comment test
String dump of section '.comment':
[ 0] Linker: LLD 7.0.1
[ 12] clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final)
[ 49] GCC: (Debian 8.3.0-6) 8.3.0
很好,使用的链接器确实是 LDD。但这让我想知道为什么那里仍然提到 GCC。也许是因为标准库(大概)是用 GCC 构建的?只是想知道。
【问题讨论】: