From: erifan01 Date: Wed, 17 Apr 2019 01:44:24 +0000 (+0000) Subject: runtime/cgo: declare variable setg_gcc as static X-Git-Tag: go1.13beta1~645 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=4312a18b8a1d7d35dcc45cdf4280260c3933a2ed;p=gostls13.git runtime/cgo: declare variable setg_gcc as static variable setg_gcc in runtime/cgo/*.c should be static, otherwise it will be mixed with the function of the same name in runtime/asm_*.s or tls_*.s, which causes an error when building PIE with internal linking mode. Fixes #31485 Change-Id: I79b311ffcaf450984328db65397840ae7d85e65d Reviewed-on: https://go-review.googlesource.com/c/go/+/172498 Reviewed-by: Ian Lance Taylor --- diff --git a/src/runtime/cgo/gcc_darwin_arm.c b/src/runtime/cgo/gcc_darwin_arm.c index dd7d4f90e1..b1e2502b5d 100644 --- a/src/runtime/cgo/gcc_darwin_arm.c +++ b/src/runtime/cgo/gcc_darwin_arm.c @@ -47,7 +47,7 @@ inittls(void **tlsg, void **tlsbase) } static void *threadentry(void*); -void (*setg_gcc)(void*); +static void (*setg_gcc)(void*); void _cgo_sys_thread_start(ThreadStart *ts) diff --git a/src/runtime/cgo/gcc_darwin_arm64.c b/src/runtime/cgo/gcc_darwin_arm64.c index c99725d2d6..a0f75910c8 100644 --- a/src/runtime/cgo/gcc_darwin_arm64.c +++ b/src/runtime/cgo/gcc_darwin_arm64.c @@ -48,7 +48,7 @@ inittls(void **tlsg, void **tlsbase) } static void *threadentry(void*); -void (*setg_gcc)(void*); +static void (*setg_gcc)(void*); void _cgo_sys_thread_start(ThreadStart *ts) diff --git a/src/runtime/cgo/gcc_linux_arm.c b/src/runtime/cgo/gcc_linux_arm.c index 870a8a4a82..61855b96b2 100644 --- a/src/runtime/cgo/gcc_linux_arm.c +++ b/src/runtime/cgo/gcc_linux_arm.c @@ -11,7 +11,7 @@ static void *threadentry(void*); void (*x_cgo_inittls)(void **tlsg, void **tlsbase); -void (*setg_gcc)(void*); +static void (*setg_gcc)(void*); void _cgo_sys_thread_start(ThreadStart *ts) diff --git a/src/runtime/cgo/gcc_linux_arm64.c b/src/runtime/cgo/gcc_linux_arm64.c index 8630f2f03e..261c884ac9 100644 --- a/src/runtime/cgo/gcc_linux_arm64.c +++ b/src/runtime/cgo/gcc_linux_arm64.c @@ -13,7 +13,7 @@ static void *threadentry(void*); void (*x_cgo_inittls)(void **tlsg, void **tlsbase); -void (*setg_gcc)(void*); +static void (*setg_gcc)(void*); void _cgo_sys_thread_start(ThreadStart *ts) diff --git a/src/runtime/cgo/gcc_linux_mips64x.c b/src/runtime/cgo/gcc_linux_mips64x.c index afcd3234e8..42837b14df 100644 --- a/src/runtime/cgo/gcc_linux_mips64x.c +++ b/src/runtime/cgo/gcc_linux_mips64x.c @@ -15,7 +15,7 @@ static void *threadentry(void*); void (*x_cgo_inittls)(void **tlsg, void **tlsbase); -void (*setg_gcc)(void*); +static void (*setg_gcc)(void*); void _cgo_sys_thread_start(ThreadStart *ts) diff --git a/src/runtime/cgo/gcc_linux_mipsx.c b/src/runtime/cgo/gcc_linux_mipsx.c index 2a5f64a727..a44ea3057d 100644 --- a/src/runtime/cgo/gcc_linux_mipsx.c +++ b/src/runtime/cgo/gcc_linux_mipsx.c @@ -15,7 +15,7 @@ static void *threadentry(void*); void (*x_cgo_inittls)(void **tlsg, void **tlsbase); -void (*setg_gcc)(void*); +static void (*setg_gcc)(void*); void _cgo_sys_thread_start(ThreadStart *ts)