Commit beb1741a authored by Joel Sing's avatar Joel Sing Committed by Brad Fitzpatrick

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/18420Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 29eea94a
......@@ -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()
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment