Patchwork glibc/sparc: Assume GOTDATA support in the toolchain

login
register
mail settings
Submitter Florian Weimer
Date Oct. 4, 2019, 11:30 a.m.
Message ID <87v9t4hho0.fsf@oldenburg2.str.redhat.com>
Download mbox | patch
Permalink /patch/34826/
State New
Headers show

Comments

Florian Weimer - Oct. 4, 2019, 11:30 a.m.
Dave,

I believe this configure check is no longer necessary.  We require
binutils 2.25 or later and GCC 6.2 or later for building glibc, and
binutils and GCC support are older than that.  The only possible
exception is if someone managed to build GCC 6.2 with an older binutils
without GOTDATA support, but I don't think that happens in practice.

HAVE_GCC_GOTDATA has apparently never been used.

The sparc targets in build-many-glibcs.py still build with this change.

Thanks,
Florian

2019-10-04  Florian Weimer  <fweimer@redhat.com>

	* config.h.in (HAVE_GCC_GOTDATA): Remove.
	* sysdeps/sparc/configure.ac: Remove checks for HAVE_GCC_GOTDATA
	and PI_STATIC_AND_HIDDEN.  Always define PI_STATIC_AND_HIDDEN.
	* sysdeps/sparc/configure: Regenerate.
Adhemerval Zanella Netto - Oct. 8, 2019, 6:22 p.m.
On 04/10/2019 08:30, Florian Weimer wrote:
> Dave,
> 
> I believe this configure check is no longer necessary.  We require
> binutils 2.25 or later and GCC 6.2 or later for building glibc, and
> binutils and GCC support are older than that.  The only possible
> exception is if someone managed to build GCC 6.2 with an older binutils
> without GOTDATA support, but I don't think that happens in practice.

It would require also to have GCC built with an outdate binutils, 
but either configure it or glibc build to use a newer one.

Also R_SPARC_GOTDATA_* support seemed to be added by 739f7f82bed 
(binutils 2.19), which is quite old.

> 
> HAVE_GCC_GOTDATA has apparently never been used.
> 
> The sparc targets in build-many-glibcs.py still build with this change.
> 
> Thanks,
> Florian
> 
> 2019-10-04  Florian Weimer  <fweimer@redhat.com>
> 
> 	* config.h.in (HAVE_GCC_GOTDATA): Remove.
> 	* sysdeps/sparc/configure.ac: Remove checks for HAVE_GCC_GOTDATA
> 	and PI_STATIC_AND_HIDDEN.  Always define PI_STATIC_AND_HIDDEN.
> 	* sysdeps/sparc/configure: Regenerate.

LGTM.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>

> 
> diff --git a/config.h.in b/config.h.in
> index 824dfe8d8c..dea43df438 100644
> --- a/config.h.in
> +++ b/config.h.in
> @@ -47,9 +47,6 @@
>  #undef	STACK_PROTECTOR_LEVEL
>  #endif
>  
> -/* Defined on SPARC if GCC emits GOTDATA relocations.  */
> -#undef  HAVE_GCC_GOTDATA
> -
>  /* Define if the linker supports the -z combreloc option.  */
>  #undef	HAVE_Z_COMBRELOC
>  

Ok.

> diff --git a/sysdeps/sparc/configure b/sysdeps/sparc/configure
> index bc6ac14e9f..491b00f0dc 100644
> --- a/sysdeps/sparc/configure
> +++ b/sysdeps/sparc/configure
> @@ -1,41 +1,4 @@
>  # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
>   # Local configure fragment for sysdeps/sparc.
>  
> -# Check for a GCC emitting GOTDATA relocations.
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc gcc GOTDATA reloc support" >&5
> -$as_echo_n "checking for sparc gcc GOTDATA reloc support... " >&6; }
> -if ${libc_cv_sparc_gcc_gotdata+:} false; then :
> -  $as_echo_n "(cached) " >&6
> -else
> -  cat > conftest.c <<\EOF
> -int data;
> -int foo(void)
> -{
> -	return data;
> -}
> -EOF
> -libc_cv_sparc_gcc_gotdata=no
> -if { ac_try='${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&5'
> -  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> -  (eval $ac_try) 2>&5
> -  ac_status=$?
> -  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
> -  test $ac_status = 0; }; }; then
> -  if grep -q 'gdop_hix22' conftest.s \
> -     && grep -q 'gdop_lox10' conftest.s; then
> -    libc_cv_sparc_gcc_gotdata=yes
> -  fi
> -fi
> -rm -f conftest*
> -fi
> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_gcc_gotdata" >&5
> -$as_echo "$libc_cv_sparc_gcc_gotdata" >&6; }
> -if test $libc_cv_sparc_gcc_gotdata = yes; then
> -  $as_echo "#define HAVE_GCC_GOTDATA 1" >>confdefs.h
> -
> -fi
> -
> -if test $libc_cv_sparc_gcc_gotdata = yes; then
> -  $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
> -
> -fi
> +$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
> diff --git a/sysdeps/sparc/configure.ac b/sysdeps/sparc/configure.ac
> index 43ad541464..5cdc0a984c 100644
> --- a/sysdeps/sparc/configure.ac
> +++ b/sysdeps/sparc/configure.ac
> @@ -1,30 +1,4 @@
>  GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>  # Local configure fragment for sysdeps/sparc.
>  
> -# Check for a GCC emitting GOTDATA relocations.
> -AC_CACHE_CHECK(for sparc gcc GOTDATA reloc support, libc_cv_sparc_gcc_gotdata, [dnl
> -changequote(,)dnl
> -cat > conftest.c <<\EOF
> -int data;
> -int foo(void)
> -{
> -	return data;
> -}
> -EOF
> -changequote([,])dnl
> -dnl
> -libc_cv_sparc_gcc_gotdata=no
> -if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&AS_MESSAGE_LOG_FD); then
> -  if grep -q 'gdop_hix22' conftest.s \
> -     && grep -q 'gdop_lox10' conftest.s; then
> -    libc_cv_sparc_gcc_gotdata=yes
> -  fi
> -fi
> -rm -f conftest*])
> -if test $libc_cv_sparc_gcc_gotdata = yes; then
> -  AC_DEFINE(HAVE_GCC_GOTDATA)
> -fi
> -
> -if test $libc_cv_sparc_gcc_gotdata = yes; then
> -  AC_DEFINE(PI_STATIC_AND_HIDDEN)
> -fi
> +AC_DEFINE(PI_STATIC_AND_HIDDEN)
> 

