Closed advancedwebdeveloper closed 3 years ago
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/oceanfish81/.cache/go-build" GOENV="/home/oceanfish81/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/oceanfish81/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/oceanfish81/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/oceanfish81/gollvm_dist" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/oceanfish81/gollvm_dist/tools" GCCGO="/home/oceanfish81/gollvm_dist/bin/llvm-goc" AR="ar" CC="/usr/bin/clang" CXX="/usr/bin/clang++" CGO_ENABLED="1" GOMOD="/home/oceanfish81/rgo/go.mod" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build063060413=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
Thanks for the report. I don't use gollvm, so I'm not at all sure where to start with this.
@kortschak , you can simply use a container or a VM. You would require an environment, which is "clean" - so there would be no pre-installed Go distros. Simply extract Clang/LLVM into one folder - and gollvm into another folder. Then you have to execute the following, in each of those:
$ sudo cp -R /usr/ . Or if you would login into root - simply do # cp -R /usr/ . Then you can check your installation, by running $go env && go version . Oh, and do not forget to check whether you have as installed (binutils package).
In my case - I am on Ubuntu 20.04.1 - but I could help you with any other x86_64 Linux.
The first failure is based on the assumption of the existence of the gc toolchain (the test looks for a LICENSE file that I expect to be there). The second fails because of the requirement for the gcc flags -Wl,-Bsymbolic-functions
; if you can find the equivalents for llvm? You will also need to set the equivalent white-listing env var as specified in the .travis.yml at the root of the repo.
CC @thanm @cherrymui @ianlancetaylor
How is -Wl,-Bsymbolic-functions
passed? If this appears in a #cgo LDFLAGS
then I would expect it work for GoLLVM.
They are passed via #cgo pkg-config
.
Thanks. I would still expect it to work. But perhaps here is some bug with #cgo pkg-config
and GoLLVM.
Thanks. I would still expect it to work. But perhaps here is some bug with
#cgo pkg-config
and GoLLVM.
And how do you propose to track that down? Any specific logs, which I should collect?
It would help if someone wrote a small standalone test case that uses #cgo pkg-config
to check whether linker flags are handled correctly for gccgo/GoLLVM. That could then be filed as an issue at https://golang.org/issue. Thanks.
Could pkgconfig be of help here? CC @rjeczalik, @chriskillpack
I built a small example that uses pkg-config. That works fine with gollvm as far as I can tell.
It looks as though the problem is related the use of a non-approved flag in the pkg-config libs value:
go build github.com/rgonomic/rgo/sexp: invalid flag in pkg-config --libs: -Wl,-Bsymbolic-functions
The support for enabling this flag was added on Sep 2 of this year in CL 252698 by @kortschak , reviewed by @ianlancetaylor. The problem is that Gollvm is currently at Go 1.5 for std.libgo; the CL in question is present in trunk but not Go 1.15.
https://github.com/rgonomic/rgo/blame/abc1c4469e0013c2183e6f8ef6915c45c3f69c2d/go.mod#L3 says "go 1.15", which seems like a problem.
Hi.
I am not sure what I am missing - not really dealing with R.
I was curious to run your tests:
Most of them are failing. Please specify what I should provide.
Thanks