Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/build: freebsd/386 builder is not testing 32-bit tool chain or cgo #13873

4a6f656c opened this issue Jan 8, 2016 · 2 comments

x/build: freebsd/386 builder is not testing 32-bit tool chain or cgo #13873

4a6f656c opened this issue Jan 8, 2016 · 2 comments


Copy link

4a6f656c commented Jan 8, 2016

The freebsd/386 builder is not testing cgo, since it is run on a freebsd amd64 host with GOHOST=386 and without GOHOSTARCH=386. This is generating a 64-bit tool chain with a 32-bit runtime, which has cgo disabled:

$ uname -a
FreeBSD fbsdamd64 10.1-RELEASE FreeBSD 10.1-RELEASE #0 r274401: Tue Nov 11 21:02:49 UTC 2014  amd64
$ file $(which go)
/home/joel/src/go/bin/go: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped
$ GOARCH=386 go version
go version devel +acc7161 Fri Jan 8 00:56:28 2016 +0000 freebsd/amd64
$ GOARCH=386 go env | grep CGO
$ cat test.go
package main

import (

func main() {
        fmt.Println(runtime.GOOS, runtime.GOARCH)
$ GOARCH=386 go build test.go
$ file test
test: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), statically linked, not stripped
$ ./test
freebsd 386

The builder should be running with GOHOSTARCH=386 so that it generates a 32-bit tool chain with cgo enabled. However, the misc/cgo/testso currently fails with this configuration.

@4a6f656c 4a6f656c self-assigned this Jan 8, 2016
Copy link

CL mentions this issue.

4a6f656c pushed a commit that referenced this issue Jan 8, 2016
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-by: Ian Lance Taylor <>
Run-TryBot: Brad Fitzpatrick <>
Reviewed-by: Brad Fitzpatrick <>
TryBot-Result: Gobot Gobot <>
Copy link

bradfitz commented Jan 8, 2016

All submitted and deployed.

@bradfitz bradfitz closed this as completed Jan 8, 2016
@golang golang locked and limited conversation to collaborators Jan 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants