Skip to content

Commit 7aadfaf

Browse files
authored
Switch Android from gold to lld (#162)
1 parent 35959f6 commit 7aadfaf

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

build/config/compiler/BUILD.gn

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -416,25 +416,21 @@ config("compiler") {
416416
# to say that it does. Define them here instead.
417417
defines += [ "HAVE_SYS_UIO_H" ]
418418

419-
# Use gold for Android for most CPU architectures.
420-
if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm" ||
421-
current_cpu == "arm64") {
422-
ldflags += [ "-fuse-ld=gold" ]
423-
if (is_clang) {
424-
# Let clang find the ld.gold in the NDK.
425-
ldflags += [ "--gcc-toolchain=" +
426-
rebase_path(android_toolchain_root, root_build_dir) ]
427-
}
419+
if (is_clang) {
420+
# Let clang find libgcc.
421+
ldflags += [ "--gcc-toolchain=" +
422+
rebase_path(android_toolchain_root, root_build_dir) ]
428423
}
429424

430425
ldflags += [
431426
"-Wl,--no-undefined",
432427
"-Wl,--exclude-libs,ALL",
428+
"-fuse-ld=lld",
433429
]
434430
if (current_cpu == "arm") {
435431
ldflags += [
436432
# Enable identical code folding to reduce size.
437-
"-Wl,--icf=safe",
433+
"-Wl,--icf=all",
438434
]
439435
}
440436

0 commit comments

Comments
 (0)