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/compile: buildmode c-archive not supported on linux/mips64le #59561

Open
23083940 opened this issue Apr 12, 2023 · 5 comments
Open

cmd/compile: buildmode c-archive not supported on linux/mips64le #59561

23083940 opened this issue Apr 12, 2023 · 5 comments
Labels
arch-mips compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@23083940
Copy link

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

$ go version go1.18.3

Does this issue reproduce with the latest release?

yes

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

OS: 4.19.90-23.13.v2101.ky10.mips64el
CPU:Loongson-3A R4 (Loongson-3B4000)

go env Output
$ go env
GO111MODULE="on"
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,direct"
GOROOT="/usr/lib/golang"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_mips64le"
GOVCS=""
GOVERSION="go1.18.3"
GCCGO="gccgo"
GOMIPS64="hardfloat"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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-build2385386052=/tmp/go-build -gno-record-gcc-switches"

What did you do?

I tried to compile libGoReSym with c-achived mode in the mips64le (loongnix) platform, but found the following error:
/opt/go/bin/go build -buildmode=c-archive -o libGoReSym.a

internal/itoa

compile: linux/mips64le does not support -shared
。。。

The program is C wrapper for GoReSym

What did you expect to see?

-buildmode=c-achived support on linux/mips64le

What did you see instead?

-buildmode=c-achived not support on linux/mips64le

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Apr 12, 2023
@23083940 23083940 changed the title cmd/compile: -buildmode=c-shared not supported on linux/mips64le cmd/compile: -buildmode=c-achived not supported on linux/mips64le Apr 12, 2023
@mengzhuo
Copy link
Contributor

Duplicate with #43264

@mengzhuo mengzhuo closed this as not planned Won't fix, can't repro, duplicate, stale Apr 12, 2023
@23083940
Copy link
Author

Although the problems of c-achived and c-shared are very similar, and the error messages are similar, . But they are indeed not the same problem, I just confirmed the issue with longson's R&D.

@mengzhuo mengzhuo changed the title cmd/compile: -buildmode=c-achived not supported on linux/mips64le cmd/compile: buildmode c-archive not supported on linux/mips64le Apr 12, 2023
@mengzhuo mengzhuo reopened this Apr 12, 2023
@ianlancetaylor
Copy link
Contributor

There is a stack of changes starting at https://go.dev/cl/348732 that may fix this.

@mknyszek mknyszek added this to the Backlog milestone Apr 12, 2023
@dr2chase
Copy link
Contributor

A stale stack of changes, sadly.

@dr2chase dr2chase added the NeedsFix The path to resolution is known, but the work has not been done. label Apr 13, 2023
@UnitedMarsupials
Copy link

I'm getting the same error on FreeBSD/i386, using go-1.20:

[ 20% 5/24] cd /wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/purple-gowhatsapp-1.13.0/src/go && /usr/local/bin/cmake -E env GOPATH=/wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/go CGO_LDFLAGS="/wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/libpurple-dummy.a" go build -buildmode=c-archive -o /wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/purple-go-whatsapp.a bridge.go login.go handler.go send_message.go handle_message.go logger.go send_file.go mark_read.go presence.go profile.go send_file_checks.go message_cache.go conversations.go groups.go
FAILED: src/go/purple-go-whatsapp.a src/go/purple-go-whatsapp.h /wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/purple-go-whatsapp.a /wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/purple-go-whatsapp.h 
cd /wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/purple-gowhatsapp-1.13.0/src/go && /usr/local/bin/cmake -E env GOPATH=/wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/go CGO_LDFLAGS="/wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/libpurple-dummy.a" go build -buildmode=c-archive -o /wrkdirs/usr/ports/net-im/purple-gowhatsapp/work/.build/src/go/purple-go-whatsapp.a bridge.go login.go handler.go send_message.go handle_message.go logger.go send_file.go mark_read.go presence.go profile.go send_file_checks.go message_cache.go conversations.go groups.go
# command-line-arguments
invalid value "c-archive" for flag -buildmode: buildmode c-archive not supported on freebsd/386

The software being compiled is a mixture of C and Go code, but it builds on FreeBSD/amd64 without a problem.

Is there anything I can do about it for the 32-bit users? Would using go-1.21 help, for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-mips compiler/runtime Issues related to the Go compiler and/or runtime. FeatureRequest NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

7 participants