Use llvm-{strip,objcopy} by default
... except for Darwin Mach-O, as it is not supported by llvm-strip.
Test: m checkbuild
Bug: 119221035
Change-Id: I021637b6dd3530bff1f563f2ec7c2168e1083b7e
diff --git a/cc/binary.go b/cc/binary.go
index a8eb641..4794815 100644
--- a/cc/binary.go
+++ b/cc/binary.go
@@ -317,9 +317,9 @@
builderFlags := flagsToBuilderFlags(flags)
if binary.stripper.needsStrip(ctx) {
- // b/80093681, GNU strip/objcopy bug.
- // Use llvm-{strip,objcopy} when clang lld is used.
- builderFlags.stripUseLlvmStrip = binary.baseLinker.useClangLld(ctx)
+ if ctx.Darwin() {
+ builderFlags.stripUseGnuStrip = true
+ }
strippedOutputFile := outputFile
outputFile = android.PathForModuleOut(ctx, "unstripped", fileName)
binary.stripper.strip(ctx, outputFile, strippedOutputFile, builderFlags)