Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
gollvm: error in backend: Segmented stacks do not support vararg functions. Building goptuna, go-sqlite3 #41399
It seems that I was lucky today: my first pure gollvm related bug.
What version of Go are you using (
This is a known limitation of the LLVM back end and its implementation of -fsplit-stack; to the best of my knowledge this restriction dates back to the original segmented stack support added in 2011.
One thing that I can't quite understand is how -fsplit-stack is winding up on the command line in the first place, however. In your "go env" output I see
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build762480405=/tmp/go-build -gno-record-gcc-switches -funwind-tables"
which does not include "-fsplit-stack" -- when building C files for cgo, there is no reason to include this option.
OK, it looks as though -fsplit-stack is being added explicitly by the Go command (I thought this was something specific to gollvm, but I see the same thing with gccgo). For the moment I don't have a good workaround, other than using GCC as your C compiler instead of clang.