[gollvm] Cannot build project : no type named 'CompositeType' in namespace 'llvm'

75 views
Skip to first unread message

gits...@gmail.com

unread,
Mar 31, 2020, 12:03:17 PM3/31/20
to golang-nuts
Hi,

I am currently trying to build the gollvm compiler.
I have followed the instructions provided on the Google source page, up until the "ninja gollvm" instruction, the only difference being that my workarea folder is named build-gollvm. At this point, I get the following error :

[1/1243] Building CXX object tools/gol...pGoFrontEnd.dir/go-llvm-builtins.cpp.o
FAILED: tools/gollvm/bridge/CMakeFiles/LLVMCppGoFrontEnd.dir/go-llvm-builtins.cpp.o
/usr/bin/c++  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/gollvm/bridge -I/home/jeremy/llvm-project/llvm/tools/gollvm/bridge -Iinclude -I/home/jeremy/llvm-project/llvm/include -Itools/gollvm/external/install/include -I/home/jeremy/llvm-project/llvm/tools/gollvm/gofrontend/go -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wno-comment -Wstring-conversion -fdiagnostics-color -g    -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/gollvm/bridge/CMakeFiles/LLVMCppGoFrontEnd.dir/go-llvm-builtins.cpp.o -MF tools/gollvm/bridge/CMakeFiles/LLVMCppGoFrontEnd.dir/go-llvm-builtins.cpp.o.d -o tools/gollvm/bridge/CMakeFiles/LLVMCppGoFrontEnd.dir/go-llvm-builtins.cpp.o -c /home/jeremy/llvm-project/llvm/tools/gollvm/bridge/go-llvm-builtins.cpp
In file included from /home/jeremy/llvm-project/llvm/tools/gollvm/bridge/go-llvm-builtins.cpp:13:
/home/jeremy/llvm-project/llvm/tools/gollvm/bridge/go-llvm.h:463:45: error: no type named 'CompositeType' in namespace 'llvm'
                                      llvm::CompositeType *llct,
                                      ~~~~~~^
/home/jeremy/llvm-project/llvm/tools/gollvm/bridge/go-llvm.h:471:47: error: no type named 'CompositeType' in namespace 'llvm'
                                        llvm::CompositeType *llct,
                                        ~~~~~~^
2 errors generated.
ninja: build stopped: subcommand failed.

It seems that the CompositeType exists in the mlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h file, but I don't know if it is the same that the one needed here. Having never worked with ninja nor cmake before, I don't know what needs to be changed to include those files - if it is indeed the one we need.

If you need any informations about my environment, feel free to ask me.

Ian Lance Taylor

unread,
Mar 31, 2020, 12:16:56 PM3/31/20
to gits...@gmail.com, Than McIntosh, Cherry Zhang, golang-nuts
[ + thanm, cherryyz ]
> --
> 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/a14de848-b677-4c17-84b3-b5d1ee5057c3%40googlegroups.com.

Than McIntosh

unread,
Mar 31, 2020, 12:41:04 PM3/31/20
to Ian Lance Taylor, gits...@gmail.com, Cherry Zhang, golang-nuts
Hi,

I'll take a look to see if I can reproduce the problem.

Gollvm is "out of tree", meaning that when LLVM headers and data structures change things can get out of sync, but I'll need to confirm.

Thanks, Than


Than McIntosh

unread,
Mar 31, 2020, 2:57:43 PM3/31/20
to Ian Lance Taylor, gits...@gmail.com, Cherry Zhang, golang-nuts
Hello again,

The gollvm sources were indeed out of date with LLVM tip. I sent


to resolve the problem. I'll let you know when this is checked in.

Thanks, Than

Than McIntosh

unread,
Mar 31, 2020, 3:04:52 PM3/31/20
to Ian Lance Taylor, gits...@gmail.com, Cherry Zhang, golang-nuts
CL submitted. If you can please update your client and try your build again, it should go through.

Thanks, Than

gits...@gmail.com

unread,
Apr 1, 2020, 7:56:47 AM4/1/20
to golang-nuts
Hi,

It seems to be building fine now.

Thank you for your fast reply !
> To unsubscribe from this group and stop receiving emails from it, send an email to golan...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages