Skip to content

Commit d92dcbb

Browse files
committed
Fix clang + bfd linker build
To speed up linking 134-based introduced passing -S (no symbol table/index) for thin archives. The bfd linker cannot handle that and needs -s, but the check for that was wrong because it did not cover the case where clang is the compiler but bfd ld is the linker. Fix the check by passing -s whenever the linker is not mold/gold/lld. This should only affect linking with bfd ld. Fixes "/usr/bin/ld: host/obj/third_party/brotli/libcommon.a: error adding symbols: archive has no index; run ranlib to add one" Fixes: QTBUG-141153 Change-Id: I2dadcc48a081025e55774d8e5560fc087abd439b Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/684653 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
1 parent 84e4fb2 commit d92dcbb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chromium/build/config/compiler/BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2531,7 +2531,7 @@ config("export_dynamic") {
25312531
# 2. Remove the thin_archive config, so that the .a file actually contains all
25322532
# .o files, instead of just references to .o files in the build directoy
25332533
config("thin_archive") {
2534-
if ((is_apple && use_lld) || (is_linux && !is_clang)) {
2534+
if ((is_apple && use_lld) || (is_linux && (!use_lld && !use_gold && !use_mold))) {
25352535
# The macOS and iOS linker ld64.ldd doesn't support thin archive without
25362536
# symbol table, gcc on linux also throws the error `archive has no index`.
25372537
arflags = [

0 commit comments

Comments
 (0)