-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: -n and -x do not print all commands when using shared or c-shared buildmode #22565
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
Comments
This is behaving as expected, though perhaps there is some way we can change the behavior. The go tool is printing all the commands that it is executing. The command you are looking for is actually being executed by the linker. You can see it (along with other output) by running |
Actually, what I was expecting to see was the |
Ah, sorry, I misunderstood. I do see those commands myself. Are you sure the package wasn't already installed, and therefore did not need to be recompiled? Did you run |
I don't have |
I have no explanation. I can't recreate this at all. I don't know what is happening. |
Ok sorry, I'm not sure what was happening before, but in a clean environment, I do see the compile command. Thanks Ian. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.9.2 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/brice/go"
GORACE=""
GOROOT="/usr/local/go-1.9.2"
GOTOOLDIR="/usr/local/go-1.9.2/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build204618450=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
What did you do?
Create a simple go file with a non-main package, for example:
Build it with
-buildmode=shared
and-n
or-x
to see the build commands.What did you expect to see?
All of the build commands used to build the shared library.
What did you see instead?
Only the link command:
The text was updated successfully, but these errors were encountered: