10000 cmd/build: linker error while cross-compiling to riscv64 in go1.15 · Issue #45466 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

cmd/build: linker error while cross-compiling to riscv64 in go1.15 #45466

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

Closed
vaibhavexleapsemi opened this issue Apr 9, 2021 · 2 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@vaibhavexleapsemi
Copy link

Go version : go1.15.6 linux/amd64
Go env :
GO111MODULE="auto"
GOARCH="riscv64"
GOBIN=""
GOCACHE="/home/root/.cache/go-build"
GOENV="/home/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/root/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/root/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/root/sdk/sysroots/riscv64-oe-linux/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/root/sdk/sysroots/x86_64-oesdk-linux/usr/lib/riscv64-oe-linux/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="riscv64-oe-linux-ar"
CC="riscv64-oe-linux-gcc -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/root/sdk/sysroots/riscv64-oe-linux"
CXX="riscv64-oe-linux-g++ -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/root/sdk/sysroots/riscv64-oe-linux"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/root/sdk/sysroots/riscv64-oe-linux -fPIC -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build631991988=/tmp/go-build -gno-record-gcc-switches"

I am trying to build edgex app-service-configurable using cross-compilation.
Here I am using riscv sdk created from yocto.

Following is the error I am facing:

/home/root/workspace/sysroots/x86_64-oesdk-linux/usr/libexec/riscv64-oe-linux/gcc/riscv64-oe-linux/10.2.0/real-ld: $WORK/b068/_x008.o: in function x_cgo_thread_start': ../workspace/sysroots/riscv64-oe-linux/usr/lib/go/src/runtime/cgo/gcc_util.c:21: undefined reference to _cgo_sys_thread_start'
collect2: error: ld returned 1 exit status

@ALTree
Copy link
Member
ALTree commented Apr 9, 2021

You didn't even include the commands you're running, there's not much to work with here. The New Issue template has several questions, but you just deleted it, which is not... great.

Anyway I don't think riscv64 supports external linking in Go 1.15; you may have more luck with Go 1.16. Please try it.

@ALTree ALTree changed the title linker error while cross-compiling cmd/build: linker error while cross-compiling to riscv64 in go1.15 Apr 9, 2021
@ALTree ALTree added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 9, 2021
@vaibhavexleapsemi
Copy link
Author

Sorry for my inconvenience @ALTree
As you suggested, I was able to eliminate the error I was facing.
Thankyou.

@golang golang locked and limited conversation to collaborators Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants
0