I have been building Gollvm in a container, I can build it successfully no matter on amd64 and arm64. But the ld.gold error message really exists on both platforms.
在 2020年5月26日星期二 UTC+8上午10:14:43,Yuan Ting写道: > > I tried to build gollvm in a docker container (the image is based on > ubuntu 20.04, and the host OS is MacOS catalina). I configured llvm by > > SHELL=/bin/sh cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 > -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_RTTI=On -DLLVM_USE_LINKER=gold -G > Ninja ../llvm > > and then build and install gollvm by > > ninja gollvm && ninja install-gollvm > > after a while, I encountered > > ... > > error: At most two relocations per offset are supported > > error: At most two relocations per offset are supported > > error: At most two relocations per offset are supported > > [212/1279] Creating > /root/llvm-project/build-debug/tools/gollvm/libgo/tmp-sigtab.go > > FAILED: tools/gollvm/libgo/tmp-sigtab.go > > cd /root/llvm-project/build-debug/tools/gollvm/libgo && GOARCH=amd64 > GOOS=linux /bin/sh > /root/llvm-project/llvm/tools/gollvm/libgo/capturescript.sh > /root/llvm-project/llvm/tools/gollvm/gofrontend/libgo/mksigtab.sh > /root/llvm-project/build-debug/tools/gollvm/libgo/tmp-sigtab.go > > error: no SHELL setting > > [214/1279] Creating > /root/llvm-project/build-debug/tools/gollvm/libgo/tmp-sysinfo.go > > ninja: build stopped: subcommand failed. > > > By add SHELL=/bin/sh, the errors above seems to be skipped but another > period of time: > > > ... > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libgo_c_piclib.dir/__/gofrontend/libgo/go/syscall/errno.c.o: > > failed to match split-stack sequence at section 4 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libgo_c_piclib.dir/__/gofrontend/libgo/go/syscall/errno.c.o: > > failed to match split-stack sequence at section 6 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libgo_c_piclib.dir/__/gofrontend/libgo/go/syscall/signame.c.o: > > failed to match split-stack sequence at section 5 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libbacktrace_piclib.dir/libbacktrace/backtrace.c.o: > > failed to match split-stack sequence at section 4 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libbacktrace_piclib.dir/libbacktrace/backtrace.c.o: > > failed to match split-stack sequence at section 6 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libbacktrace_piclib.dir/libbacktrace/dwarf.c.o: > failed to match split-stack sequence at section 18 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libbacktrace_piclib.dir/libbacktrace/dwarf.c.o: > failed to match split-stack sequence at section 79 offset 0 > > ... > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libffi_piclib.dir/libffi/src/x86/ffi64.c.o: > failed to match split-stack sequence at section 22 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libffi_piclib.dir/libffi/src/x86/ffi64.c.o: > failed to match split-stack sequence at section 26 offset 0 > > /usr/bin/ld.gold: error: > tools/gollvm/libgo/CMakeFiles/libffi_piclib.dir/libffi/src/x86/ffiw64.c.o: > failed to match split-stack sequence at section 16 offset 0 > > collect2: error: ld returned 1 exit status > > [901/1066] Linking C static library tools/gollvm/libgo/libgo.a > > ninja: build stopped: subcommand failed. > > > I'm not sure the error is caused by the container environment or my > configurations/other prerequisites. > -- 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/aa55577b-f8c7-4672-8bc8-e20b4a6f83f1%40googlegroups.com.