llvm.org GIT mirror llvm / 0f70843
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 Peter Collingbourne 4 years ago
1 changed file(s) with 5 addition(s) and 20 deletion(s). Raw diff Collapse all Expand all
161161
162162 newpath := os.Getenv("PATH")
163163
164 if llgo != "" {
165 bindir := filepath.Join(tmpgopath, "bin")
166
167 err = os.MkdirAll(bindir, os.ModePerm)
168 if err != nil {
169 panic(err.Error())
170 }
171
172 err = os.Symlink(llgo, filepath.Join(bindir, "gccgo"))
173 if err != nil {
174 panic(err.Error())
175 }
176
177 newpathlist := []string{bindir}
178 newpathlist = append(newpathlist, filepath.SplitList(newpath)...)
179 newpath = strings.Join(newpathlist, string(filepath.ListSeparator))
180
181 args = append([]string{args[0], "-compiler", "gccgo"}, args[1:]...)
182 }
183
184164 newgopathlist := []string{tmpgopath}
185165 newgopathlist = append(newgopathlist, filepath.SplitList(os.Getenv("GOPATH"))...)
186166 newgopath := strings.Join(newgopathlist, string(filepath.ListSeparator))
196176 "GOPATH=" + newgopath,
197177 "PATH=" + newpath,
198178 }
179 if llgo != "" {
180 newenv = append(newenv, "GCCGO=" + llgo)
181 }
182
199183 for _, v := range os.Environ() {
200184 if !strings.HasPrefix(v, "CC=") &&
201185 !strings.HasPrefix(v, "CXX=") &&
202186 !strings.HasPrefix(v, "CGO_CPPFLAGS=") &&
203187 !strings.HasPrefix(v, "CGO_CXXFLAGS=") &&
204188 !strings.HasPrefix(v, "CGO_LDFLAGS=") &&
189 !strings.HasPrefix(v, "GCCGO=") &&
205190 !strings.HasPrefix(v, "GOPATH=") &&
206191 !strings.HasPrefix(v, "PATH=") {
207192 newenv = append(newenv, v)