if err != nil {
return nil, nil, err
}
- staticLibs := []string{libgcc}
+ var staticLibs []string
if goos == "windows" {
- staticLibs = append(staticLibs, "-lmingwex", "-lmingw32")
+ // libmingw32 and libmingwex might also use libgcc, so libgcc must come last
+ staticLibs = []string{"-lmingwex", "-lmingw32", libgcc}
+ } else {
+ staticLibs = []string{libgcc}
}
for _, cfile := range cfiles {
PESECTHEADR = rnd(PEFILEHEADR, PESECTALIGN);
nextsectoff = PESECTHEADR;
nextfileoff = PEFILEHEADR;
+
+ // some mingw libs depend on this symbol, for example, FindPESectionByName
+ xdefine("__image_base__", SDATA, PEBASE);
}
static void
:: cgo tests
if x%CGO_ENABLED% == x0 goto nocgo
-:: TODO(brainman) disabled, because it is broken on go builder - http://golang.org/issue/4063
-::echo # ..\misc\cgo\life
-::go run %GOROOT%\test\run.go - ..\misc\cgo\life
-::if errorlevel 1 goto fail
-::echo.
+echo # ..\misc\cgo\life
+go run %GOROOT%\test\run.go - ..\misc\cgo\life
+if errorlevel 1 goto fail
+echo.
echo # ..\misc\cgo\stdio
go run %GOROOT%\test\run.go - ..\misc\cgo\stdio