Error in LLGO installation

67 views
Skip to first unread message

Akshansh Chahal

unread,
Nov 24, 2016, 11:01:23 PM11/24/16
to llgo-dev
Hi,

I was following this : http://llvm.org/svn/llvm-project/llgo/trunk/README.TXT for installing llgo.
All the steps were successfully completed except the last one, where I have to do  "make install".
It ran till 92% progress successfully, and gave me this error :

[ 92%] Building Go executable llgo
could not determine kind of name for C.LLVMAddAttribute
could not determine kind of name for C.LLVMAddInstrAttribute
could not determine kind of name for C.LLVMAlignment
could not determine kind of name for C.LLVMAlwaysInlineAttribute
could not determine kind of name for C.LLVMAttribute
could not determine kind of name for C.LLVMByValAttribute
could not determine kind of name for C.LLVMGetAttribute
could not determine kind of name for C.LLVMInRegAttribute
could not determine kind of name for C.LLVMInlineHintAttribute
could not determine kind of name for C.LLVMNakedAttribute
could not determine kind of name for C.LLVMNestAttribute
could not determine kind of name for C.LLVMNoAliasAttribute
could not determine kind of name for C.LLVMNoCaptureAttribute
could not determine kind of name for C.LLVMNoImplicitFloatAttribute
could not determine kind of name for C.LLVMNoInlineAttribute
could not determine kind of name for C.LLVMNoRedZoneAttribute
could not determine kind of name for C.LLVMNoReturnAttribute
could not determine kind of name for C.LLVMNoUnwindAttribute
could not determine kind of name for C.LLVMOptimizeForSizeAttribute
could not determine kind of name for C.LLVMReadNoneAttribute
could not determine kind of name for C.LLVMReadOnlyAttribute
could not determine kind of name for C.LLVMRemoveAttribute
could not determine kind of name for C.LLVMRemoveInstrAttribute
could not determine kind of name for C.LLVMReturnsTwice
could not determine kind of name for C.LLVMSExtAttribute
could not determine kind of name for C.LLVMStackAlignment
could not determine kind of name for C.LLVMStackProtectAttribute
could not determine kind of name for C.LLVMStackProtectReqAttribute
could not determine kind of name for C.LLVMStructRetAttribute
could not determine kind of name for C.LLVMUWTable
could not determine kind of name for C.LLVMZExtAttribute
tools/llgo/CMakeFiles/llgo.dir/build.make:220: recipe for target 'bin/llgo' failed
make[2]: *** [bin/llgo] Error 1
CMakeFiles/Makefile2:51075: recipe for target 'tools/llgo/CMakeFiles/llgo.dir/all' failed
make[1]: *** [tools/llgo/CMakeFiles/llgo.dir/all] Error 2
Makefile:149: recipe for target 'all' failed
make: *** [all] Error 2


How to resolve this ?
Any help is appreciated.

Thank you

Akshansh

Akshansh Chahal

unread,
Nov 24, 2016, 11:14:11 PM11/24/16
to llgo-dev
I am using latest ubuntu and latest Go version installed.

Andrew Wilkins

unread,
Nov 27, 2016, 8:50:14 PM11/27/16
to llgo-dev
The build is currently broken for everyone. There have been various changes recently to the LLVM bindings, but no matching update to llgo. Feel free to send a patch if you're interested in fixing it. There is a new Docker image if you just want to play (see recent message from Mohsen). Otherwise, when I or someone else has time, we'll get onto it.

Cheers,
Andrew

Thank you

Akshansh

Akshansh Chahal

unread,
Nov 30, 2016, 3:23:51 AM11/30/16
to llgo-dev
Thanks Andrew for the information.

I basically want a Control Flow Graph for any given GO program for a project I am working on. So I was planning to get LLVM-IR from LLGO and then CFG from LLVM-IR.
Do you know any other simple way to get a CFG for a GO program.

Also if I pull that Docker Image, will I be able to get LLVM-IR from it. What command should I use for llvm-ir ?

Cheers,
Akshansh

Andrew Wilkins

unread,
Nov 30, 2016, 3:34:09 AM11/30/16
to llgo...@googlegroups.com
On Wed, 30 Nov 2016 at 16:23 Akshansh Chahal <akshans...@gmail.com> wrote:
Thanks Andrew for the information.

I basically want a Control Flow Graph for any given GO program for a project I am working on. So I was planning to get LLVM-IR from LLGO and then CFG from LLVM-IR.
Do you know any other simple way to get a CFG for a GO program.

Using llgo for that is probably a bit overkill. You could just use go/ssa directly. See: https://godoc.org/golang.org/x/tools/go/ssa#BasicBlock. You can get the CFG from the BB preds/succs.
 
Also if I pull that Docker Image, will I be able to get LLVM-IR from it. What command should I use for llvm-ir ?

It has the llgo compiler in it, so yes. e.g.
    llgo -emit-llvm -S -o - /path/to/main.go

(-emit-llvm to generate bitcode/IR, -S to produce textual IR rather than bitcode)
 
--
You received this message because you are subscribed to the Google Groups "llgo-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to llgo-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Akshansh Chahal

unread,
Nov 30, 2016, 3:38:59 AM11/30/16
to llgo-dev
Thanks a lot Andrew for such a quick and informative response. I would try out the other option you suggested using go/ssa.

Akshansh Chahal

unread,
Dec 11, 2016, 12:20:12 PM12/11/16
to llgo-dev
Hi Andrew,

If you can help with this problem, whenever you are free. I am not sure how to get any starting node of type BasicBlock (ssa#BasicBlock), so that I can traverse the Graph using Preds/Succs relation.
I am able to get ssa/program (ssa#Program) for a given .go file by using packages ssautil, parser, token and functions ParseFile(), CreateProgram() etc.
I took some help from here example_test.go
But how to get any node of type BasicBlock from that ssa.Program I have ?

Thanks
Akshansh

Andrew Wilkins

unread,
Dec 12, 2016, 8:06:42 PM12/12/16
to llgo-dev

It appears that Alan Donovan has answered your question on golang-nuts. I don't have anything to add over what he wrote.

Cheers, Andrew

Akshansh Chahal

unread,
Dec 12, 2016, 11:37:01 PM12/12/16
to llgo-dev
Yes, he has.
Cheers, Akshansh
Reply all
Reply to author
Forward
0 new messages