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

when i use cgo on linux/mips64 to build a dy library,some error like "compile: linux/mips64le does not support -shared",but darwin/arm64 or linux/amd64 never happend. #56122

Closed
RyanCode opened this issue Oct 10, 2022 · 3 comments
Labels
FrozenDueToAge vulncheck or vulndb Issues for the x/vuln or x/vulndb repo

Comments

@RyanCode
Copy link

RyanCode commented Oct 10, 2022

what i do?

compile a go program for c.

go env

GO111MODULE=""
GOARCH="mips64le"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="mips64le"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="https://goproxy.cn"
GOROOT="/root/workspace/go-linux-mips64le-bootstrap"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/root/workspace/go-linux-mips64le-bootstrap/pkg/tool/linux_mips64le"
GOVCS=""
GOVERSION="go1.18.7"
GCCGO="gccgo"
GOMIPS64="hardfloat"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/root/ryan/proxy-protector/go.mod"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -mabi=64 -mhard-float -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build816227691=/tmp/go-build -gno-record-gcc-switches"

go version

go1.18.7 linux/mips64le

static library

[root@host proxy-protector]# go build -tags "cxterm_parser" -o libs/xterm-linux-mips64le/libxterm.so -buildmode=c-archive xterm/cxterm/cxterm.go
# internal/goos
compile: linux/mips64le does not support -shared
# internal/itoa
compile: linux/mips64le does not support -shared
# internal/unsafeheader
compile: linux/mips64le does not support -shared
# internal/goarch
compile: linux/mips64le does not support -shared
# internal/goexperiment
compile: linux/mips64le does not support -shared
# unicode/utf8
compile: linux/mips64le does not support -shared
# math/bits
compile: linux/mips64le does not support -shared
# internal/race
compile: linux/mips64le does not support -shared
# internal/cpu
compile: linux/mips64le does not support -shared
# unicode
compile: linux/mips64le does not support -shared
# sync/atomic
compile: linux/mips64le does not support -shared
# runtime/internal/atomic
compile: linux/mips64le does not support -shared
# runtime/internal/syscall
compile: linux/mips64le does not support -shared

dylib

go build -tags "cxterm_parser" -o libs/xterm-linux-mips64le/libxterm.so -buildmode=c-shared xterm/cxterm/cxterm.go
-buildmode=c-shared not supported on linux/mips64le
@RyanCode RyanCode added the vulncheck or vulndb Issues for the x/vuln or x/vulndb repo label Oct 10, 2022
@gopherbot gopherbot modified the milestones: Unreleased, vuln/unplanned Oct 10, 2022
@joedian joedian added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Oct 10, 2022
@joedian
Copy link

joedian commented Oct 10, 2022

@RyanCode can you add a short description of what you expected,and a short title?

@zpavlinovic
Copy link
Contributor

Also, it is not currently clear how this issue is related to x/vuln and vulncheck/vulndb.

@seankhliao
Copy link
Member

Duplicate of #43264

@seankhliao seankhliao marked this as a duplicate of #43264 Oct 10, 2022
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2022
@RyanCode RyanCode changed the title x/vuln: when i use cgo on linux/mips64 to build a dy library,some error like "compile: linux/mips64le does not support -shared",but darwin/arm64 or linux/amd4 never happend. Oct 17, 2022
@RyanCode RyanCode changed the title when i use cgo on linux/mips64 to build a dy library,some error like "compile: linux/mips64le does not support -shared",but darwin/arm64 or linux/amd4 never happend. when i use cgo on linux/mips64 to build a dy library,some error like "compile: linux/mips64le does not support -shared",but darwin/arm64 or linux/amd64 never happend. Oct 17, 2022
@golang golang locked and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge vulncheck or vulndb Issues for the x/vuln or x/vulndb repo
Projects
None yet
Development

No branches or pull requests

5 participants