diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2020-05-05 10:42:23 +0200 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2020-05-05 10:42:23 +0200 |
commit | 700d457295ac3ca7d139de8c90cceead03fad696 (patch) | |
tree | 8b8352ab8bdaea4de8e3bec6a2a1259568dde3c6 /gcc | |
parent | 308bc496884706af4b3077171cbac684c7a6f7c6 (diff) | |
download | gcc-700d457295ac3ca7d139de8c90cceead03fad696.zip gcc-700d457295ac3ca7d139de8c90cceead03fad696.tar.gz gcc-700d457295ac3ca7d139de8c90cceead03fad696.tar.bz2 |
build: Fix 32-bit TLS detection with 64-bit-default gas on Solaris/x86
I've recently tested i386-pc-solaris2.11 bootstrap on Solaris 11/x86
with only the bundled tools (using /usr/gnu/bin/as from binutils 2.30 in
this case). It failed compiling libgo/runtime/proc.c, creating invalid
assembly:
proc.s: Assembler messages:
proc.s:2092: Error: junk at end of line, first unrecognized character is `*'
.globl __emutls_v.*runtime.g
and several more errors. This is completely unexpected since Solaris
does support TLS. It turned out that 32-bit TLS detection in
gcc/configure had failed:
configure:25145: checking assembler for thread-local storage support
configure:25158: /usr/gnu/bin/as --fatal-warnings -o conftest.o conftest.s >&5
conftest.s: Assembler messages:
conftest.s:6: Error: relocated field and relocation type differ in signedness
conftest.s:7: Error: @TLSLDM reloc is not supported with 64-bit output format
conftest.s:7: Error: junk `@tlsldm' after expression
which isn't unexpected given that the bundled gas has been configured
for x86_64-pc-solaris2.11, i.e. 64-bit-default.
This is easily fixed by explicitly passing --32 for the 32-bit case,
matching what is done for the 64-bit test.
Tested on i386-pc-solaris2.11 with 32-bit-default and 64-bit-default gas
as well as with /usr/bin/as, always correctly detecting TLS support.
* configure.ac <i[34567]86-*-*>: Add --32 to tls_as_opt on Solaris.
* configure: Regenerate.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rwxr-xr-x | gcc/configure | 5 | ||||
-rw-r--r-- | gcc/configure.ac | 5 |
3 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34b56d9..aa90454 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-05-05 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * configure.ac <i[34567]86-*-*>: Add --32 to tls_as_opt on Solaris. + * configure: Regenerate. + 2020-05-05 Jakub Jelinek <jakub@redhat.com> PR target/94460 diff --git a/gcc/configure b/gcc/configure index f7030a2..cd3d951 100755 --- a/gcc/configure +++ b/gcc/configure @@ -24779,6 +24779,11 @@ $as_echo "#define TLS_SECTION_ASM_FLAG 't'" >>confdefs.h fi case "$target" in i[34567]86-*-*) + if test x$on_solaris = xyes; then + case $gas_flag in + yes) tls_as_opt="$tls_as_opt --32" ;; + esac + fi conftest_s="$conftest_s foo: .long 25 .text diff --git a/gcc/configure.ac b/gcc/configure.ac index 12297b7..0de3b4b 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -3544,6 +3544,11 @@ changequote(,)dnl fi case "$target" in i[34567]86-*-*) + if test x$on_solaris = xyes; then + case $gas_flag in + yes) tls_as_opt="$tls_as_opt --32" ;; + esac + fi conftest_s="$conftest_s foo: .long 25 .text |