Switch back to llvm-ar (with crsD flags only).
This properly sets -format=gnu for all non-Darwin targets, because
llvm-ar is cross-platform (but defaults to the host environment).
Bug: http://b/71618641
Test: m checkbuild
Change-Id: Ic5bce7e237ea0cadfa1f96ea151d41115d8c56b8
diff --git a/cc/builder.go b/cc/builder.go
index de85d6e..db4cb4f 100644
--- a/cc/builder.go
+++ b/cc/builder.go
@@ -508,8 +508,11 @@
return
}
- arCmd := gccCmd(flags.toolchain, "ar")
- arFlags := "crsPD"
+ arCmd := "${config.ClangBin}/llvm-ar"
+ arFlags := "crsD"
+ if !ctx.Darwin() {
+ arFlags += " -format=gnu"
+ }
if flags.arFlags != "" {
arFlags += " " + flags.arFlags
}