https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88500
Bug ID: 88500
Summary: [SH]: SETCONTEXT_CLOBBERS_TLS needs to be handled in
libgo
Product: gcc
Version: 8.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: go
Assignee: ian at airs dot com
Reporter: glaubitz at physik dot fu-berlin.de
CC: cmang at google dot com, ian at airs dot com, jrtc27 at
jrtc27 dot com,
kkojima at gcc dot gnu.org, olegendo at gcc dot gnu.org
Target Milestone: ---
Target: sh*-*-*
Trying to build gcc-8 with gccgo enabled fails on sh4 now with:
libtool: compile: /<<PKGBUILDDIR>>/build/./gcc/xgcc
-B/<<PKGBUILDDIR>>/build/./gcc/ -B/usr/sh4-linux-gnu/bin/
-B/usr/sh4-linux-gnu/lib/ -isystem /usr/sh4-linux-gnu/include -isystem
/usr/sh4-linux-gnu/sys-include -isystem /<<PKGBUILDDIR>>/build/sys-include
-DHAVE_CONFIG_H -I. -I../../../src/libgo -I ../../../src/libgo/runtime
-I../../../src/libgo/../libffi/include -I../libffi/include -pthread
-L../libatomic/.libs -fexceptions -fnon-call-exceptions -fno-stack-protector
-Wall -Wextra -Wwrite-strings -Wcast-qual -D_GNU_SOURCE -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I ../../../src/libgo/../libgcc -I
../../../src/libgo/../libbacktrace -I ../../gcc/include -g -O2 -MT
go-unsafe-pointer.lo -MD -MP -MF .deps/go-unsafe-pointer.Tpo -c
../../../src/libgo/runtime/go-unsafe-pointer.c -o go-unsafe-pointer.o
>/dev/null 2>&1
../../../src/libgo/runtime/proc.c:171:4: error: #error unknown case for
SETCONTEXT_CLOBBERS_TLS
# error unknown case for SETCONTEXT_CLOBBERS_TLS
^~~~~
../../../src/libgo/runtime/proc.c: In function 'runtime_gogo':
../../../src/libgo/runtime/proc.c:289:2: warning: implicit declaration of
function 'fixcontext'; did you mean 'setcontext'?
[-Wimplicit-function-declaration]
fixcontext(ucontext_arg(&newg->context[0]));
^~~~~~~~~~
setcontext
../../../src/libgo/runtime/proc.c: In function 'runtime_mstart':
../../../src/libgo/runtime/proc.c:492:2: warning: implicit declaration of
function 'initcontext'; did you mean 'setcontext'?
[-Wimplicit-function-declaration]
initcontext();
^~~~~~~~~~~
setcontext
Looking at libgo/runtime/proc.c, it looks like this is because sh*-*-* defines
SETCONTEXT_CLOBBERS_TLS and it needs to be handled in libgo/runtime/proc.c.