mirror of
https://github.com/golang/go
synced 2024-11-23 19:40:08 -07:00
cmd/dist: fix cgoTestSO on FreeBSD amd64 with GOHOSTARCH=386
The cgoTestSO test currently fails when run on FreeBSD amd64 with GOHOSTARCH=386. This is due to it failing to find the shared object. On FreeBSD 64-bit architectures, the linker for 32-bit objects looks for a separate environment variable. Export both LD_LIBRARY_PATH and LD_32_LIBRARY_PATH on FreeBSD when GOHOSTARCH=386. Update issue #13873. Change-Id: I1fb20dd04eb2007061768b2e4530886521813d42 Reviewed-on: https://go-review.googlesource.com/18420 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
29eea94abe
commit
beb1741ae3
6
src/cmd/dist/test.go
vendored
6
src/cmd/dist/test.go
vendored
@ -913,6 +913,12 @@ func (t *tester) cgoTestSO(dt *distTest, testpath string) error {
|
||||
s = "DYLD_LIBRARY_PATH"
|
||||
}
|
||||
cmd.Env = mergeEnvLists([]string{s + "=."}, os.Environ())
|
||||
|
||||
// On FreeBSD 64-bit architectures, the 32-bit linker looks for
|
||||
// different environment variables.
|
||||
if t.goos == "freebsd" && t.gohostarch == "386" {
|
||||
cmd.Env = mergeEnvLists([]string{"LD_32_LIBRARY_PATH=."}, cmd.Env)
|
||||
}
|
||||
}
|
||||
return cmd.Run()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user