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

cmd/go: "go run" ignores environment variable CC #6845

Closed
mikioh opened this issue Nov 29, 2013 · 6 comments
Closed

cmd/go: "go run" ignores environment variable CC #6845

mikioh opened this issue Nov 29, 2013 · 6 comments
Milestone

Comments

@mikioh
Copy link
Contributor

mikioh commented Nov 29, 2013

FreeBSD 10 and beyond don't contain gcc anymore. For now cmd/ld/lib.c specifies
"gcc" as default linker and cmd/go doesn't pass "-extld" to [568]l.
As a result some tests that kick "go run" fail on FreeBSD 10 and beyond.

-- FAIL: TestCgoCrashHandler (1.94 seconds)
    crash_test.go:80: output:
        # command-line-arguments
        exec gcc: No such file or directory
        /go/pkg/tool/freebsd_amd64/6l: running gcc failed: unsuccessful exit status 0x100
        
        
        wanted:
        main: recovered done
        new-thread: recovered done
        second-new-thread: recovered done
        main-again: recovered done
--- FAIL: TestCgoSignalDeadlock (1.20 seconds)
    crash_cgo_test.go:25: expected "OK\n", but got "# command-line-arguments\nexec gcc: No such file or directory\n/go/pkg/tool/freebsd_amd64/6l: running gcc failed: unsuccessful exit status 0x100\n"
--- FAIL: TestCgoTraceback (1.21 seconds)
    crash_cgo_test.go:33: expected "OK\n", but got "# command-line-arguments\nexec gcc: No such file or directory\n/go/pkg/tool/freebsd_amd64/6l: running gcc failed: unsuccessful exit status 0x100\n"
@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 1:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 2:

Labels changed: added repo-main.

@minux
Copy link
Member

minux commented Dec 5, 2013

Comment 3:

The problem should be in cmd/go. cmd/ld shouldn't be made to use $CC,
it's the job of cmd/go to pass correct -extld flag.
@mikioh, what does "go env" say on the freebsd system?
is CC=clang?

@mikioh
Copy link
Contributor Author

mikioh commented Dec 5, 2013

Comment 4:

Yup, CC=clang. After CC=clang all.bash, go env reports:
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GORACE=""
CC="clang"
GOGCCFLAGS="-g -O2 -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments"
CXX="g++"
CGO_ENABLED="1"
Hm, funny there's no g++ file on this node.

@mikioh
Copy link
Contributor Author

mikioh commented Dec 22, 2013

Comment 5:

Labels changed: added release-go1.3, removed priority-triage, release-none.

@mikioh
Copy link
Contributor Author

mikioh commented Feb 20, 2014

Comment 6:

This issue was closed by revision 2dc759d.

Status changed to Fixed.

@rsc rsc added this to the Go1.3 milestone Apr 14, 2015
@rsc rsc removed the release-go1.3 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants