Gollvm failed to build hugo

146 views
Skip to first unread message

Yuan Ting

unread,
Jul 20, 2020, 7:24:18 AM7/20/20
to golang-nuts
Hi, I try to build hugo with fresh gollvm but the linker complains that:

# github.com/gohugoio/hugo
/usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset 0
/usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset a6

To reproduce:

git clone https://github.com/gohugoio/hugo.git
cd hugo
&& go build

Platform: x86_64 ubuntu:20.04
Gollvm build flags:
cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_RTTI=On -DLLVM_USE_LINKER=gold -G Ninja

Ian Lance Taylor

unread,
Jul 20, 2020, 2:33:52 PM7/20/20
to Yuan Ting, golang-nuts, Than McIntosh, Cherry Zhang
[ + 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/d722a1e8-d205-4c9e-8ae4-623c19dd2946o%40googlegroups.com.

Than McIntosh

unread,
Aug 10, 2020, 9:30:45 AM8/10/20
to Ian Lance Taylor, Yuan Ting, golang-nuts, Cherry Zhang
Hello,

>>/usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset 0

This issue is https://github.com/golang/go/issues/38728, which should be fixed at this point at tip. 

Thanks, Than

Yuan Ting

unread,
Aug 11, 2020, 2:06:09 AM8/11/20
to golang-nuts
Thanks for direction,

I think the root cause of this issue is exactly the same in #38728 but I afraid the patch in #38728 only fix the building of gollvm (i.e. add -fcd-branch=none to the build flags). In the above case, gollvm uses /usr/bin/cc to compile gccgo_c.o during the building of hugo without -fcd-branch=none and finally fails in linking time. So I guess we need also add this flag in somewhere gollvm calling /usr/bin/cc. This is only needed for newer linux distributions, I can't reproduce it in ubuntu 18.04.

Thanks, Ting

On Monday, August 10, 2020 at 9:30:45 PM UTC+8, Than McIntosh wrote:
Hello,

>>/usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset 0

This issue is https://github.com/golang/go/issues/38728, which should be fixed at this point at tip. 

Thanks, Than


On Mon, Jul 20, 2020 at 2:33 PM Ian Lance Taylor <ia...@golang.org> wrote:
[ + thanm, cherryyz ]

On Mon, Jul 20, 2020 at 4:24 AM Yuan Ting <yuan...@ict.ac.cn> wrote:
>
> Hi, I try to build hugo with fresh gollvm but the linker complains that:
>
> # github.com/gohugoio/hugo
> /usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset 0
> /usr/bin/ld.gold: error: $WORK/b029/_pkg_.a(gccgo_c.o): failed to match split-stack sequence at section 1 offset a6
>
> To reproduce:
>
> git clone https://github.com/gohugoio/hugo.git
> cd hugo && go build
>
> Platform: x86_64 ubuntu:20.04
> Gollvm build flags:
> cmake ../llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_RTTI=On -DLLVM_USE_LINKER=gold -G Ninja
>
> --
> 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 golan...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages