[PATCH] llvm-go: Set $GCCGO instead of putting a gccgo executable on $PATH.
Peter Collingbourne
peter at pcc.me.uk
Fri Feb 13 17:48:02 PST 2015
REPOSITORY
rL LLVM
http://reviews.llvm.org/D7628
Files:
llvm/trunk/tools/llvm-go/llvm-go.go
Index: llvm/trunk/tools/llvm-go/llvm-go.go
===================================================================
--- llvm/trunk/tools/llvm-go/llvm-go.go
+++ llvm/trunk/tools/llvm-go/llvm-go.go
@@ -162,26 +162,6 @@
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 @@
"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)
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7628.19955.patch
Type: text/x-patch
Size: 1498 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150214/e4817abf/attachment.bin>
More information about the llvm-commits
mailing list