Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread eric fang
well done. Expect it to be merged. Thanks.

在 2020年5月6日星期三 UTC+8下午7:18:21,Than McIntosh写道:
>
> >This seems to be the synchronization problem of gollvm and llvm, I am 
> fixing it today, if you have not done it, I can help.
>
> Thanks, I have started a CL for this -- it is at 
> https://go-review.googlesource.com/c/gollvm/+/232497 if you want to look 
> it over. Not quite done yet, still a few things to wrap up.
>
> Cheers, Than
>
>
>
> On Wed, May 6, 2020 at 5:46 AM eric fang > 
> wrote:
>
> This seems to be the synchronization problem of gollvm and llvm, I am 
> fixing it today, if you have not done it, I can help.
>
> 在 2020年5月5日星期二 UTC+8下午8:30:14,Than McIntosh写道:
>
> OK, thanks for that.  I will investigate, this looks unrelated to the 
> previous problem. Stay tuned.
>
> Cheers, Than
>
>
> On Tue, May 5, 2020 at 5:32 AM Martins Eglitis  
> wrote:
>
> Hi,
>
> I am getting further now. This is what I am getting now:
>
> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) 
> -- Native target architecture is X86
> -- Threads enabled.
> -- Doxygen disabled.
> -- Go bindings disabled.
> -- Ninja version: 1.10.0
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
> -- OCaml bindings disabled.
> -- LLVM host triple: x86_64-unknown-linux-gnu
> -- LLVM default target triple: x86_64-unknown-linux-gnu
> -- Building with -fPIC
> -- Constructing LLVMBuild project information
> -- Targeting X86
> -- starting libgo configuration.
> -- Libgo: creating stdlib package targets
> -- Libgo: generating check targets
> -- libgo configuration complete.
> -- starting gotools configuration.
> -- gotools: generating check targets
> -- gotools configuration complete.
> -- Registering Bye as a pass plugin (static build: OFF)
> -- Failed to find LLVM FileCheck
> -- Version: 0.0.0
> -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
> -- Performing Test HAVE_POSIX_REGEX -- success
> -- Performing Test HAVE_STEADY_CLOCK -- success
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/gopher/workarea/build-debug
> [1/1288] Linking CXX static library lib/libLLVMFrontendOpenMP.a
> [2/1288] Linking CXX static library lib/libLLVMAggressiveInstCombine.a
> [3/1288] Linking CXX static library lib/libLLVMLinker.a
> [4/1288] Linking CXX static library lib/libLLVMVectorize.a
> [5/1288] Building CXX object 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o
> FAILED: tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.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/passes 
> -I/home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes -Iinclude 
> -I/home/gopher/workarea/llvm-project/llvm/include -fcf-protection=none -fPIC 
> -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra 
> -Wno-unused-parameter -Wwrite-strings -Wcast-qual 
> -Wno-missing-field-initializers -pedantic -Wno-long-long 
> -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess 
> -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment 
> -fdiagnostics-color -g-fno-exceptions -fno-rtti -std=c++14 -MD -MT 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o -MF 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o.d -o 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o -c 
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp: In 
> function 'bool gollvm::passes::hasPointer(llvm::Type*)':
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:34:14: 
> error: 'VectorTyID' is not a member of 'llvm::Type'
>34 |   case Type::VectorTyID:
>   |  ^~
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:35:26: 
> error: 'class llvm::Type' has no member named 'getVectorElementType'; did you 
> mean 'getPointerElementType'?
>35 | return hasPointer(T->getVectorElementType());
>   |  ^~~~
>   |  getPointerElementType
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp: In 
> function 'void getPtrBitmapForTypeHelper(llvm::Type*, const 
> llvm::DataLayout&, uint64_t, llvm::BitVector&)':
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:69:14: 
> error: 'VectorTyID' is not a member of 'llvm::Type'
>69 |   case Type::VectorTyID: {
>   |  ^~
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:70:19: 
> error: 'class llvm::Type' has no member named 'getVectorElementType'; did you 
> mean 'getPointerElementType'?
>70 | Type *ET = T->getVectorElementType();
>   |   

Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread 'Than McIntosh' via golang-nuts
>This seems to be the synchronization problem of gollvm and llvm, I am
fixing it today, if you have not done it, I can help.

Thanks, I have started a CL for this -- it is at
https://go-review.googlesource.com/c/gollvm/+/232497 if you want to look it
over. Not quite done yet, still a few things to wrap up.

Cheers, Than



On Wed, May 6, 2020 at 5:46 AM eric fang  wrote:

> This seems to be the synchronization problem of gollvm and llvm, I am
> fixing it today, if you have not done it, I can help.
>
> 在 2020年5月5日星期二 UTC+8下午8:30:14,Than McIntosh写道:
>>
>> OK, thanks for that.  I will investigate, this looks unrelated to the
>> previous problem. Stay tuned.
>>
>> Cheers, Than
>>
>>
>> On Tue, May 5, 2020 at 5:32 AM Martins Eglitis 
>> wrote:
>>
>> Hi,
>>
>> I am getting further now. This is what I am getting now:
>>
>> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
>> -- Native target architecture is X86
>> -- Threads enabled.
>> -- Doxygen disabled.
>> -- Go bindings disabled.
>> -- Ninja version: 1.10.0
>> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
>> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
>> -- OCaml bindings disabled.
>> -- LLVM host triple: x86_64-unknown-linux-gnu
>> -- LLVM default target triple: x86_64-unknown-linux-gnu
>> -- Building with -fPIC
>> -- Constructing LLVMBuild project information
>> -- Targeting X86
>> -- starting libgo configuration.
>> -- Libgo: creating stdlib package targets
>> -- Libgo: generating check targets
>> -- libgo configuration complete.
>> -- starting gotools configuration.
>> -- gotools: generating check targets
>> -- gotools configuration complete.
>> -- Registering Bye as a pass plugin (static build: OFF)
>> -- Failed to find LLVM FileCheck
>> -- Version: 0.0.0
>> -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
>> -- Performing Test HAVE_POSIX_REGEX -- success
>> -- Performing Test HAVE_STEADY_CLOCK -- success
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to: /home/gopher/workarea/build-debug
>> [1/1288] Linking CXX static library lib/libLLVMFrontendOpenMP.a
>> [2/1288] Linking CXX static library lib/libLLVMAggressiveInstCombine.a
>> [3/1288] Linking CXX static library lib/libLLVMLinker.a
>> [4/1288] Linking CXX static library lib/libLLVMVectorize.a
>> [5/1288] Building CXX object 
>> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o
>> FAILED: tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.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/passes 
>> -I/home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes -Iinclude 
>> -I/home/gopher/workarea/llvm-project/llvm/include -fcf-protection=none -fPIC 
>> -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra 
>> -Wno-unused-parameter -Wwrite-strings -Wcast-qual 
>> -Wno-missing-field-initializers -pedantic -Wno-long-long 
>> -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess 
>> -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor 
>> -Wno-comment -fdiagnostics-color -g-fno-exceptions -fno-rtti -std=c++14 
>> -MD -MT tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o -MF 
>> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o.d -o 
>> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o -c 
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp: In 
>> function 'bool gollvm::passes::hasPointer(llvm::Type*)':
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:34:14: 
>> error: 'VectorTyID' is not a member of 'llvm::Type'
>>34 |   case Type::VectorTyID:
>>   |  ^~
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:35:26: 
>> error: 'class llvm::Type' has no member named 'getVectorElementType'; did 
>> you mean 'getPointerElementType'?
>>35 | return hasPointer(T->getVectorElementType());
>>   |  ^~~~
>>   |  getPointerElementType
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp: In 
>> function 'void getPtrBitmapForTypeHelper(llvm::Type*, const 
>> llvm::DataLayout&, uint64_t, llvm::BitVector&)':
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:69:14: 
>> error: 'VectorTyID' is not a member of 'llvm::Type'
>>69 |   case Type::VectorTyID: {
>>   |  ^~
>> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:70:19: 
>> error: 'class llvm::Type' has no member named 'getVectorElementType'; did 
>> you mean 'getPointerElementType'?
>>70 | Type *ET = T->getVectorElementType();
>>   |   ^~~~
>>   |   

Re: [go-nuts] Build fails when following build instructions

2020-05-06 Thread eric fang
This seems to be the synchronization problem of gollvm and llvm, I am 
fixing it today, if you have not done it, I can help.

在 2020年5月5日星期二 UTC+8下午8:30:14,Than McIntosh写道:
>
> OK, thanks for that.  I will investigate, this looks unrelated to the 
> previous problem. Stay tuned.
>
> Cheers, Than
>
>
> On Tue, May 5, 2020 at 5:32 AM Martins Eglitis  > wrote:
>
> Hi,
>
> I am getting further now. This is what I am getting now:
>
> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) 
> -- Native target architecture is X86
> -- Threads enabled.
> -- Doxygen disabled.
> -- Go bindings disabled.
> -- Ninja version: 1.10.0
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
> -- OCaml bindings disabled.
> -- LLVM host triple: x86_64-unknown-linux-gnu
> -- LLVM default target triple: x86_64-unknown-linux-gnu
> -- Building with -fPIC
> -- Constructing LLVMBuild project information
> -- Targeting X86
> -- starting libgo configuration.
> -- Libgo: creating stdlib package targets
> -- Libgo: generating check targets
> -- libgo configuration complete.
> -- starting gotools configuration.
> -- gotools: generating check targets
> -- gotools configuration complete.
> -- Registering Bye as a pass plugin (static build: OFF)
> -- Failed to find LLVM FileCheck
> -- Version: 0.0.0
> -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
> -- Performing Test HAVE_POSIX_REGEX -- success
> -- Performing Test HAVE_STEADY_CLOCK -- success
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /home/gopher/workarea/build-debug
> [1/1288] Linking CXX static library lib/libLLVMFrontendOpenMP.a
> [2/1288] Linking CXX static library lib/libLLVMAggressiveInstCombine.a
> [3/1288] Linking CXX static library lib/libLLVMLinker.a
> [4/1288] Linking CXX static library lib/libLLVMVectorize.a
> [5/1288] Building CXX object 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o
> FAILED: tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.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/passes 
> -I/home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes -Iinclude 
> -I/home/gopher/workarea/llvm-project/llvm/include -fcf-protection=none -fPIC 
> -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra 
> -Wno-unused-parameter -Wwrite-strings -Wcast-qual 
> -Wno-missing-field-initializers -pedantic -Wno-long-long 
> -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess 
> -Wno-redundant-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment 
> -fdiagnostics-color -g-fno-exceptions -fno-rtti -std=c++14 -MD -MT 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o -MF 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o.d -o 
> tools/gollvm/passes/CMakeFiles/LLVMCppGoPasses.dir/Util.cpp.o -c 
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp: In 
> function 'bool gollvm::passes::hasPointer(llvm::Type*)':
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:34:14: 
> error: 'VectorTyID' is not a member of 'llvm::Type'
>34 |   case Type::VectorTyID:
>   |  ^~
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:35:26: 
> error: 'class llvm::Type' has no member named 'getVectorElementType'; did you 
> mean 'getPointerElementType'?
>35 | return hasPointer(T->getVectorElementType());
>   |  ^~~~
>   |  getPointerElementType
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp: In 
> function 'void getPtrBitmapForTypeHelper(llvm::Type*, const 
> llvm::DataLayout&, uint64_t, llvm::BitVector&)':
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:69:14: 
> error: 'VectorTyID' is not a member of 'llvm::Type'
>69 |   case Type::VectorTyID: {
>   |  ^~
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:70:19: 
> error: 'class llvm::Type' has no member named 'getVectorElementType'; did you 
> mean 'getPointerElementType'?
>70 | Type *ET = T->getVectorElementType();
>   |   ^~~~
>   |   getPointerElementType
> /home/gopher/workarea/llvm-project/llvm/tools/gollvm/passes/Util.cpp:71:33: 
> error: 'class llvm::Type' has no member named 'getVectorNumElements'; did you 
> mean 'getStructNumElements'?
>71 | for (unsigned i = 0, n = T->getVectorNumElements(); i < n; ++i) {
>   | ^~~~
>   | getStructNumElements
> [6/1288] Linking CXX static library 

Re: [go-nuts] Build fails when following build instructions

2020-05-04 Thread 'Than McIntosh' via golang-nuts
OK, thanks, that explains it.

When I compile the test file in question I get a prolog of

   0: 64 48 3b 24 25 70 00 cmp%fs:0x70,%rsp
   7: 00 00
   9: 73 12 jae1d 

Your prolog on the other hand looks like

   0:   f3 0f 1e fa *endbr64*
   4:   64 48 3b 24 25 70 00cmp%fs:0x70,%rsp
   b:   00 00
   d:   73 16   jae25 


Note the endbr64 -- this is coming from the GCC "-fcf-protection=branch"
command line option -- you aren't specifying this for your build, but most
likely it's being forced on intentionally by the provider of your linux
distro (or whoever built GCC), similar to the way some distros hard-wire on
PIE.

Thank you for reporting this problem.  I tested this scenario with tip of
trunk binutils and it looks as though it is still an issue. I will file a
binutils bug to report the issue and maybe also see about sending a fix if
I can.

In the mean time, one possible workaround would be for you to hard-wire off
this option in your Gollvm configure step.

Instead of running cmake as per the default installation instructions, you
can maybe try:

cmake -DCMAKE_BUILD_TYPE=Debug -DLLVM_USE_LINKER=gold
*-DCMAKE_CXX_FLAGS='-fcf-protection=none'
-DCMAKE_C_FLAGS='-fcf-protection=none'* -G Ninja ../llvm-project/llvm

to see if that gets things back on line for you.

Thanks, Than






On Mon, May 4, 2020 at 8:23 AM Martins Eglitis 
wrote:

> Here is the output:
>
> /tmp/CheckSymbolExists.o: file format elf64-x86-64
>
> SYMBOL TABLE:
>  ldf *ABS* CheckSymbolExists.c
>  ld  .text .text
>  ld  .data .data
>  ld  .bss  .bss
>  ld  .text.main    .text.main
>  ld  .note.GNU-split-stack 
> .note.GNU-split-stack
>  ld  .note.GNU-stack   .note.GNU-stack
>  ld  .note.gnu.property    
> .note.gnu.property
>  ld  .eh_frame .eh_frame
>  ld  .comment  .comment
>  g F .text.main   004b main
>  *UND* __morestack
>  *UND* _GLOBAL_OFFSET_TABLE_
>  *UND* mmap
>
>
>
> Disassembly of section .text.main:
>
>  :
> main():
>0: f3 0f 1e fa endbr64
>4: 64 48 3b 24 25 70 00cmp%fs:0x70,%rsp
>b: 00 00
>d: 73 16   jae25 
>f: 41 ba 08 00 00 00   mov$0x8,%r10d
>   15: 41 bb 00 00 00 00   mov$0x0,%r11d
>   1b: e8 00 00 00 00  callq  20 
>   1c: R_X86_64_PLT32  __morestack-0x4
>   20: c3  retq
>   21: f3 0f 1e fa endbr64
>   25: 55  push   %rbp
>   26: 48 89 e5mov%rsp,%rbp
>   29: 89 7d fcmov%edi,-0x4(%rbp)
>   2c: 48 89 75 f0 mov%rsi,-0x10(%rbp)
>   30: 8b 45 fcmov-0x4(%rbp),%eax
>   33: 48 98   cltq
>   35: 48 8d 14 85 00 00 00lea0x0(,%rax,4),%rdx
>   3c: 00
>   3d: 48 8b 05 00 00 00 00mov0x0(%rip),%rax# 44 
>   40: R_X86_64_REX_GOTPCRELX  mmap-0x4
>   44: 48 01 d0add%rdx,%rax
>   47: 8b 00   mov(%rax),%eax
>   49: 5d  pop%rbp
>   4a: c3  retq
>
> On 2020-05-04 14:43, Than McIntosh wrote:
>
> Thanks!
>
> Could you also please run
>
> objdump -tldr /tmp/CheckSymbolExists.o
>
> and send me the output of that?
>
> Cheers, Than
>
>
> On Mon, May 4, 2020 at 7:37 AM Martins Eglitis 
> wrote:
>
>> Hi,
>>
>> I am getting output like this:
>>
>> /tmp/CheckSymbolExists.c: In function 'main':
>> /tmp/CheckSymbolExists.c:7:11: warning: ISO C forbids conversion of function 
>> pointer to object pointer type [-Wpedantic]
>> 7 |   return ((int*)())[argc];
>>   |   ^
>> Using built-in specs.
>> COLLECT_GCC=/usr/bin/cc
>> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
>> OFFLOAD_TARGET_NAMES=nvptx-none:hsa
>> OFFLOAD_TARGET_DEFAULT=1
>> Target: x86_64-linux-gnu
>> Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
>> 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs 
>> --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 
>> --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 
>> --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id 
>> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
>> --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug 
>> --enable-libstdcxx-time=yes 

Re: [go-nuts] Build fails when following build instructions

2020-05-04 Thread 'Than McIntosh' via golang-nuts
Thanks!

Could you also please run

objdump -tldr /tmp/CheckSymbolExists.o

and send me the output of that?

Cheers, Than


On Mon, May 4, 2020 at 7:37 AM Martins Eglitis 
wrote:

> Hi,
>
> I am getting output like this:
>
> /tmp/CheckSymbolExists.c: In function 'main':
> /tmp/CheckSymbolExists.c:7:11: warning: ISO C forbids conversion of function 
> pointer to object pointer type [-Wpedantic]
> 7 |   return ((int*)())[argc];
>   |   ^
> Using built-in specs.
> COLLECT_GCC=/usr/bin/cc
> COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
> OFFLOAD_TARGET_NAMES=nvptx-none:hsa
> OFFLOAD_TARGET_DEFAULT=1
> Target: x86_64-linux-gnu
> Configured with: ../src/configure -v --with-pkgversion='Ubuntu 
> 9.3.0-10ubuntu2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs 
> --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr 
> --with-gcc-major-version-only --program-suffix=-9 
> --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id 
> --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
> --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug 
> --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new 
> --enable-gnu-unique-object --disable-vtable-verify --enable-plugin 
> --enable-default-pie --with-system-zlib --with-target-system-zlib=auto 
> --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 
> --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib 
> --with-tune=generic --enable-offload-targets=nvptx-none,hsa 
> --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu 
> --host=x86_64-linux-gnu --target=x86_64-linux-gnu
> Thread model: posix
> gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
> COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
> LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
> COLLECT_GCC_OPTIONS='-v' '-fPIC' '-fsplit-stack' '-fuse-ld=gold' '-o' 
> '/tmp/a.out' '-mtune=generic' '-march=x86-64'
>  /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin 
> /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so 
> -plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper 
> -plugin-opt=-fresolution=/tmp/ccoxuoxd.res -plugin-opt=-pass-through=-lgcc 
> -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc 
> -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id 
> --eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker 
> /lib64/ld-linux-x86-64.so.2 -pie -z now -fuse-ld=gold -z relro -o /tmp/a.out 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o 
> /usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 
> -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu 
> -L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu 
> -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib 
> -L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -allow-shlib-undefined --debug all 
> /tmp/CheckSymbolExists.o -lm --wrap=pthread_create -lgcc --push-state 
> --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s 
> --pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
> /usr/bin/ld.gold: recording to gold-recording-26rMUl
> /usr/bin/ld.gold:   0 running   task Dir_cache_task 
> /usr/lib/gcc/x86_64-linux-gnu/9
> /usr/bin/ld.gold:   0 completed task Dir_cache_task 
> /usr/lib/gcc/x86_64-linux-gnu/9 (user: 0.00 sys: 0.00 wall: 0.00)
> /usr/bin/ld.gold:   0 running   task Dir_cache_task 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu
> /usr/bin/ld.gold:   0 completed task Dir_cache_task 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu (user: 0.00 
> sys: 0.00 wall: 0.00)
> /usr/bin/ld.gold:   0 running   task Dir_cache_task 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib
> /usr/bin/ld.gold:   0 completed task Dir_cache_task 
> /usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib (user: 0.00 sys: 0.00 
> wall: 0.00)
> /usr/bin/ld.gold:   0 running   task Dir_cache_task /lib/x86_64-linux-gnu
> /usr/bin/ld.gold:   0 completed task Dir_cache_task /lib/x86_64-linux-gnu 
> (user: 0.00 sys: 0.00 wall: 0.01)
> /usr/bin/ld.gold:   0 running   task Dir_cache_task /lib/../lib
> /usr/bin/ld.gold:   0 completed task Dir_cache_task /lib/../lib (user: 
> 0.00 sys: 0.00 wall: 0.00)
> /usr/bin/ld.gold:   0 running   task Dir_cache_task /usr/lib/x86_64-linux-gnu
> 

Re: [go-nuts] Build fails when following build instructions

2020-05-04 Thread 'Martins Eglitis' via golang-nuts

Hi,

I am getting output like this:

/tmp/CheckSymbolExists.c: In function 'main':
/tmp/CheckSymbolExists.c:7:11: warning: ISO C forbids conversion of function 
pointer to object pointer type [-Wpedantic]
7 |   return ((int*)())[argc];
  |   ^
Using built-in specs.
COLLECT_GCC=/usr/bin/cc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.3.0-10ubuntu2' 
--with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs 
--enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr 
--with-gcc-major-version-only --program-suffix=-9 
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new 
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin 
--enable-default-pie --with-system-zlib --with-target-system-zlib=auto 
--enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib 
--with-tune=generic --enable-offload-targets=nvptx-none,hsa 
--without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.3.0 (Ubuntu 9.3.0-10ubuntu2)
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/9/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/9/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-fPIC' '-fsplit-stack' '-fuse-ld=gold' '-o' 
'/tmp/a.out' '-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/9/collect2 -plugin 
/usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so 
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper 
-plugin-opt=-fresolution=/tmp/ccoxuoxd.res -plugin-opt=-pass-through=-lgcc 
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --build-id 
--eh-frame-hdr -m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker 
/lib64/ld-linux-x86-64.so.2 -pie -z now -fuse-ld=gold -z relro -o /tmp/a.out 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/Scrt1.o 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crti.o 
/usr/lib/gcc/x86_64-linux-gnu/9/crtbeginS.o -L/usr/lib/gcc/x86_64-linux-gnu/9 
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu 
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib -L/lib/x86_64-linux-gnu 
-L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib 
-L/usr/lib/gcc/x86_64-linux-gnu/9/../../.. -allow-shlib-undefined --debug all 
/tmp/CheckSymbolExists.o -lm --wrap=pthread_create -lgcc --push-state 
--as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s 
--pop-state /usr/lib/gcc/x86_64-linux-gnu/9/crtendS.o 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu/crtn.o
/usr/bin/ld.gold: recording to gold-recording-26rMUl
/usr/bin/ld.gold:   0 running   task Dir_cache_task 
/usr/lib/gcc/x86_64-linux-gnu/9
/usr/bin/ld.gold:   0 completed task Dir_cache_task 
/usr/lib/gcc/x86_64-linux-gnu/9 (user: 0.00 sys: 0.00 wall: 0.00)
/usr/bin/ld.gold:   0 running   task Dir_cache_task 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu
/usr/bin/ld.gold:   0 completed task Dir_cache_task 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../x86_64-linux-gnu (user: 0.00 sys: 
0.00 wall: 0.00)
/usr/bin/ld.gold:   0 running   task Dir_cache_task 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib
/usr/bin/ld.gold:   0 completed task Dir_cache_task 
/usr/lib/gcc/x86_64-linux-gnu/9/../../../../lib (user: 0.00 sys: 0.00 
wall: 0.00)
/usr/bin/ld.gold:   0 running   task Dir_cache_task /lib/x86_64-linux-gnu
/usr/bin/ld.gold:   0 completed task Dir_cache_task /lib/x86_64-linux-gnu 
(user: 0.00 sys: 0.00 wall: 0.01)
/usr/bin/ld.gold:   0 running   task Dir_cache_task /lib/../lib
/usr/bin/ld.gold:   0 completed task Dir_cache_task /lib/../lib (user: 0.00 
sys: 0.00 wall: 0.00)
/usr/bin/ld.gold:   0 running   task Dir_cache_task /usr/lib/x86_64-linux-gnu
/usr/bin/ld.gold:   0 completed task Dir_cache_task /usr/lib/x86_64-linux-gnu 
(user: 0.00 sys: 0.00 wall: 0.00)
/usr/bin/ld.gold:   0 running   task Dir_cache_task /usr/lib/../lib
/usr/bin/ld.gold:   0 completed task Dir_cache_task /usr/lib/../lib (user: 
0.00 sys: 0.00 wall: 0.00)
/usr/bin/ld.gold:   0 running   task 

Re: [go-nuts] Build fails when following build instructions

2020-05-01 Thread 'Than McIntosh' via golang-nuts
Sorry, I wasn't clear on that last email.

What I'm asking is if you could rerun the compilation by hand, e.g.

$ cat > /tmp/CheckSymbolExists.c << EOF
#include 

int main(int argc, char** argv)
{
  (void)argv;
#ifndef mmap
  return ((int*)())[argc];
#else
  (void)argc;
  return 0;
#endif
}
EOF
$ /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter
-Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long
-Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -ffunction-sections
-fdata-sections -fuse-ld=gold -fsplit-stack  -fuse-ld=gold
-Wl,-allow-shlib-undefined /tmp/CheckSymbolExists.c -c -o
/tmp/CheckSymbolExists.o
$ /usr/bin/cc -v -fPIC -fuse-ld=gold -fsplit-stack  -fuse-ld=gold
-Wl,-allow-shlib-undefined -Wl,--debug,all  /tmp/CheckSymbolExists.o -o
/tmp/a.out  -lm
$

I am hoping that might give me a little more info.

Thanks, Than


On Fri, May 1, 2020 at 9:41 AM Martins Eglitis 
wrote:

> Sure, I have attached the CMakeOutput.log and CMakeError.log
> On 2020-05-01 16:19, Than McIntosh wrote:
>
>
> A little more detail on the error in question. This is a very obscure
> error, so please bear with me.
>
> >>/usr/bin/ld.gold: error:
> CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: failed to match
> split-stack sequence at section 4 offset 0
>
> What's happening here is that the linker (ld.gold) is linking together two
> object files, let's call them "a.o" and "b.o".
>
> The linker detects that one of the objects (let's say "a.o") has a marker
> indicating that it was compiled with the "-fsplit-stack" option. The second
> object file "b.o" has no such marker (e.g. it apparently wasn't compiled
> with -fsplit-stack).
>
> In addition, the linker sees (from object file relocations) that a
> function (let's call it AFunc) in a.o is making a call to BFunc in b.o. In
> such instances the gold linker has a feature that will perform a
> fixup/rewrite on the calling function to make sure that when the call takes
> place, the stack is large enough (so that -split-stack will have the right
> effect).
>
> To apply this fixup, the linker is looking for a specific prolog
> instruction sequence-- when it doesn't find that sequence, it issues the
> error.
>
> In the previous LLVM bug I cited, the problem was with the C compiler --
> it was marking the object as split-stack, but not consistently emitting the
> prolog sequence that the linker looks for.
>
> Your compiler is an up-to-date version of GCC, however, so it's hard for
> me to believe that the compiler is at fault.
>
> [This is a lot of technical detail, sorry about that].
>
> Do you think you could rerun the compile by hand and send me some of the
> output (e.g. regenerate the file "CheckSymbolExists.c" as it appeared in
> the cmake output log?
>
> Thanks, Than
>
> On Thu, Apr 30, 2020 at 4:39 PM Martins Eglitis 
> wrote:
>
>> Sorry, I should have mentioned that I am running a docker container based
>> on the latest Ubuntu, and Ubuntu 18.04 as the host.
>>
>> On April 30, 2020 11:37:15 PM GMT+03:00, Martins Eglitis <
>> mart...@sitilge.id.lv> wrote:
>>>
>>> Yes,
>>>
>>> cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
>>>
>>>
>>> On April 30, 2020 11:29:07 PM GMT+03:00, Than McIntosh 
>>> wrote:

 >>/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o:
 failed to match split-stack sequence at section 4 offset 0

 OK, now I think we're getting somewhere, this looks suspicious.  For
 reference, could you please send me the output of "/usr/bin/cc --version"?

 Thanks, Than




 On Thu, Apr 30, 2020 at 4:26 PM Martins Eglitis 
 wrote:

> Hi,
>
> There was something related in "CMakeError.log":
>
> Determining if the mmap exist failed with the following output:
> Change Dir: /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp
>
> Run Build Command(s):/usr/bin/ninja cmTC_81c99 && [1/2] Building C object 
> CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o
> CheckSymbolExists.c: In function 'main':
> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function 
> pointer to object pointer type [-Wpedantic]
> 8 |   return ((int*)())[argc];
>   |   ^
> [2/2] Linking C executable cmTC_81c99
> FAILED: cmTC_81c99
> : && /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra 
> -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers 
> -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment 
> -fdiagnostics-color -ffunction-sections -fdata-sections -fuse-ld=gold 
> -fsplit-stack  -fuse-ld=gold -Wl,-allow-shlib-undefined 
> CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o  -o cmTC_81c99  -lm && :
> /usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: 
> failed to match split-stack sequence at section 4 offset 0
> collect2: error: ld returned 1 exit status
> ninja: build stopped: subcommand failed.
>

Re: [go-nuts] Build fails when following build instructions

2020-05-01 Thread 'Than McIntosh' via golang-nuts
A little more detail on the error in question. This is a very obscure
error, so please bear with me.

>>/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o:
failed to match split-stack sequence at section 4 offset 0

What's happening here is that the linker (ld.gold) is linking together two
object files, let's call them "a.o" and "b.o".

The linker detects that one of the objects (let's say "a.o") has a marker
indicating that it was compiled with the "-fsplit-stack" option. The second
object file "b.o" has no such marker (e.g. it apparently wasn't compiled
with -fsplit-stack).

In addition, the linker sees (from object file relocations) that a function
(let's call it AFunc) in a.o is making a call to BFunc in b.o. In such
instances the gold linker has a feature that will perform a fixup/rewrite
on the calling function to make sure that when the call takes place, the
stack is large enough (so that -split-stack will have the right effect).

To apply this fixup, the linker is looking for a specific prolog
instruction sequence-- when it doesn't find that sequence, it issues the
error.

In the previous LLVM bug I cited, the problem was with the C compiler -- it
was marking the object as split-stack, but not consistently emitting the
prolog sequence that the linker looks for.

Your compiler is an up-to-date version of GCC, however, so it's hard for me
to believe that the compiler is at fault.

[This is a lot of technical detail, sorry about that].

Do you think you could rerun the compile by hand and send me some of the
output (e.g. regenerate the file "CheckSymbolExists.c" as it appeared in
the cmake output log?

Thanks, Than

On Thu, Apr 30, 2020 at 4:39 PM Martins Eglitis 
wrote:

> Sorry, I should have mentioned that I am running a docker container based
> on the latest Ubuntu, and Ubuntu 18.04 as the host.
>
> On April 30, 2020 11:37:15 PM GMT+03:00, Martins Eglitis <
> mart...@sitilge.id.lv> wrote:
>>
>> Yes,
>>
>> cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
>>
>>
>> On April 30, 2020 11:29:07 PM GMT+03:00, Than McIntosh 
>> wrote:
>>>
>>> >>/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o:
>>> failed to match split-stack sequence at section 4 offset 0
>>>
>>> OK, now I think we're getting somewhere, this looks suspicious.  For
>>> reference, could you please send me the output of "/usr/bin/cc --version"?
>>>
>>> Thanks, Than
>>>
>>>
>>>
>>>
>>> On Thu, Apr 30, 2020 at 4:26 PM Martins Eglitis 
>>> wrote:
>>>
 Hi,

 There was something related in "CMakeError.log":

 Determining if the mmap exist failed with the following output:
 Change Dir: /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp

 Run Build Command(s):/usr/bin/ninja cmTC_81c99 && [1/2] Building C object 
 CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o
 CheckSymbolExists.c: In function 'main':
 CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function 
 pointer to object pointer type [-Wpedantic]
 8 |   return ((int*)())[argc];
   |   ^
 [2/2] Linking C executable cmTC_81c99
 FAILED: cmTC_81c99
 : && /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra 
 -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers 
 -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment 
 -fdiagnostics-color -ffunction-sections -fdata-sections -fuse-ld=gold 
 -fsplit-stack  -fuse-ld=gold -Wl,-allow-shlib-undefined 
 CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o  -o cmTC_81c99  -lm && :
 /usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: 
 failed to match split-stack sequence at section 4 offset 0
 collect2: error: ld returned 1 exit status
 ninja: build stopped: subcommand failed.


 File 
 /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
 /* */
 #include 

 int main(int argc, char** argv)
 {
   (void)argv;
 #ifndef mmap
   return ((int*)())[argc];
 #else
   (void)argc;
   return 0;
 #endif
 }

 On 2020-04-30 20:32, Than McIntosh wrote:

 Thanks for the email.

 Sorry for the delay in responding, this is a very busy time right now
 for our team (release freeze is happening at the end of this week).

 Just in general, the gollvm build procedure uses "cmake", and as part
 of this process cmake is running various tests to make sure that the C
 compiler you're using works properly, and to detect whether the system you
 are building on has the right header files, libraries, etc.

 Of particular concern is the cmake check for "mmap"-- the mmap()
 routine is definitely available on Ubuntu, so it's puzzling that cmake
 thinks it isn't available.

 One thing you might do: after the build fails, try looking at the
 debris in the CMakeFiles dir:

 $ ls CMakeFiles
 3.13.4 

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread 'Martins Eglitis' via golang-nuts

Hi,

There was something related in "CMakeError.log":

Determining if the mmap exist failed with the following output:
Change Dir: /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/ninja cmTC_81c99 && [1/2] Building C object 
CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o
CheckSymbolExists.c: In function 'main':
CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function pointer 
to object pointer type [-Wpedantic]
8 |   return ((int*)())[argc];
  |   ^
[2/2] Linking C executable cmTC_81c99
FAILED: cmTC_81c99
: && /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter 
-Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough 
-Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fuse-ld=gold 
-fsplit-stack  -fuse-ld=gold -Wl,-allow-shlib-undefined 
CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o  -o cmTC_81c99  -lm && :
/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: 
failed to match split-stack sequence at section 4 offset 0
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.


File /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include 

int main(int argc, char** argv)
{
  (void)argv;
#ifndef mmap
  return ((int*)())[argc];
#else
  (void)argc;
  return 0;
#endif
}

On 2020-04-30 20:32, Than McIntosh wrote:

Thanks for the email.

Sorry for the delay in responding, this is a very busy time right now 
for our team (release freeze is happening at the end of this week).


Just in general, the gollvm build procedure uses "cmake", and as part 
of this process cmake is running various tests to make sure that the C 
compiler you're using works properly, and to detect whether the system 
you are building on has the right header files, libraries, etc.


Of particular concern is the cmake check for "mmap"-- the mmap() 
routine is definitely available on Ubuntu, so it's puzzling that cmake 
thinks it isn't available.


One thing you might do: after the build fails, try looking at the 
debris in the CMakeFiles dir:


$ ls CMakeFiles
3.13.4             cmake.check_cache  feature_tests.bin  src.c
3.15.4             CMakeError.log     feature_tests.c 
 TargetDirectories.txt

CheckIncludeFiles  CMakeOutput.log    feature_tests.cxx  test.o
CheckTypeSize      CMakeTmp           simple.cc

In that dir, look at "CMakeOutput.log" for the place where this test 
is run:


Look for a section that looks like this:

    Determining if the mmap exist passed with the following output:
    Change Dir: /tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/local/google/home/thanm/bin/ninja" 
"cmTC_feb45"
    [1/2] Building C object 
CMakeFiles/cmTC_feb45.dir/CheckSymbolExists.c.o

    CheckSymbolExists.c: In function ‘main’:
    CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of 
function pointer to object pointer type [-Wpedantic]

       return ((int*)())[argc];
      ^
    [2/2] Linking C executable cmTC_feb45

    File 
/tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp/CheckSymbolExists.c:

    /* */
    #include 

    int main(int argc, char** argv)
    {
      (void)argv;
    #ifndef mmap
      return ((int*)())[argc];
    #else
      (void)argc;
      return 0;
    #endif
    }

Are there any clues there perhaps?

Thanks, Than


On Thu, Apr 30, 2020 at 1:05 PM > wrote:


Hi,

I initially opened an issue, but was suggested to post to the
mailing list instead: https://github.com/golang/go/issues/38728

Build keeps failing when trying to build (Ubuntu Focal Fossa,
amd64) from the latest commit to the master and following the
build instructions. Has anyone succeeded to build gollvm recently?
I am getting errors like this:

|-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY
LIBXML2_INCLUDE_DIR) -- Native target architecture is X86 --
Threads enabled. -- Doxygen disabled. -- Go bindings disabled. --
Ninja version: 1.10.0 -- Could NOT find OCaml (missing: OCAMLFIND
OCAML_VERSION OCAML_STDLIB_PATH) -- Could NOT find OCaml (missing:
OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) -- OCaml bindings
disabled. -- LLVM host triple: x86_64-unknown-linux-gnu -- LLVM
default target triple: x86_64-unknown-linux-gnu -- Building with
-fPIC -- Constructing LLVMBuild project information -- Targeting
AArch64 -- Targeting AMDGPU -- Targeting ARM -- Targeting AVR --
Targeting BPF -- Targeting Hexagon -- Targeting Lanai -- Targeting
Mips -- Targeting MSP430 -- Targeting NVPTX -- Targeting PowerPC
-- Targeting RISCV -- Targeting Sparc -- Targeting SystemZ --
Targeting WebAssembly -- Targeting X86 -- Targeting XCore CMake
Error at tools/gollvm/cmake/modules/AddGollvm.cmake:37 (message):
  C compiler does not support -fsplit-stack Call Stack (most
recent call first): 

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread 'Martins Eglitis' via golang-nuts
Sorry, I should have mentioned that I am running a docker container based on 
the latest Ubuntu, and Ubuntu 18.04 as the host.

On April 30, 2020 11:37:15 PM GMT+03:00, Martins Eglitis 
 wrote:
>Yes,
>
>cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
>
>
>On April 30, 2020 11:29:07 PM GMT+03:00, Than McIntosh
> wrote:
/usr/bin/ld.gold: error:
>>CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o:
>>failed to match split-stack sequence at section 4 offset 0
>>
>>OK, now I think we're getting somewhere, this looks suspicious.  For
>>reference, could you please send me the output of "/usr/bin/cc
>>--version"?
>>
>>Thanks, Than
>>
>>
>>
>>
>>On Thu, Apr 30, 2020 at 4:26 PM Martins Eglitis
>
>>wrote:
>>
>>> Hi,
>>>
>>> There was something related in "CMakeError.log":
>>>
>>> Determining if the mmap exist failed with the following output:
>>> Change Dir: /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp
>>>
>>> Run Build Command(s):/usr/bin/ninja cmTC_81c99 && [1/2] Building C
>>object CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o
>>> CheckSymbolExists.c: In function 'main':
>>> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of
>>function pointer to object pointer type [-Wpedantic]
>>> 8 |   return ((int*)())[argc];
>>>   |   ^
>>> [2/2] Linking C executable cmTC_81c99
>>> FAILED: cmTC_81c99
>>> : && /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra
>>-Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers
>>-pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment
>>-fdiagnostics-color -ffunction-sections -fdata-sections -fuse-ld=gold
>>-fsplit-stack  -fuse-ld=gold -Wl,-allow-shlib-undefined
>>CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o  -o cmTC_81c99  -lm &&
>>:
>>> /usr/bin/ld.gold: error:
>>CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: failed to match
>>split-stack sequence at section 4 offset 0
>>> collect2: error: ld returned 1 exit status
>>> ninja: build stopped: subcommand failed.
>>>
>>>
>>> File
>>/home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
>>> /* */
>>> #include 
>>>
>>> int main(int argc, char** argv)
>>> {
>>>   (void)argv;
>>> #ifndef mmap
>>>   return ((int*)())[argc];
>>> #else
>>>   (void)argc;
>>>   return 0;
>>> #endif
>>> }
>>>
>>> On 2020-04-30 20:32, Than McIntosh wrote:
>>>
>>> Thanks for the email.
>>>
>>> Sorry for the delay in responding, this is a very busy time right
>now
>>for
>>> our team (release freeze is happening at the end of this week).
>>>
>>> Just in general, the gollvm build procedure uses "cmake", and as
>part
>>of
>>> this process cmake is running various tests to make sure that the C
>>> compiler you're using works properly, and to detect whether the
>>system you
>>> are building on has the right header files, libraries, etc.
>>>
>>> Of particular concern is the cmake check for "mmap"-- the mmap()
>>routine
>>> is definitely available on Ubuntu, so it's puzzling that cmake
>thinks
>>it
>>> isn't available.
>>>
>>> One thing you might do: after the build fails, try looking at the
>>debris
>>> in the CMakeFiles dir:
>>>
>>> $ ls CMakeFiles
>>> 3.13.4 cmake.check_cache  feature_tests.bin  src.c
>>> 3.15.4 CMakeError.log feature_tests.c
>>>  TargetDirectories.txt
>>> CheckIncludeFiles  CMakeOutput.logfeature_tests.cxx  test.o
>>> CheckTypeSize  CMakeTmp   simple.cc
>>>
>>> In that dir, look at "CMakeOutput.log" for the place where this test
>>is
>>> run:
>>>
>>> Look for a section that looks like this:
>>>
>>> Determining if the mmap exist passed with the following output:
>>> Change Dir:
>>/tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp
>>>
>>> Run Build Command:"/usr/local/google/home/thanm/bin/ninja"
>>"cmTC_feb45"
>>> [1/2] Building C object
>>CMakeFiles/cmTC_feb45.dir/CheckSymbolExists.c.o
>>> CheckSymbolExists.c: In function ‘main’:
>>> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of
>>> function pointer to object pointer type [-Wpedantic]
>>>return ((int*)())[argc];
>>>   ^
>>> [2/2] Linking C executable cmTC_feb45
>>>
>>> File
>>>
>>/tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
>>> /* */
>>> #include 
>>>
>>> int main(int argc, char** argv)
>>> {
>>>   (void)argv;
>>> #ifndef mmap
>>>   return ((int*)())[argc];
>>> #else
>>>   (void)argc;
>>>   return 0;
>>> #endif
>>> }
>>>
>>> Are there any clues there perhaps?
>>>
>>> Thanks, Than
>>>
>>>
>>> On Thu, Apr 30, 2020 at 1:05 PM  wrote:
>>>
 Hi,

 I initially opened an issue, but was suggested to post to the
>>mailing
 list instead: https://github.com/golang/go/issues/38728

 Build keeps failing when trying to build (Ubuntu Focal Fossa,
>amd64)
>>from
 the latest commit to the master and following the build
>>instructions. Has
 anyone succeeded to build gollvm recently? I am getting errors like
>>this:

 -- Could 

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread 'Martins Eglitis' via golang-nuts
Yes,

cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0


On April 30, 2020 11:29:07 PM GMT+03:00, Than McIntosh  wrote:
>>>/usr/bin/ld.gold: error:
>CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o:
>failed to match split-stack sequence at section 4 offset 0
>
>OK, now I think we're getting somewhere, this looks suspicious.  For
>reference, could you please send me the output of "/usr/bin/cc
>--version"?
>
>Thanks, Than
>
>
>
>
>On Thu, Apr 30, 2020 at 4:26 PM Martins Eglitis 
>wrote:
>
>> Hi,
>>
>> There was something related in "CMakeError.log":
>>
>> Determining if the mmap exist failed with the following output:
>> Change Dir: /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp
>>
>> Run Build Command(s):/usr/bin/ninja cmTC_81c99 && [1/2] Building C
>object CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o
>> CheckSymbolExists.c: In function 'main':
>> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of
>function pointer to object pointer type [-Wpedantic]
>> 8 |   return ((int*)())[argc];
>>   |   ^
>> [2/2] Linking C executable cmTC_81c99
>> FAILED: cmTC_81c99
>> : && /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra
>-Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers
>-pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-comment
>-fdiagnostics-color -ffunction-sections -fdata-sections -fuse-ld=gold
>-fsplit-stack  -fuse-ld=gold -Wl,-allow-shlib-undefined
>CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o  -o cmTC_81c99  -lm &&
>:
>> /usr/bin/ld.gold: error:
>CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: failed to match
>split-stack sequence at section 4 offset 0
>> collect2: error: ld returned 1 exit status
>> ninja: build stopped: subcommand failed.
>>
>>
>> File
>/home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
>> /* */
>> #include 
>>
>> int main(int argc, char** argv)
>> {
>>   (void)argv;
>> #ifndef mmap
>>   return ((int*)())[argc];
>> #else
>>   (void)argc;
>>   return 0;
>> #endif
>> }
>>
>> On 2020-04-30 20:32, Than McIntosh wrote:
>>
>> Thanks for the email.
>>
>> Sorry for the delay in responding, this is a very busy time right now
>for
>> our team (release freeze is happening at the end of this week).
>>
>> Just in general, the gollvm build procedure uses "cmake", and as part
>of
>> this process cmake is running various tests to make sure that the C
>> compiler you're using works properly, and to detect whether the
>system you
>> are building on has the right header files, libraries, etc.
>>
>> Of particular concern is the cmake check for "mmap"-- the mmap()
>routine
>> is definitely available on Ubuntu, so it's puzzling that cmake thinks
>it
>> isn't available.
>>
>> One thing you might do: after the build fails, try looking at the
>debris
>> in the CMakeFiles dir:
>>
>> $ ls CMakeFiles
>> 3.13.4 cmake.check_cache  feature_tests.bin  src.c
>> 3.15.4 CMakeError.log feature_tests.c
>>  TargetDirectories.txt
>> CheckIncludeFiles  CMakeOutput.logfeature_tests.cxx  test.o
>> CheckTypeSize  CMakeTmp   simple.cc
>>
>> In that dir, look at "CMakeOutput.log" for the place where this test
>is
>> run:
>>
>> Look for a section that looks like this:
>>
>> Determining if the mmap exist passed with the following output:
>> Change Dir:
>/tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp
>>
>> Run Build Command:"/usr/local/google/home/thanm/bin/ninja"
>"cmTC_feb45"
>> [1/2] Building C object
>CMakeFiles/cmTC_feb45.dir/CheckSymbolExists.c.o
>> CheckSymbolExists.c: In function ‘main’:
>> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of
>> function pointer to object pointer type [-Wpedantic]
>>return ((int*)())[argc];
>>   ^
>> [2/2] Linking C executable cmTC_feb45
>>
>> File
>>
>/tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
>> /* */
>> #include 
>>
>> int main(int argc, char** argv)
>> {
>>   (void)argv;
>> #ifndef mmap
>>   return ((int*)())[argc];
>> #else
>>   (void)argc;
>>   return 0;
>> #endif
>> }
>>
>> Are there any clues there perhaps?
>>
>> Thanks, Than
>>
>>
>> On Thu, Apr 30, 2020 at 1:05 PM  wrote:
>>
>>> Hi,
>>>
>>> I initially opened an issue, but was suggested to post to the
>mailing
>>> list instead: https://github.com/golang/go/issues/38728
>>>
>>> Build keeps failing when trying to build (Ubuntu Focal Fossa, amd64)
>from
>>> the latest commit to the master and following the build
>instructions. Has
>>> anyone succeeded to build gollvm recently? I am getting errors like
>this:
>>>
>>> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY
>LIBXML2_INCLUDE_DIR)
>>> -- Native target architecture is X86
>>> -- Threads enabled.
>>> -- Doxygen disabled.
>>> -- Go bindings disabled.
>>> -- Ninja version: 1.10.0
>>> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION
>OCAML_STDLIB_PATH)
>>> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread 'Than McIntosh' via golang-nuts
>>/usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o:
failed to match split-stack sequence at section 4 offset 0

OK, now I think we're getting somewhere, this looks suspicious.  For
reference, could you please send me the output of "/usr/bin/cc --version"?

Thanks, Than




On Thu, Apr 30, 2020 at 4:26 PM Martins Eglitis 
wrote:

> Hi,
>
> There was something related in "CMakeError.log":
>
> Determining if the mmap exist failed with the following output:
> Change Dir: /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp
>
> Run Build Command(s):/usr/bin/ninja cmTC_81c99 && [1/2] Building C object 
> CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o
> CheckSymbolExists.c: In function 'main':
> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function 
> pointer to object pointer type [-Wpedantic]
> 8 |   return ((int*)())[argc];
>   |   ^
> [2/2] Linking C executable cmTC_81c99
> FAILED: cmTC_81c99
> : && /usr/bin/cc -fPIC -Werror=date-time -Wall -Wextra -Wno-unused-parameter 
> -Wwrite-strings -Wno-missing-field-initializers -pedantic -Wno-long-long 
> -Wimplicit-fallthrough -Wno-comment -fdiagnostics-color -ffunction-sections 
> -fdata-sections -fuse-ld=gold -fsplit-stack  -fuse-ld=gold 
> -Wl,-allow-shlib-undefined CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o  
> -o cmTC_81c99  -lm && :
> /usr/bin/ld.gold: error: CMakeFiles/cmTC_81c99.dir/CheckSymbolExists.c.o: 
> failed to match split-stack sequence at section 4 offset 0
> collect2: error: ld returned 1 exit status
> ninja: build stopped: subcommand failed.
>
>
> File 
> /home/gopher/workarea/build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
> /* */
> #include 
>
> int main(int argc, char** argv)
> {
>   (void)argv;
> #ifndef mmap
>   return ((int*)())[argc];
> #else
>   (void)argc;
>   return 0;
> #endif
> }
>
> On 2020-04-30 20:32, Than McIntosh wrote:
>
> Thanks for the email.
>
> Sorry for the delay in responding, this is a very busy time right now for
> our team (release freeze is happening at the end of this week).
>
> Just in general, the gollvm build procedure uses "cmake", and as part of
> this process cmake is running various tests to make sure that the C
> compiler you're using works properly, and to detect whether the system you
> are building on has the right header files, libraries, etc.
>
> Of particular concern is the cmake check for "mmap"-- the mmap() routine
> is definitely available on Ubuntu, so it's puzzling that cmake thinks it
> isn't available.
>
> One thing you might do: after the build fails, try looking at the debris
> in the CMakeFiles dir:
>
> $ ls CMakeFiles
> 3.13.4 cmake.check_cache  feature_tests.bin  src.c
> 3.15.4 CMakeError.log feature_tests.c
>  TargetDirectories.txt
> CheckIncludeFiles  CMakeOutput.logfeature_tests.cxx  test.o
> CheckTypeSize  CMakeTmp   simple.cc
>
> In that dir, look at "CMakeOutput.log" for the place where this test is
> run:
>
> Look for a section that looks like this:
>
> Determining if the mmap exist passed with the following output:
> Change Dir: /tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp
>
> Run Build Command:"/usr/local/google/home/thanm/bin/ninja" "cmTC_feb45"
> [1/2] Building C object CMakeFiles/cmTC_feb45.dir/CheckSymbolExists.c.o
> CheckSymbolExists.c: In function ‘main’:
> CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of
> function pointer to object pointer type [-Wpedantic]
>return ((int*)())[argc];
>   ^
> [2/2] Linking C executable cmTC_feb45
>
> File
> /tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
> /* */
> #include 
>
> int main(int argc, char** argv)
> {
>   (void)argv;
> #ifndef mmap
>   return ((int*)())[argc];
> #else
>   (void)argc;
>   return 0;
> #endif
> }
>
> Are there any clues there perhaps?
>
> Thanks, Than
>
>
> On Thu, Apr 30, 2020 at 1:05 PM  wrote:
>
>> Hi,
>>
>> I initially opened an issue, but was suggested to post to the mailing
>> list instead: https://github.com/golang/go/issues/38728
>>
>> Build keeps failing when trying to build (Ubuntu Focal Fossa, amd64) from
>> the latest commit to the master and following the build instructions. Has
>> anyone succeeded to build gollvm recently? I am getting errors like this:
>>
>> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
>> -- Native target architecture is X86
>> -- Threads enabled.
>> -- Doxygen disabled.
>> -- Go bindings disabled.
>> -- Ninja version: 1.10.0
>> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
>> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
>> -- OCaml bindings disabled.
>> -- LLVM host triple: x86_64-unknown-linux-gnu
>> -- LLVM default target triple: x86_64-unknown-linux-gnu
>> -- Building with -fPIC
>> -- Constructing LLVMBuild project information
>> -- 

Re: [go-nuts] Build fails when following build instructions

2020-04-30 Thread 'Than McIntosh' via golang-nuts
Thanks for the email.

Sorry for the delay in responding, this is a very busy time right now for
our team (release freeze is happening at the end of this week).

Just in general, the gollvm build procedure uses "cmake", and as part of
this process cmake is running various tests to make sure that the C
compiler you're using works properly, and to detect whether the system you
are building on has the right header files, libraries, etc.

Of particular concern is the cmake check for "mmap"-- the mmap() routine is
definitely available on Ubuntu, so it's puzzling that cmake thinks it isn't
available.

One thing you might do: after the build fails, try looking at the debris in
the CMakeFiles dir:

$ ls CMakeFiles
3.13.4 cmake.check_cache  feature_tests.bin  src.c
3.15.4 CMakeError.log feature_tests.c
 TargetDirectories.txt
CheckIncludeFiles  CMakeOutput.logfeature_tests.cxx  test.o
CheckTypeSize  CMakeTmp   simple.cc

In that dir, look at "CMakeOutput.log" for the place where this test is run:

Look for a section that looks like this:

Determining if the mmap exist passed with the following output:
Change Dir: /tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp

Run Build Command:"/usr/local/google/home/thanm/bin/ninja" "cmTC_feb45"
[1/2] Building C object CMakeFiles/cmTC_feb45.dir/CheckSymbolExists.c.o
CheckSymbolExists.c: In function ‘main’:
CheckSymbolExists.c:8:11: warning: ISO C forbids conversion of function
pointer to object pointer type [-Wpedantic]
   return ((int*)())[argc];
  ^
[2/2] Linking C executable cmTC_feb45

File
/tmp/llvm-project/build-relwithdbg/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include 

int main(int argc, char** argv)
{
  (void)argv;
#ifndef mmap
  return ((int*)())[argc];
#else
  (void)argc;
  return 0;
#endif
}

Are there any clues there perhaps?

Thanks, Than


On Thu, Apr 30, 2020 at 1:05 PM  wrote:

> Hi,
>
> I initially opened an issue, but was suggested to post to the mailing list
> instead: https://github.com/golang/go/issues/38728
>
> Build keeps failing when trying to build (Ubuntu Focal Fossa, amd64) from
> the latest commit to the master and following the build instructions. Has
> anyone succeeded to build gollvm recently? I am getting errors like this:
>
> -- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
> -- Native target architecture is X86
> -- Threads enabled.
> -- Doxygen disabled.
> -- Go bindings disabled.
> -- Ninja version: 1.10.0
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
> -- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH)
> -- OCaml bindings disabled.
> -- LLVM host triple: x86_64-unknown-linux-gnu
> -- LLVM default target triple: x86_64-unknown-linux-gnu
> -- Building with -fPIC
> -- Constructing LLVMBuild project information
> -- Targeting AArch64
> -- Targeting AMDGPU
> -- Targeting ARM
> -- Targeting AVR
> -- Targeting BPF
> -- Targeting Hexagon
> -- Targeting Lanai
> -- Targeting Mips
> -- Targeting MSP430
> -- Targeting NVPTX
> -- Targeting PowerPC
> -- Targeting RISCV
> -- Targeting Sparc
> -- Targeting SystemZ
> -- Targeting WebAssembly
> -- Targeting X86
> -- Targeting XCore
> CMake Error at tools/gollvm/cmake/modules/AddGollvm.cmake:37 (message):
>   C compiler does not support -fsplit-stack
> Call Stack (most recent call first):
>   tools/gollvm/CMakeLists.txt:21 (include)
>
>
> -- starting libgo configuration.
> CMake Error at tools/gollvm/cmake/modules/LibbacktraceUtils.cmake:19 
> (message):
>   Support for mmap() is required -- setup failed.
> Call Stack (most recent call first):
>   tools/gollvm/libgo/CMakeLists.txt:45 (setup_libbacktrace)
>
>
> CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:27 (message):
>   Support for mmap() is required -- setup failed.
> Call Stack (most recent call first):
>   tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)
>
>
> -- Libgo: creating stdlib package targets
> -- Libgo: generating check targets
> -- libgo configuration complete.
> -- starting gotools configuration.
> -- gotools: generating check targets
> -- gotools configuration complete.
> -- Registering Bye as a pass plugin (static build: OFF)
> -- Failed to find LLVM FileCheck
> -- Version: 0.0.0
> -- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
> -- Performing Test HAVE_POSIX_REGEX -- success
> -- Performing Test HAVE_STEADY_CLOCK -- success
> -- Configuring incomplete, errors occurred!
> See also "/home/gopher/workarea/build-debug/CMakeFiles/CMakeOutput.log".
> See also "/home/gopher/workarea/build-debug/CMakeFiles/CMakeError.log".
> ninja: error: loading 'build.ninja': No such file or directory
>
>
>
> --
> 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 

[go-nuts] Build fails when following build instructions

2020-04-30 Thread sitilge
Hi,

I initially opened an issue, but was suggested to post to the mailing list 
instead: https://github.com/golang/go/issues/38728

Build keeps failing when trying to build (Ubuntu Focal Fossa, amd64) from 
the latest commit to the master and following the build instructions. Has 
anyone succeeded to build gollvm recently? I am getting errors like this:

-- Could NOT find LibXml2 (missing: LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR) 
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Go bindings disabled.
-- Ninja version: 1.10.0
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- Could NOT find OCaml (missing: OCAMLFIND OCAML_VERSION OCAML_STDLIB_PATH) 
-- OCaml bindings disabled.
-- LLVM host triple: x86_64-unknown-linux-gnu
-- LLVM default target triple: x86_64-unknown-linux-gnu
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting AArch64
-- Targeting AMDGPU
-- Targeting ARM
-- Targeting AVR
-- Targeting BPF
-- Targeting Hexagon
-- Targeting Lanai
-- Targeting Mips
-- Targeting MSP430
-- Targeting NVPTX
-- Targeting PowerPC
-- Targeting RISCV
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting WebAssembly
-- Targeting X86
-- Targeting XCore
CMake Error at tools/gollvm/cmake/modules/AddGollvm.cmake:37 (message):
  C compiler does not support -fsplit-stack
Call Stack (most recent call first):
  tools/gollvm/CMakeLists.txt:21 (include)


-- starting libgo configuration.
CMake Error at tools/gollvm/cmake/modules/LibbacktraceUtils.cmake:19 (message):
  Support for mmap() is required -- setup failed.
Call Stack (most recent call first):
  tools/gollvm/libgo/CMakeLists.txt:45 (setup_libbacktrace)


CMake Error at tools/gollvm/cmake/modules/LibffiUtils.cmake:27 (message):
  Support for mmap() is required -- setup failed.
Call Stack (most recent call first):
  tools/gollvm/libgo/CMakeLists.txt:49 (setup_libffi)


-- Libgo: creating stdlib package targets
-- Libgo: generating check targets
-- libgo configuration complete.
-- starting gotools configuration.
-- gotools: generating check targets
-- gotools configuration complete.
-- Registering Bye as a pass plugin (static build: OFF)
-- Failed to find LLVM FileCheck
-- Version: 0.0.0
-- Performing Test HAVE_GNU_POSIX_REGEX -- failed to compile
-- Performing Test HAVE_POSIX_REGEX -- success
-- Performing Test HAVE_STEADY_CLOCK -- success
-- Configuring incomplete, errors occurred!
See also "/home/gopher/workarea/build-debug/CMakeFiles/CMakeOutput.log".
See also "/home/gopher/workarea/build-debug/CMakeFiles/CMakeError.log".
ninja: error: loading 'build.ninja': No such file or directory



-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/cdb72cf2-2fe2-4f44-87fb-5cc2058dd58a%40googlegroups.com.