mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-23 14:30:50 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229210 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e887b2e8f3
commit
0f7084338a
@ -162,26 +162,6 @@ func runGoWithLLVMEnv(args []string, cc, cxx, gocmd, llgo, cppflags, cxxflags, l
|
|||||||
|
|
||||||
newpath := os.Getenv("PATH")
|
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 := []string{tmpgopath}
|
||||||
newgopathlist = append(newgopathlist, filepath.SplitList(os.Getenv("GOPATH"))...)
|
newgopathlist = append(newgopathlist, filepath.SplitList(os.Getenv("GOPATH"))...)
|
||||||
newgopath := strings.Join(newgopathlist, string(filepath.ListSeparator))
|
newgopath := strings.Join(newgopathlist, string(filepath.ListSeparator))
|
||||||
@ -197,12 +177,17 @@ func runGoWithLLVMEnv(args []string, cc, cxx, gocmd, llgo, cppflags, cxxflags, l
|
|||||||
"GOPATH=" + newgopath,
|
"GOPATH=" + newgopath,
|
||||||
"PATH=" + newpath,
|
"PATH=" + newpath,
|
||||||
}
|
}
|
||||||
|
if llgo != "" {
|
||||||
|
newenv = append(newenv, "GCCGO=" + llgo)
|
||||||
|
}
|
||||||
|
|
||||||
for _, v := range os.Environ() {
|
for _, v := range os.Environ() {
|
||||||
if !strings.HasPrefix(v, "CC=") &&
|
if !strings.HasPrefix(v, "CC=") &&
|
||||||
!strings.HasPrefix(v, "CXX=") &&
|
!strings.HasPrefix(v, "CXX=") &&
|
||||||
!strings.HasPrefix(v, "CGO_CPPFLAGS=") &&
|
!strings.HasPrefix(v, "CGO_CPPFLAGS=") &&
|
||||||
!strings.HasPrefix(v, "CGO_CXXFLAGS=") &&
|
!strings.HasPrefix(v, "CGO_CXXFLAGS=") &&
|
||||||
!strings.HasPrefix(v, "CGO_LDFLAGS=") &&
|
!strings.HasPrefix(v, "CGO_LDFLAGS=") &&
|
||||||
|
!strings.HasPrefix(v, "GCCGO=") &&
|
||||||
!strings.HasPrefix(v, "GOPATH=") &&
|
!strings.HasPrefix(v, "GOPATH=") &&
|
||||||
!strings.HasPrefix(v, "PATH=") {
|
!strings.HasPrefix(v, "PATH=") {
|
||||||
newenv = append(newenv, v)
|
newenv = append(newenv, v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user