aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2015-02-14 01:45:57 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2015-02-14 01:45:57 +0000
commit46f4b48e629acfc37402df9b5b3a1b74bc8149ea (patch)
treed7aa067251431ceec7a4933ca662a28164f12dfa /llvm/tools/llvm-go/llvm-go.go
parentllvm-go: Add flag for specifying path to go command. (diff)
downloadllvm-project-46f4b48e629acfc37402df9b5b3a1b74bc8149ea.tar.gz
llvm-project-46f4b48e629acfc37402df9b5b3a1b74bc8149ea.tar.bz2
llvm-project-46f4b48e629acfc37402df9b5b3a1b74bc8149ea.zip
llvm-go: Set $GCCGO instead of putting a gccgo executable on $PATH.
Now that llgo ships its own go command we can rely on it having support for $GCCGO. Differential Revision: http://reviews.llvm.org/D7628 llvm-svn: 229210
Diffstat (limited to 'llvm/tools/llvm-go/llvm-go.go')
-rw-r--r--llvm/tools/llvm-go/llvm-go.go25
1 files changed, 5 insertions, 20 deletions
diff --git a/llvm/tools/llvm-go/llvm-go.go b/llvm/tools/llvm-go/llvm-go.go
index 55f20315dedf..c5c3fd244cad 100644
--- a/llvm/tools/llvm-go/llvm-go.go
+++ b/llvm/tools/llvm-go/llvm-go.go
@@ -162,26 +162,6 @@ func runGoWithLLVMEnv(args []string, cc, cxx, gocmd, llgo, cppflags, cxxflags, l
newpath := os.Getenv("PATH")
- if llgo != "" {
- bindir := filepath.Join(tmpgopath, "bin")
-
- err = os.MkdirAll(bindir, os.ModePerm)
- if err != nil {
- panic(err.Error())
- }
-
- err = os.Symlink(llgo, filepath.Join(bindir, "gccgo"))
- if err != nil {
- panic(err.Error())
- }
-
- newpathlist := []string{bindir}
- newpathlist = append(newpathlist, filepath.SplitList(newpath)...)
- newpath = strings.Join(newpathlist, string(filepath.ListSeparator))
-
- args = append([]string{args[0], "-compiler", "gccgo"}, args[1:]...)
- }
-
newgopathlist := []string{tmpgopath}
newgopathlist = append(newgopathlist, filepath.SplitList(os.Getenv("GOPATH"))...)
newgopath := strings.Join(newgopathlist, string(filepath.ListSeparator))
@@ -197,12 +177,17 @@ func runGoWithLLVMEnv(args []string, cc, cxx, gocmd, llgo, cppflags, cxxflags, l
"GOPATH=" + newgopath,
"PATH=" + newpath,
}
+ if llgo != "" {
+ newenv = append(newenv, "GCCGO=" + llgo)
+ }
+
for _, v := range os.Environ() {
if !strings.HasPrefix(v, "CC=") &&
!strings.HasPrefix(v, "CXX=") &&
!strings.HasPrefix(v, "CGO_CPPFLAGS=") &&
!strings.HasPrefix(v, "CGO_CXXFLAGS=") &&
!strings.HasPrefix(v, "CGO_LDFLAGS=") &&
+ !strings.HasPrefix(v, "GCCGO=") &&
!strings.HasPrefix(v, "GOPATH=") &&
!strings.HasPrefix(v, "PATH=") {
newenv = append(newenv, v)