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: support -buildmode=c-shared on freebsd/amd64 #22078

Closed
whatest000 opened this issue Sep 28, 2017 · 7 comments
Closed

cmd/go: support -buildmode=c-shared on freebsd/amd64 #22078

whatest000 opened this issue Sep 28, 2017 · 7 comments

Comments

@whatest000
Copy link

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.8.3 freebsd/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
GCCGO="gccgo"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build225258924=/tmp/go-build -gno-record-gcc-switches"
CXX="clang++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

build a .so file for my c program
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

What did you see instead?

@ianlancetaylor ianlancetaylor changed the title -buildmode=c-shared not supported on freebsd/amd64 cmd/go: support -buildmode=c-shared on freebsd/amd64 Sep 28, 2017
@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Sep 28, 2017
@ianlancetaylor
Copy link
Contributor

Would you be interested in looking into this? It may already work, it may just need to be enabled in cmd/go and cmd/link.

@whatest000
Copy link
Author

i am interested, what should i do?

@ianlancetaylor
Copy link
Contributor

@whatest000 Thanks. Edit cmd/go/internal/work/build.go and cmd/link/internal/ld/config.go to permit c-shared on the three FreeBSD targets (freebsd-386, freebsd-amd64, freebsd-arm). Edit cmd/dist/test.go (*tester).supportedBuildMode to say that c-shared is supported on those targets. Run all.bash. See what fails.

@DamjanJovanovic
Copy link

The relevant code in cmd/go/internal/work/build.go was moved. My bisection revealed it's now in src/cmd/go/internal/work/init.go as of commit 36323e4 on 6 November 2017.

@DamjanJovanovic
Copy link

--buildmode=c-shard works in the latest Git. It was fixed by:

commit 88129f0
Author: Tim Wright tenortim@gmail.com
Date: Tue Feb 13 19:00:17 2018 -0800

all: enable c-shared/c-archive support for freebsd/amd64

Fixes #14327
Much of the code is based on the linux/amd64 code that implements these
build modes, and code is shared where possible.

Change-Id: Ia510f2023768c0edbc863aebc585929ec593b332
Reviewed-on: https://go-review.googlesource.com/93875
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>

@DamjanJovanovic
Copy link

And this bug is a duplicate of #14327.

@ianlancetaylor
Copy link
Contributor

Thanks, closing.

@golang golang locked and limited conversation to collaborators Jul 13, 2019
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