How to verify whether gollvm is picked

138 views
Skip to first unread message

Kavindu Gimhan Zoysa

unread,
Jun 27, 2021, 2:59:05 AM6/27/21
to golang-nuts
Hi all,

I have ran the commands in https://go.googlesource.com/gollvm/#installing, (I did not run `ninja install-gollvm`). Then I set the path of bin folder to my $PATH using `export PATH=<PATH_TO_INSTALLATION>build-debug/bin:$PATH`.

Finally, I was able to run `go build/run test.go` successfully. 

But my problem is since I have already installed golang to my machine before install gollvm, how do I verify that go build command picked gollvm, instead of golang's compiler?

Thank you,
Kavindu

Ian Lance Taylor

unread,
Jun 27, 2021, 5:23:53 PM6/27/21
to Kavindu Gimhan Zoysa, golang-nuts
Run "go version" and look for "gccgo" or "gollvm" in the output.

Or, run "go build -x" to see exactly what commands it is running.

Ian

Kavindu Gimhan Zoysa

unread,
Jun 28, 2021, 5:51:41 AM6/28/21
to golang-nuts
Thank you. In `go version` command I cannot see `gccgo` or `gollvm`

But in `go build -x` command has mentioned that, `llvm-goc` is running located at `/usr/local/bin`.

eric...@arm.com

unread,
Jun 29, 2021, 12:07:54 AM6/29/21
to golang-nuts
I don't know why you can't see 'gccgo' or 'gollvm', on my machine,
For main Go,
$ go version
go version go1.16.2 linux/arm64
For gccgo,
$ go version
go version go1.14.2 gccgo (GCC) 11.0.0 20200603 (experimental) linux/arm64
For gollvm,
$ go version
go version go1.16.5 gollvm LLVM 13.0.0git linux/amd64

Than McIntosh

unread,
Jun 29, 2021, 8:46:17 AM6/29/21
to Kavindu Gimhan Zoysa, golang-nuts
If would help if you could share your exact cmake invocation I think. 

If your cmake invocation looks like

cmake \
   -DCMAKE_BUILD_TYPE=RelWithDebInfo \
   -DCMAKE_INSTALL_PREFIX=/tmp/myinstall \
   -DCMAKE_C_COMPILER=/usr/bin/clang-10 \
   -DCMAKE_ASM_COMPILER=/usr/bin/clang-10 \
   -DCMAKE_CXX_COMPILER=/usr/bin/clang++-10 \
   -G Ninja ../llvm-project/llvm

Then you should be prepending /tmp/myinstall/bin to your path.

Thanks, Than

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/6623d44d-da35-4c54-8c90-9e6a8cc9cb00n%40googlegroups.com.

Kavindu Gimhan Zoysa

unread,
Jun 29, 2021, 9:02:22 AM6/29/21
to golang-nuts
Is that okay if I change `/usr/bin/clang-10` to `/usr/bin/clang-11`? Because I have installed clang-11.

Thank you,
Kavindu

Kavindu Gimhan Zoysa

unread,
Jun 29, 2021, 11:00:25 AM6/29/21
to golang-nuts
Now `go version` command shows the follwing output

go version
go: Symbol `syscall..types' has different size in shared object, consider re-linking
go: Symbol `runtime..types' has different size in shared object, consider re-linking
go version go1.15.3 gollvm LLVM 11.0.1 linux/amd64

It has picked gollvm properly.

Thank you all
Reply all
Reply to author
Forward
0 new messages