From 3772da13fd9b4d1f0aec35c73883c1cb5b60fd35 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 16 May 2016 18:01:46 -0700 Subject: [PATCH] Don't use -B...gcc.. on Darwin We don't ship binutils on Darwin, so there is no point in telling clang to look in that path. (The path being used doesn't even exist). This matches the Make behavior. Change-Id: I663047057ff8df8a349483532da8018af13d50d8 --- cc/cc.go | 5 ++++- cc/makevars.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cc/cc.go b/cc/cc.go index d2f0930e4..0c47c79fe 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1091,7 +1091,10 @@ func (compiler *baseCompiler) flags(ctx ModuleContext, flags Flags) Flags { flags.LdFlags = clangFilterUnknownCflags(flags.LdFlags) target := "-target " + toolchain.ClangTriple() - gccPrefix := "-B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin") + var gccPrefix string + if !ctx.Darwin() { + gccPrefix = "-B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin") + } flags.CFlags = append(flags.CFlags, target, gccPrefix) flags.AsFlags = append(flags.AsFlags, target, gccPrefix) diff --git a/cc/makevars.go b/cc/makevars.go index 247036e0e..91ba74818 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -86,7 +86,10 @@ func makeVarsToolchain(ctx common.MakeVarsContext, secondPrefix string, if toolchain.ClangSupported() { clangPrefix := secondPrefix + "CLANG_" + typePrefix - clangExtras := "-target " + toolchain.ClangTriple() + " -B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin") + clangExtras := "-target " + toolchain.ClangTriple() + if ht != common.Darwin { + clangExtras += " -B" + filepath.Join(toolchain.GccRoot(), toolchain.GccTriple(), "bin") + } globalClangCflags := fmt.Sprintf("${commonClangGlobalCflags} ${clangExtraCflags} ${%sClangGlobalCflags}", hod)