Ok.

Patch

diff --git a/config.h.in b/config.h.in
index 824dfe8d8c..dea43df438 100644
--- a/config.h.in
+++ b/config.h.in
@@ -47,9 +47,6 @@ 
 #undef	STACK_PROTECTOR_LEVEL
 #endif
 
-/* Defined on SPARC if GCC emits GOTDATA relocations.  */
-#undef  HAVE_GCC_GOTDATA
-
 /* Define if the linker supports the -z combreloc option.  */
 #undef	HAVE_Z_COMBRELOC
 
diff --git a/sysdeps/sparc/configure b/sysdeps/sparc/configure
index bc6ac14e9f..491b00f0dc 100644
--- a/sysdeps/sparc/configure
+++ b/sysdeps/sparc/configure
@@ -1,41 +1,4 @@ 
 # This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/sparc.
 
-# Check for a GCC emitting GOTDATA relocations.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sparc gcc GOTDATA reloc support" >&5
-$as_echo_n "checking for sparc gcc GOTDATA reloc support... " >&6; }
-if ${libc_cv_sparc_gcc_gotdata+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat > conftest.c <<\EOF
-int data;
-int foo(void)
-{
-	return data;
-}
-EOF
-libc_cv_sparc_gcc_gotdata=no
-if { ac_try='${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-  if grep -q 'gdop_hix22' conftest.s \
-     && grep -q 'gdop_lox10' conftest.s; then
-    libc_cv_sparc_gcc_gotdata=yes
-  fi
-fi
-rm -f conftest*
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_sparc_gcc_gotdata" >&5
-$as_echo "$libc_cv_sparc_gcc_gotdata" >&6; }
-if test $libc_cv_sparc_gcc_gotdata = yes; then
-  $as_echo "#define HAVE_GCC_GOTDATA 1" >>confdefs.h
-
-fi
-
-if test $libc_cv_sparc_gcc_gotdata = yes; then
-  $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
-
-fi
+$as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
diff --git a/sysdeps/sparc/configure.ac b/sysdeps/sparc/configure.ac
index 43ad541464..5cdc0a984c 100644
--- a/sysdeps/sparc/configure.ac
+++ b/sysdeps/sparc/configure.ac
@@ -1,30 +1,4 @@ 
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/sparc.
 
-# Check for a GCC emitting GOTDATA relocations.
-AC_CACHE_CHECK(for sparc gcc GOTDATA reloc support, libc_cv_sparc_gcc_gotdata, [dnl
-changequote(,)dnl
-cat > conftest.c <<\EOF
-int data;
-int foo(void)
-{
-	return data;
-}
-EOF
-changequote([,])dnl
-dnl
-libc_cv_sparc_gcc_gotdata=no
-if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fPIC conftest.c 1>&AS_MESSAGE_LOG_FD); then
-  if grep -q 'gdop_hix22' conftest.s \
-     && grep -q 'gdop_lox10' conftest.s; then
-    libc_cv_sparc_gcc_gotdata=yes
-  fi
-fi
-rm -f conftest*])
-if test $libc_cv_sparc_gcc_gotdata = yes; then
-  AC_DEFINE(HAVE_GCC_GOTDATA)
-fi
-
-if test $libc_cv_sparc_gcc_gotdata = yes; then
-  AC_DEFINE(PI_STATIC_AND_HIDDEN)
-fi
+AC_DEFINE(PI_STATIC_AND_HIDDEN)