Always use the standard OSX SDK tools
Instead of whatever happens to be in PATH.
Test: port install gcc5; attempt to build host binaries
Change-Id: If4af32596edd6fd3e459c3d574ab0ff495f236ff
diff --git a/cc/config/toolchain.go b/cc/config/toolchain.go
index 995c8c6..8fc4a21 100644
--- a/cc/config/toolchain.go
+++ b/cc/config/toolchain.go
@@ -16,6 +16,7 @@
import (
"fmt"
+ "path/filepath"
"android/soong/android"
)
@@ -47,6 +48,7 @@
GccTriple() string
// GccVersion should return a real value, not a ninja reference
GccVersion() string
+ ToolPath() string
ToolchainCflags() string
ToolchainLdflags() string
@@ -145,6 +147,10 @@
return true
}
+func (t toolchainBase) ToolPath() string {
+ return ""
+}
+
type toolchain64Bit struct {
toolchainBase
}
@@ -216,3 +222,10 @@
}
return "libclang_rt.ubsan_standalone-" + arch + "-android.so"
}
+
+func ToolPath(t Toolchain) string {
+ if p := t.ToolPath(); p != "" {
+ return p
+ }
+ return filepath.Join(t.GccRoot(), t.GccTriple(), "bin")
+}