All right. With GCC 6.X it worked! Thanks so much for your support. As promised, here is my installation script (feel free to use this):
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y sudo apt update && sudo apt upgrade -y sudo apt install python3 git build-essential cmake m4 libxml2-dev gcc-6 g++-6 -y sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 50 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 50 wget https://github.com/Z3Prover/z3/archive/z3-4.8.3.tar.gz tar xf z3-4.8.3.tar.gz cd z3-4.8.3 python scripts/mk_make.py cd build make sudo make install #build and install llvm cd git clone http://llvm.org/git/llvm.git #clang cd llvm/tools git clone https://git.llvm.org/git/clang cd #gollvm cd llvm/tools git clone https://go.googlesource.com/gollvm cd gollvm git clone https://go.googlesource.com/gofrontend cd libgo git clone https://github.com/libffi/libffi.git git clone https://github.com/ianlancetaylor/libbacktrace.git cd #build everything mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/llvm-install -DLLVM_USE_LINKER=gold -G "Unix Makefiles" ../llvm make sudo make install Feedback appreciated. If you want me to change/add sth. let me know :) Cheers! On Tuesday, December 18, 2018 at 5:22:39 PM UTC+1, Benedikt T wrote: > > Note from my side: It didn't work for me when using gcc 5.4 which meets > the requirements of "V4.9 or later of GCC" stated in your commit. Maybe I > made a mistake during compilation, but my binaries seem to have been > compiled by gcc 5.4 and the symbol is still missing. > Thank you guys for making this happen! ;) If this works I'll give you a > full build script that hopefully works more or less universal and will help > ppl setting up their environment. > > On Tuesday, December 18, 2018 at 5:16:27 PM UTC+1, Than McIntosh wrote: >> >> Sent https://go-review.googlesource.com/c/gollvm/+/154737 to make that >> correction. >> Thanks for the feedback and helping improve gollvm... >> Cheers, Than >> >> >> On Tue, Dec 18, 2018 at 11:03 AM Benedikt T <ben...@gmail.com> wrote: >> >>> Thanks! Running compilation now, will keep you posted. I thought 5.4 >>> would be ok, as the FAQ for building gollvm states: "You'll need to >>> have an up-to-date copy of cmake on your system (3.6 or later vintage) to >>> build Gollvm, as well as a C/C++ compiler (V5.0 or later for Clang, or V4.9 >>> or later of GCC)." - maybe a correction would be helpful here. :) >>> >>> On Tuesday, December 18, 2018 at 3:59:32 PM UTC+1, Ian Lance Taylor >>> wrote: >>>> >>>> On Tue, Dec 18, 2018 at 1:50 AM Benedikt T <ben...@gmail.com> wrote: >>>> > >>>> > Ok, compilation went through after I ran the make command again. >>>> Seems like this run the debug data is omitted. However, setting the >>>> compiler to GCC yields the same error: >>>> > >>>> > ~/llvm-install/bin# >>>> LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/root/llvm-install/lib:/root/llvm-install/lib64/ >>>> >>>> ./go >>>> > ./go: symbol lookup error: /root/llvm-install/lib64/libgo.so.8svn: >>>> undefined symbol: __get_cpuid_count >>>> > >>>> > The file itself is compiled with gcc as seen in the comment section >>>> of the binary: >>>> > >>>> root@llvmbuilder1544639155868beforemake-s-1vcpu-2gb-fra1-01:~/llvm-install/bin# >>>> >>>> objdump -s --section .comment go >>>> > >>>> > go: file format elf64-x86-64 >>>> > >>>> > Contents of section .comment: >>>> > 0000 00474343 3a202855 62756e74 7520352e .GCC: (Ubuntu 5. >>>> > 0010 342e302d 36756275 6e747531 7e31362e 4.0-6ubuntu1~16. >>>> > 0020 30342e31 30292035 2e342e30 20323031 04.10) 5.4.0 201 >>>> > 0030 36303630 3900 60609. >>>> > >>>> > Is this version still too low? What am I missing here? >>>> >>>> You are using GCC 5.4. You need to use GCC 6 or later. >>>> >>>> Ian >>>> >>>> >>>> >>>> > On Tuesday, December 18, 2018 at 12:57:29 AM UTC+1, Benedikt T wrote: >>>> >> >>>> >> yeah, debug info is still in there... >>>> >> llvm-ar: ELF 64-bit LSB shared object, x86-64, version 1 >>>> (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, >>>> for GNU/Linux 3.2.0, >>>> BuildID[sha1]=c2ad3e2441ef2e4afd449627cc6a22d4b256f450, with debug_info, >>>> not stripped >>>> >> >>>> >> Is this supposed to happen? >>>> >> >>>> >> On Tuesday, December 18, 2018 at 12:55:13 AM UTC+1, Benedikt T >>>> wrote: >>>> >>> >>>> >>> Hi! >>>> >>> >>>> >>> it's kind of odd. Using gcc for compilation leads to this error >>>> during compilation: >>>> >>> tools/lto/CMakeFiles/LTO.dir/build.make:278: recipe for target >>>> 'lib/libLTO.so.8svn' failed >>>> >>> make[2]: *** [lib/libLTO.so.8svn] Error 1 >>>> >>> make[2]: *** Deleting file 'lib/libLTO.so.8svn' >>>> >>> CMakeFiles/Makefile2:20689: recipe for target >>>> 'tools/lto/CMakeFiles/LTO.dir/all' failed >>>> >>> make[1]: *** [tools/lto/CMakeFiles/LTO.dir/all] Error 2 >>>> >>> Makefile:149: recipe for target 'all' failed >>>> >>> make: *** [all] Error 2 >>>> >>> >>>> >>> This seems to be related to this: >>>> https://groups.google.com/forum/#!topic/llvm-dev/KH3DHQo0A38 >>>> >>> >>>> >>> Does setting those flags disable the -DCMAKE_BUILD_TYPE=Release >>>> -DLLVM_USE_LINKER=gold flags? It seems the built files are quite large... >>>> (hinting at additional debug info) >>>> >>> >>>> >>> On Monday, December 17, 2018 at 4:20:07 PM UTC+1, Than McIntosh >>>> wrote: >>>> >>>> >>>> >>>> >>>> >>>> Thanks for reporting this problem. >>>> >>>> >>>> >>>> As Ian said, one of the go library sources includes <cpuid.h>, >>>> and then expects to see an inline definition of that routine. >>>> >>>> >>>> >>>> I poked around a little and it looks as though versions of clang >>>> prior to 5.0 do provide a definition of <cpuid.h>, but they don't define >>>> __get_cpuid_count -- that seems to have been added later in this commit. >>>> >>>> >>>> >>>> Do you have a later version of clang that you could use as your >>>> build compiler (5.0 later)? Or could you use GCC instead? Either of these >>>> should take care of this problem. In you cmake invocation you'll want to >>>> use >>>> >>>> >>>> >>>> cmake ... >>>> >>>> -DCMAKE_ASM_COMPILER=/usr/bin/gcc \ >>>> >>>> -DCMAKE_CXX_COMPILER=/usr/bin/g++ \ >>>> >>>> -DCMAKE_C_COMPILER=/usr/bin/gcc \ >>>> >>>> >>>> >>>> Or equivalent. >>>> >>>> >>>> >>>> I will add a note to the FAQ on this, since others may also run >>>> into it. >>>> >>>> >>>> >>>> Thanks, Than >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> On Sun, Dec 16, 2018 at 7:17 PM Ian Lance Taylor <ia...@golang.org> >>>> wrote: >>>> >>>>> >>>> >>>>> [ + thanm ] >>>> >>>>> >>>> >>>>> On Sat, Dec 15, 2018 at 6:56 AM <ben...@gmail.com> wrote: >>>> >>>>> > >>>> >>>>> > I'm trying to use the current gollvm build, but it seems there >>>> is a symbol error. Probably that symbol is absent in the libgo release? >>>> >>>>> > Anyone had a similar problem or an idea how I can fix that? >>>> >>>>> >>>> >>>>> The libgo sources expect __get_cpuid_count to be defined by the >>>> >>>>> compiler intrinsics header <cpuid.h>. This is true for GCC. The >>>> >>>>> reference to the symbol is in libgo/go/internal/cpu/cpu_gccgo.c. >>>> >>>>> >>>> >>>>> Than: does the LLVM version of <cpuid.h> define >>>> __get_cpuid_count? If >>>> >>>>> not, I guess we need to tweak cpu_gccgo.c. >>>> >>>>> >>>> >>>>> Ian >>>> > >>>> > -- >>>> > 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. >>>> > For more options, visit https://groups.google.com/d/optout. >>>> >>> -- >>> 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. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.