Go version
1.25rc2
Output of go env
in your module/workspace:
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOARCH='riscv64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/root/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-bui
ld99810723=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='riscv64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/root/secpaver/go.mod'
GOMODCACHE='/home/root/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GORISCV64='rva20u64'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/root/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_riscv64'
GOVCS=''
GOVERSION='go1.25rc2'
GOWORK=''
PKG_CONFIG='pkg-config'
What did you do?
git clone https://gitee.com/openeuler/secpaver (cd secpaver && make && make selinux)
What did you see happen?
CGO_CFLAGS_ALLOW="-ftrapv -D_FORTIFY_SOURCE=2 -O2" CGO_CFLAGS="-fstack-protector-strong -ftrapv
-D_FORTIFY_SOURCE=2 -O2" \
CGO_LDFALGS_ALLOW="-Wl,-z,-s,relro,now,noexecstack" CGO_LDFALGS="-Wl,-z,-s,relro,now,noexecstack
" \
go build -buildmode=plugin -trimpath -ldflags '-w -s -buildid=IdBySecPaver -linkmode=external -e
xtldflags=-static -extldflags=-zrelro -extldflags=-znow' -o /root/secpaver/build/selinux.so cmd/
plugin/selinux/*.go
# crypto/internal/fips140/subtle
<autogenerated>:1: crypto/internal/fips140/subtle.XORBytes: invalid relocation R_RISCV_GOT_PCREL
_ITYPE in fips code
# gitee.com/openeuler/secpaver/engine/selinux/pkg/libsemanage
# [pkg-config --cflags -- libsemanage]
Package libsemanage was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsemanage.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libsemanage', required by 'virtual:world', not found
# crypto/internal/fips140
<autogenerated>:1: crypto/internal/fips140.init.0: invalid relocation R_RISCV_GOT_PCREL_ITYPE in
fips code
make: *** [Makefile:36: selinux] Error 1
What did you expect to see?
build complete
cc @golang/riscv64
Comment From: mengzhuo
Ref: https://github.com/openeuler-riscv/oerv-team/issues/1773
Comment From: gabyhelp
Related Issues
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: gopherbot
Change https://go.dev/cl/688635 mentions this issue: cmd/internal/obj: enable got pcrel itype in fips140 for riscv64