Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
3e80f9ce
Commit
3e80f9ce
authored
Nov 07, 2012
by
Shenghou Ma
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd/go: invoke gcc -print-libgcc-file-name only once
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/6741051
parent
882eb608
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
src/cmd/go/build.go
src/cmd/go/build.go
+10
-5
No files found.
src/cmd/go/build.go
View file @
3e80f9ce
...
...
@@ -1541,6 +1541,8 @@ func envList(key string) []string {
var
cgoRe
=
regexp
.
MustCompile
(
`[/\\:]`
)
var
cgoLibGccFile
string
func
(
b
*
builder
)
cgo
(
p
*
Package
,
cgoExe
,
obj
string
,
gccfiles
[]
string
)
(
outGo
,
outObj
[]
string
,
err
error
)
{
if
goos
!=
toolGOOS
{
return
nil
,
nil
,
errors
.
New
(
"cannot use cgo when compiling for a different operating system"
)
...
...
@@ -1630,16 +1632,19 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
bareLDFLAGS
=
append
(
bareLDFLAGS
,
f
)
}
}
libgcc
,
err
:=
b
.
libgcc
(
p
)
if
err
!=
nil
{
return
nil
,
nil
,
err
if
cgoLibGccFile
==
""
{
var
err
error
cgoLibGccFile
,
err
=
b
.
libgcc
(
p
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
}
var
staticLibs
[]
string
if
goos
==
"windows"
{
// libmingw32 and libmingwex might also use libgcc, so libgcc must come last
staticLibs
=
[]
string
{
"-lmingwex"
,
"-lmingw32"
,
libgcc
}
staticLibs
=
[]
string
{
"-lmingwex"
,
"-lmingw32"
,
cgoLibGccFile
}
}
else
{
staticLibs
=
[]
string
{
libgcc
}
staticLibs
=
[]
string
{
cgoLibGccFile
}
}
for
_
,
cfile
:=
range
cfiles
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment