[roland/arm] ARM: Clean up EABI-related configury

Message ID 20140704014928.435BC2C3988@topped-with-meat.com
State Committed
Headers

Commit Message

Roland McGrath July 4, 2014, 1:49 a.m. UTC
  Now that pre-EABI is no longer supported, new toolchains are starting to be
built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
cross tools use arm-linux-gnu.

Also, there was a lopsided situation where sysdeps/arm/ already assume EABI
stuff but configure was doing some of the EABI-related magic only for Linux
configurations.  Now sysdeps/arm/{pre,}configure require, check for, and
cater to, EABI support universally for any ARM configuration.

This makes a cross-build on Fedora for --host=arm-linux-gnu succeed where
before it did not.

OK?


Thanks,
Roland


2014-07-03  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/arm/preconfigure.ac: Apply EABI sanity check to arm*, not
	just Linux configurations.  Test empirically that the compiler sets
	__ARM_EABI__, rather than using the tuple to decide.
	* sysdeps/unix/sysv/linux/arm/configure: File removed.
	* sysdeps/unix/sysv/linux/arm/configure.ac: File removed,
	contents appended ...
	* sysdeps/arm/configure.ac: ... here.
	* sysdeps/arm/configure: Regenerated.
  

Comments

Will Newton July 4, 2014, 8:40 a.m. UTC | #1
On 4 July 2014 02:49, Roland McGrath <roland@hack.frob.com> wrote:
> Now that pre-EABI is no longer supported, new toolchains are starting to be
> built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
> cross tools use arm-linux-gnu.
>
> Also, there was a lopsided situation where sysdeps/arm/ already assume EABI
> stuff but configure was doing some of the EABI-related magic only for Linux
> configurations.  Now sysdeps/arm/{pre,}configure require, check for, and
> cater to, EABI support universally for any ARM configuration.
>
> This makes a cross-build on Fedora for --host=arm-linux-gnu succeed where
> before it did not.
>
> OK?

Looks good to me.

> Thanks,
> Roland
>
>
> 2014-07-03  Roland McGrath  <roland@hack.frob.com>
>
>         * sysdeps/arm/preconfigure.ac: Apply EABI sanity check to arm*, not
>         just Linux configurations.  Test empirically that the compiler sets
>         __ARM_EABI__, rather than using the tuple to decide.
>         * sysdeps/unix/sysv/linux/arm/configure: File removed.
>         * sysdeps/unix/sysv/linux/arm/configure.ac: File removed,
>         contents appended ...
>         * sysdeps/arm/configure.ac: ... here.
>         * sysdeps/arm/configure: Regenerated.
>
> --- a/sysdeps/arm/configure
> +++ b/sysdeps/arm/configure
> @@ -210,3 +210,11 @@ else
>    config_vars="$config_vars
>  have-arm-tls-desc = no"
>  fi
> +
> +libc_cv_gcc_unwind_find_fde=no
> +
> +# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> +CFLAGS=${CFLAGS% -fno-unwind-tables}
> +
> +libc_cv_gcc_exceptions=yes
> +exceptions=-fexceptions
> --- a/sysdeps/arm/configure.ac
> +++ b/sysdeps/arm/configure.ac
> @@ -39,3 +39,14 @@ if test $libc_cv_arm_tls_desc = yes; then
>  else
>    LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
>  fi
> +
> +libc_cv_gcc_unwind_find_fde=no
> +
> +# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> +CFLAGS=${CFLAGS% -fno-unwind-tables}
> +
> +dnl The normal configure check for gcc -fexecptions fails because it can't
> +dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
> +dnl has -fexceptions.
> +libc_cv_gcc_exceptions=yes
> +exceptions=-fexceptions
> --- a/sysdeps/arm/preconfigure
> +++ b/sysdeps/arm/preconfigure
> @@ -3,22 +3,36 @@
>
>  case "$machine" in
>  arm*)
> -  case $config_os in
> -  linux-gnueabi*)
> -    # If the compiler enables unwind tables by default, this causes
> -    # problems with undefined symbols in -nostdlib link tests.  To
> -    # avoid this, add -fno-unwind-tables here and remove it in
> -    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
> -    # been run.
> -    if test "${CFLAGS+set}" != "set"; then
> -      CFLAGS="-g -O2"
> -    fi
> -    CFLAGS="$CFLAGS -fno-unwind-tables"
> -    ;;
> -  linux*)
> -    as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
> -    ;;
> -  esac
> +
> +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h.  */
> +
> +#if !__ARM_EABI__
> +#error
> +#endif
> +int
> +main ()
> +{
> +
> +  ;
> +  return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_compile "$LINENO"; then :
> +
> +else
> +  as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
> +fi
> +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +
> +  # If the compiler enables unwind tables by default, this causes
> +  # problems with undefined symbols in -nostdlib link tests.  To
> +  # avoid this, add -fno-unwind-tables here and remove it in
> +  # sysdeps/arm/configure.ac after those tests have been run.
> +  if test "${CFLAGS+set}" != "set"; then
> +    CFLAGS="-g -O2"
> +  fi
> +  CFLAGS="$CFLAGS -fno-unwind-tables"
>
>    base_machine=arm
>    # Lets ask the compiler which ARM family we've got
> --- a/sysdeps/arm/preconfigure.ac
> +++ b/sysdeps/arm/preconfigure.ac
> @@ -3,22 +3,19 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>
>  case "$machine" in
>  arm*)
> -  case $config_os in
> -  linux-gnueabi*)
> -    # If the compiler enables unwind tables by default, this causes
> -    # problems with undefined symbols in -nostdlib link tests.  To
> -    # avoid this, add -fno-unwind-tables here and remove it in
> -    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
> -    # been run.
> -    if test "${CFLAGS+set}" != "set"; then
> -      CFLAGS="-g -O2"
> -    fi
> -    CFLAGS="$CFLAGS -fno-unwind-tables"
> -    ;;
> -  linux*)
> -    AC_MSG_ERROR([Old ABI no longer supported])
> -    ;;
> -  esac
> +  AC_TRY_COMPILE([
> +#if !__ARM_EABI__
> +#error
> +#endif], [], [], [AC_MSG_ERROR([Old ABI no longer supported])])
> +
> +  # If the compiler enables unwind tables by default, this causes
> +  # problems with undefined symbols in -nostdlib link tests.  To
> +  # avoid this, add -fno-unwind-tables here and remove it in
> +  # sysdeps/arm/configure.ac after those tests have been run.
> +  if test "${CFLAGS+set}" != "set"; then
> +    CFLAGS="-g -O2"
> +  fi
> +  CFLAGS="$CFLAGS -fno-unwind-tables"
>
>    base_machine=arm
>    # Lets ask the compiler which ARM family we've got
> --- a/sysdeps/microblaze/nptl/tls.h
> +++ b/sysdeps/microblaze/nptl/tls.h
> @@ -99,7 +99,7 @@ static inline void *__microblaze_get_thread_area (void)
>  /* Code to initially initialize the thread pointer.
>     r21 is reserved for thread pointer.  */
>  # define TLS_INIT_TP(tcbp) \
> -  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); 0; })
> +  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); NULL; })
>
>  # define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1
>
> --- a/sysdeps/unix/sysv/linux/arm/configure
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
> - # Local configure fragment for sysdeps/unix/sysv/linux/arm.
> -
> -libc_cv_gcc_unwind_find_fde=no
> -# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> -CFLAGS=${CFLAGS% -fno-unwind-tables}
> -
> -libc_cv_gcc_exceptions=yes
> -exceptions=-fexceptions
> --- a/sysdeps/unix/sysv/linux/arm/configure.ac
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
> -# Local configure fragment for sysdeps/unix/sysv/linux/arm.
> -
> -libc_cv_gcc_unwind_find_fde=no
> -# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> -CFLAGS=${CFLAGS% -fno-unwind-tables}
> -
> -dnl The normal configure check for gcc -fexecptions fails because it can't
> -dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
> -dnl has -fexceptions.
> -libc_cv_gcc_exceptions=yes
> -exceptions=-fexceptions
  
Richard Earnshaw July 4, 2014, 12:45 p.m. UTC | #2
On 04/07/14 02:49, Roland McGrath wrote:
> Now that pre-EABI is no longer supported, new toolchains are starting to be
> built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
> cross tools use arm-linux-gnu.
> 
> Also, there was a lopsided situation where sysdeps/arm/ already assume EABI
> stuff but configure was doing some of the EABI-related magic only for Linux
> configurations.  Now sysdeps/arm/{pre,}configure require, check for, and
> cater to, EABI support universally for any ARM configuration.
> 
> This makes a cross-build on Fedora for --host=arm-linux-gnu succeed where
> before it did not.
> 

I'm not necessarily objecting, but this seems quite an aggressive
schedule.  GCC-4.8 was the first compiler not to support the old ABI,
and GCC-4.7.4 was released only a few weeks ago; that did support the
old ABI.

R.

> OK?
> 
> 
> Thanks,
> Roland
> 
> 
> 2014-07-03  Roland McGrath  <roland@hack.frob.com>
> 
> 	* sysdeps/arm/preconfigure.ac: Apply EABI sanity check to arm*, not
> 	just Linux configurations.  Test empirically that the compiler sets
> 	__ARM_EABI__, rather than using the tuple to decide.
> 	* sysdeps/unix/sysv/linux/arm/configure: File removed.
> 	* sysdeps/unix/sysv/linux/arm/configure.ac: File removed,
> 	contents appended ...
> 	* sysdeps/arm/configure.ac: ... here.
> 	* sysdeps/arm/configure: Regenerated.
> 
> --- a/sysdeps/arm/configure
> +++ b/sysdeps/arm/configure
> @@ -210,3 +210,11 @@ else
>    config_vars="$config_vars
>  have-arm-tls-desc = no"
>  fi
> +
> +libc_cv_gcc_unwind_find_fde=no
> +
> +# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> +CFLAGS=${CFLAGS% -fno-unwind-tables}
> +
> +libc_cv_gcc_exceptions=yes
> +exceptions=-fexceptions
> --- a/sysdeps/arm/configure.ac
> +++ b/sysdeps/arm/configure.ac
> @@ -39,3 +39,14 @@ if test $libc_cv_arm_tls_desc = yes; then
>  else
>    LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
>  fi
> +
> +libc_cv_gcc_unwind_find_fde=no
> +
> +# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> +CFLAGS=${CFLAGS% -fno-unwind-tables}
> +
> +dnl The normal configure check for gcc -fexecptions fails because it can't
> +dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
> +dnl has -fexceptions.
> +libc_cv_gcc_exceptions=yes
> +exceptions=-fexceptions
> --- a/sysdeps/arm/preconfigure
> +++ b/sysdeps/arm/preconfigure
> @@ -3,22 +3,36 @@
>  
>  case "$machine" in
>  arm*)
> -  case $config_os in
> -  linux-gnueabi*)
> -    # If the compiler enables unwind tables by default, this causes
> -    # problems with undefined symbols in -nostdlib link tests.  To
> -    # avoid this, add -fno-unwind-tables here and remove it in
> -    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
> -    # been run.
> -    if test "${CFLAGS+set}" != "set"; then
> -      CFLAGS="-g -O2"
> -    fi
> -    CFLAGS="$CFLAGS -fno-unwind-tables"
> -    ;;
> -  linux*)
> -    as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
> -    ;;
> -  esac
> +
> +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
> +/* end confdefs.h.  */
> +
> +#if !__ARM_EABI__
> +#error
> +#endif
> +int
> +main ()
> +{
> +
> +  ;
> +  return 0;
> +}
> +_ACEOF
> +if ac_fn_c_try_compile "$LINENO"; then :
> +
> +else
> +  as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
> +fi
> +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
> +
> +  # If the compiler enables unwind tables by default, this causes
> +  # problems with undefined symbols in -nostdlib link tests.  To
> +  # avoid this, add -fno-unwind-tables here and remove it in
> +  # sysdeps/arm/configure.ac after those tests have been run.
> +  if test "${CFLAGS+set}" != "set"; then
> +    CFLAGS="-g -O2"
> +  fi
> +  CFLAGS="$CFLAGS -fno-unwind-tables"
>  
>    base_machine=arm
>    # Lets ask the compiler which ARM family we've got
> --- a/sysdeps/arm/preconfigure.ac
> +++ b/sysdeps/arm/preconfigure.ac
> @@ -3,22 +3,19 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>  
>  case "$machine" in
>  arm*)
> -  case $config_os in
> -  linux-gnueabi*)
> -    # If the compiler enables unwind tables by default, this causes
> -    # problems with undefined symbols in -nostdlib link tests.  To
> -    # avoid this, add -fno-unwind-tables here and remove it in
> -    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
> -    # been run.
> -    if test "${CFLAGS+set}" != "set"; then
> -      CFLAGS="-g -O2"
> -    fi
> -    CFLAGS="$CFLAGS -fno-unwind-tables"
> -    ;;
> -  linux*)
> -    AC_MSG_ERROR([Old ABI no longer supported])
> -    ;;
> -  esac
> +  AC_TRY_COMPILE([
> +#if !__ARM_EABI__
> +#error
> +#endif], [], [], [AC_MSG_ERROR([Old ABI no longer supported])])
> +
> +  # If the compiler enables unwind tables by default, this causes
> +  # problems with undefined symbols in -nostdlib link tests.  To
> +  # avoid this, add -fno-unwind-tables here and remove it in
> +  # sysdeps/arm/configure.ac after those tests have been run.
> +  if test "${CFLAGS+set}" != "set"; then
> +    CFLAGS="-g -O2"
> +  fi
> +  CFLAGS="$CFLAGS -fno-unwind-tables"
>  
>    base_machine=arm
>    # Lets ask the compiler which ARM family we've got
> --- a/sysdeps/microblaze/nptl/tls.h
> +++ b/sysdeps/microblaze/nptl/tls.h
> @@ -99,7 +99,7 @@ static inline void *__microblaze_get_thread_area (void)
>  /* Code to initially initialize the thread pointer.
>     r21 is reserved for thread pointer.  */
>  # define TLS_INIT_TP(tcbp) \
> -  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); 0; })
> +  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); NULL; })
>  
>  # define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1
>  
> --- a/sysdeps/unix/sysv/linux/arm/configure
> +++ /dev/null
> @@ -1,9 +0,0 @@
> -# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
> - # Local configure fragment for sysdeps/unix/sysv/linux/arm.
> -
> -libc_cv_gcc_unwind_find_fde=no
> -# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> -CFLAGS=${CFLAGS% -fno-unwind-tables}
> -
> -libc_cv_gcc_exceptions=yes
> -exceptions=-fexceptions
> --- a/sysdeps/unix/sysv/linux/arm/configure.ac
> +++ /dev/null
> @@ -1,12 +0,0 @@
> -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
> -# Local configure fragment for sysdeps/unix/sysv/linux/arm.
> -
> -libc_cv_gcc_unwind_find_fde=no
> -# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
> -CFLAGS=${CFLAGS% -fno-unwind-tables}
> -
> -dnl The normal configure check for gcc -fexecptions fails because it can't
> -dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
> -dnl has -fexceptions.
> -libc_cv_gcc_exceptions=yes
> -exceptions=-fexceptions
>
  
Ramana Radhakrishnan July 4, 2014, 1:15 p.m. UTC | #3
On Fri, Jul 4, 2014 at 1:45 PM, Richard Earnshaw <rearnsha@arm.com> wrote:
> On 04/07/14 02:49, Roland McGrath wrote:
>> Now that pre-EABI is no longer supported, new toolchains are starting to be
>> built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
>> cross tools use arm-linux-gnu.
>>
>> Also, there was a lopsided situation where sysdeps/arm/ already assume EABI
>> stuff but configure was doing some of the EABI-related magic only for Linux
>> configurations.  Now sysdeps/arm/{pre,}configure require, check for, and
>> cater to, EABI support universally for any ARM configuration.
>>
>> This makes a cross-build on Fedora for --host=arm-linux-gnu succeed where
>> before it did not.
>>
>
> I'm not necessarily objecting, but this seems quite an aggressive
> schedule.  GCC-4.8 was the first compiler not to support the old ABI,
> and GCC-4.7.4 was released only a few weeks ago; that did support the
> old ABI.
>

I can see this causing confusion when people just want to go back in
time and build toolchains based off older compiler versions. Very few
people are going to remember the cross product of supported versions
of components that go into the toolchain. The problem also is in bug
records as some folks say specifically arm-none-linux-gnueabi(hf) in
the GCC bug data base and there are historical arm-none-linux-gnu bugs
that will never be fixed. I think we should close them out in a
co-ordinated way as well as WONTFIX across the various bug databases.
More fun admin work.

It looks to me like a regressive move unless I'm missing something here.

regards
Ramana

> R.
>
>> OK?
>>
>>
>> Thanks,
>> Roland
>>
>>
>> 2014-07-03  Roland McGrath  <roland@hack.frob.com>
>>
>>       * sysdeps/arm/preconfigure.ac: Apply EABI sanity check to arm*, not
>>       just Linux configurations.  Test empirically that the compiler sets
>>       __ARM_EABI__, rather than using the tuple to decide.
>>       * sysdeps/unix/sysv/linux/arm/configure: File removed.
>>       * sysdeps/unix/sysv/linux/arm/configure.ac: File removed,
>>       contents appended ...
>>       * sysdeps/arm/configure.ac: ... here.
>>       * sysdeps/arm/configure: Regenerated.
>>
>> --- a/sysdeps/arm/configure
>> +++ b/sysdeps/arm/configure
>> @@ -210,3 +210,11 @@ else
>>    config_vars="$config_vars
>>  have-arm-tls-desc = no"
>>  fi
>> +
>> +libc_cv_gcc_unwind_find_fde=no
>> +
>> +# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
>> +CFLAGS=${CFLAGS% -fno-unwind-tables}
>> +
>> +libc_cv_gcc_exceptions=yes
>> +exceptions=-fexceptions
>> --- a/sysdeps/arm/configure.ac
>> +++ b/sysdeps/arm/configure.ac
>> @@ -39,3 +39,14 @@ if test $libc_cv_arm_tls_desc = yes; then
>>  else
>>    LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
>>  fi
>> +
>> +libc_cv_gcc_unwind_find_fde=no
>> +
>> +# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
>> +CFLAGS=${CFLAGS% -fno-unwind-tables}
>> +
>> +dnl The normal configure check for gcc -fexecptions fails because it can't
>> +dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
>> +dnl has -fexceptions.
>> +libc_cv_gcc_exceptions=yes
>> +exceptions=-fexceptions
>> --- a/sysdeps/arm/preconfigure
>> +++ b/sysdeps/arm/preconfigure
>> @@ -3,22 +3,36 @@
>>
>>  case "$machine" in
>>  arm*)
>> -  case $config_os in
>> -  linux-gnueabi*)
>> -    # If the compiler enables unwind tables by default, this causes
>> -    # problems with undefined symbols in -nostdlib link tests.  To
>> -    # avoid this, add -fno-unwind-tables here and remove it in
>> -    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
>> -    # been run.
>> -    if test "${CFLAGS+set}" != "set"; then
>> -      CFLAGS="-g -O2"
>> -    fi
>> -    CFLAGS="$CFLAGS -fno-unwind-tables"
>> -    ;;
>> -  linux*)
>> -    as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
>> -    ;;
>> -  esac
>> +
>> +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
>> +/* end confdefs.h.  */
>> +
>> +#if !__ARM_EABI__
>> +#error
>> +#endif
>> +int
>> +main ()
>> +{
>> +
>> +  ;
>> +  return 0;
>> +}
>> +_ACEOF
>> +if ac_fn_c_try_compile "$LINENO"; then :
>> +
>> +else
>> +  as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
>> +fi
>> +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
>> +
>> +  # If the compiler enables unwind tables by default, this causes
>> +  # problems with undefined symbols in -nostdlib link tests.  To
>> +  # avoid this, add -fno-unwind-tables here and remove it in
>> +  # sysdeps/arm/configure.ac after those tests have been run.
>> +  if test "${CFLAGS+set}" != "set"; then
>> +    CFLAGS="-g -O2"
>> +  fi
>> +  CFLAGS="$CFLAGS -fno-unwind-tables"
>>
>>    base_machine=arm
>>    # Lets ask the compiler which ARM family we've got
>> --- a/sysdeps/arm/preconfigure.ac
>> +++ b/sysdeps/arm/preconfigure.ac
>> @@ -3,22 +3,19 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>>
>>  case "$machine" in
>>  arm*)
>> -  case $config_os in
>> -  linux-gnueabi*)
>> -    # If the compiler enables unwind tables by default, this causes
>> -    # problems with undefined symbols in -nostdlib link tests.  To
>> -    # avoid this, add -fno-unwind-tables here and remove it in
>> -    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
>> -    # been run.
>> -    if test "${CFLAGS+set}" != "set"; then
>> -      CFLAGS="-g -O2"
>> -    fi
>> -    CFLAGS="$CFLAGS -fno-unwind-tables"
>> -    ;;
>> -  linux*)
>> -    AC_MSG_ERROR([Old ABI no longer supported])
>> -    ;;
>> -  esac
>> +  AC_TRY_COMPILE([
>> +#if !__ARM_EABI__
>> +#error
>> +#endif], [], [], [AC_MSG_ERROR([Old ABI no longer supported])])
>> +
>> +  # If the compiler enables unwind tables by default, this causes
>> +  # problems with undefined symbols in -nostdlib link tests.  To
>> +  # avoid this, add -fno-unwind-tables here and remove it in
>> +  # sysdeps/arm/configure.ac after those tests have been run.
>> +  if test "${CFLAGS+set}" != "set"; then
>> +    CFLAGS="-g -O2"
>> +  fi
>> +  CFLAGS="$CFLAGS -fno-unwind-tables"
>>
>>    base_machine=arm
>>    # Lets ask the compiler which ARM family we've got
>> --- a/sysdeps/microblaze/nptl/tls.h
>> +++ b/sysdeps/microblaze/nptl/tls.h
>> @@ -99,7 +99,7 @@ static inline void *__microblaze_get_thread_area (void)
>>  /* Code to initially initialize the thread pointer.
>>     r21 is reserved for thread pointer.  */
>>  # define TLS_INIT_TP(tcbp) \
>> -  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); 0; })
>> +  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); NULL; })
>>
>>  # define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1
>>
>> --- a/sysdeps/unix/sysv/linux/arm/configure
>> +++ /dev/null
>> @@ -1,9 +0,0 @@
>> -# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
>> - # Local configure fragment for sysdeps/unix/sysv/linux/arm.
>> -
>> -libc_cv_gcc_unwind_find_fde=no
>> -# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
>> -CFLAGS=${CFLAGS% -fno-unwind-tables}
>> -
>> -libc_cv_gcc_exceptions=yes
>> -exceptions=-fexceptions
>> --- a/sysdeps/unix/sysv/linux/arm/configure.ac
>> +++ /dev/null
>> @@ -1,12 +0,0 @@
>> -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
>> -# Local configure fragment for sysdeps/unix/sysv/linux/arm.
>> -
>> -libc_cv_gcc_unwind_find_fde=no
>> -# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
>> -CFLAGS=${CFLAGS% -fno-unwind-tables}
>> -
>> -dnl The normal configure check for gcc -fexecptions fails because it can't
>> -dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
>> -dnl has -fexceptions.
>> -libc_cv_gcc_exceptions=yes
>> -exceptions=-fexceptions
>>
>
>
  
Roland McGrath July 4, 2014, 7:20 p.m. UTC | #4
I think what you are both missing is that glibc already doesn't support the
old ABI.  The only difference here is whether it insists that the tuple
contain "gnueabi" or whether it simply insists that the compiler set
__ARM_EABI__.
  
Ramana Radhakrishnan July 16, 2014, 11:39 a.m. UTC | #5
On Fri, Jul 4, 2014 at 8:20 PM, Roland McGrath <roland@hack.frob.com> wrote:
> I think what you are both missing is that glibc already doesn't support the
> old ABI.  The only difference here is whether it insists that the tuple
> contain "gnueabi" or whether it simply insists that the compiler set
> __ARM_EABI__.

It's taken me a while to get back to this but better late than never.

The check for __ARM_EABI__ is going to be more robust and looks reasonable

After a chat with David Howells who maintains the cross gcc and cross
binutils packages in Fedora I've realized that the reason for my
confusion seems to be that the program prefix on Fedora is
arm-linux-gnu but the target is actually arm-linux-gnueabi :(. I don't
have a cross toolchain to hand to verify this myself but from the
output I've seen[1], this is probably the case.

I'm not sure if this is what you meant from your original post by :

Now that pre-EABI is no longer supported, new toolchains are starting to be
built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
cross tools use arm-linux-gnu.

regards
Ramana

1.
$>arm-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/arm-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/arm-linux-gnueabi/4.9.0/lto-wrapper
Target: arm-linux-gnueabi
  
Roland McGrath July 16, 2014, 4:55 p.m. UTC | #6
> After a chat with David Howells who maintains the cross gcc and cross
> binutils packages in Fedora I've realized that the reason for my
> confusion seems to be that the program prefix on Fedora is
> arm-linux-gnu but the target is actually arm-linux-gnueabi :(. I don't
> have a cross toolchain to hand to verify this myself but from the
> output I've seen[1], this is probably the case.
> 
> I'm not sure if this is what you meant from your original post by :
> 
> Now that pre-EABI is no longer supported, new toolchains are starting to be
> built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
> cross tools use arm-linux-gnu.

I hadn't noticed that it's using --target=arm-linux-gnueabi, but indeed it
is.  But note that in binutils arm-*-linux-* is nowadays accepted to mean
what used to require arm-*-linux-gnueabi*.  I imagine eventually GCC will
follow suit and the tuple distinction will really disappear.


Thanks,
Roland
  
Joseph Myers July 16, 2014, 9:01 p.m. UTC | #7
On Thu, 3 Jul 2014, Roland McGrath wrote:

> Now that pre-EABI is no longer supported, new toolchains are starting to be
> built using tuples arm-linux* rather than arm-linux*eabi*.  e.g. Fedora's
> cross tools use arm-linux-gnu.

That's clearly a broken way to configure such tools. arm-linux-gnu has 
well-defined semantics (old-ABI) which aren't changed by some tools no 
longer supporting old-ABI; the semantics of any GNU triplet are meant to 
be stable over time.

> Also, there was a lopsided situation where sysdeps/arm/ already assume EABI
> stuff but configure was doing some of the EABI-related magic only for Linux
> configurations.  Now sysdeps/arm/{pre,}configure require, check for, and
> cater to, EABI support universally for any ARM configuration.
> 
> This makes a cross-build on Fedora for --host=arm-linux-gnu succeed where
> before it did not.
> 
> OK?

This is OK (minus the sysdeps/microblaze/nptl/tls.h change, which doesn't 
belong in this patch), on the general principle of preferring detection of 
how the compiler actually behaves to anything involving matching patterns 
on host triplets.
  
Roland McGrath July 16, 2014, 10:19 p.m. UTC | #8
> This is OK (minus the sysdeps/microblaze/nptl/tls.h change, which doesn't 
> belong in this patch), on the general principle of preferring detection of 
> how the compiler actually behaves to anything involving matching patterns 
> on host triplets.

I've committed it, without the unintended microblaze change.

Thanks,
Roland
  

Patch

--- a/sysdeps/arm/configure
+++ b/sysdeps/arm/configure
@@ -210,3 +210,11 @@  else
   config_vars="$config_vars
 have-arm-tls-desc = no"
 fi
+
+libc_cv_gcc_unwind_find_fde=no
+
+# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
+CFLAGS=${CFLAGS% -fno-unwind-tables}
+
+libc_cv_gcc_exceptions=yes
+exceptions=-fexceptions
--- a/sysdeps/arm/configure.ac
+++ b/sysdeps/arm/configure.ac
@@ -39,3 +39,14 @@  if test $libc_cv_arm_tls_desc = yes; then
 else
   LIBC_CONFIG_VAR([have-arm-tls-desc], [no])
 fi
+
+libc_cv_gcc_unwind_find_fde=no
+
+# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
+CFLAGS=${CFLAGS% -fno-unwind-tables}
+
+dnl The normal configure check for gcc -fexecptions fails because it can't
+dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
+dnl has -fexceptions.
+libc_cv_gcc_exceptions=yes
+exceptions=-fexceptions
--- a/sysdeps/arm/preconfigure
+++ b/sysdeps/arm/preconfigure
@@ -3,22 +3,36 @@ 
 
 case "$machine" in
 arm*)
-  case $config_os in
-  linux-gnueabi*)
-    # If the compiler enables unwind tables by default, this causes
-    # problems with undefined symbols in -nostdlib link tests.  To
-    # avoid this, add -fno-unwind-tables here and remove it in
-    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
-    # been run.
-    if test "${CFLAGS+set}" != "set"; then
-      CFLAGS="-g -O2"
-    fi
-    CFLAGS="$CFLAGS -fno-unwind-tables"
-    ;;
-  linux*)
-    as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
-    ;;
-  esac
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if !__ARM_EABI__
+#error
+#endif
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  as_fn_error $? "Old ABI no longer supported" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+  # If the compiler enables unwind tables by default, this causes
+  # problems with undefined symbols in -nostdlib link tests.  To
+  # avoid this, add -fno-unwind-tables here and remove it in
+  # sysdeps/arm/configure.ac after those tests have been run.
+  if test "${CFLAGS+set}" != "set"; then
+    CFLAGS="-g -O2"
+  fi
+  CFLAGS="$CFLAGS -fno-unwind-tables"
 
   base_machine=arm
   # Lets ask the compiler which ARM family we've got
--- a/sysdeps/arm/preconfigure.ac
+++ b/sysdeps/arm/preconfigure.ac
@@ -3,22 +3,19 @@  GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 
 case "$machine" in
 arm*)
-  case $config_os in
-  linux-gnueabi*)
-    # If the compiler enables unwind tables by default, this causes
-    # problems with undefined symbols in -nostdlib link tests.  To
-    # avoid this, add -fno-unwind-tables here and remove it in
-    # sysdeps/unix/sysv/linux/arm/configure.ac after those tests have
-    # been run.
-    if test "${CFLAGS+set}" != "set"; then
-      CFLAGS="-g -O2"
-    fi
-    CFLAGS="$CFLAGS -fno-unwind-tables"
-    ;;
-  linux*)
-    AC_MSG_ERROR([Old ABI no longer supported])
-    ;;
-  esac
+  AC_TRY_COMPILE([
+#if !__ARM_EABI__
+#error
+#endif], [], [], [AC_MSG_ERROR([Old ABI no longer supported])])
+
+  # If the compiler enables unwind tables by default, this causes
+  # problems with undefined symbols in -nostdlib link tests.  To
+  # avoid this, add -fno-unwind-tables here and remove it in
+  # sysdeps/arm/configure.ac after those tests have been run.
+  if test "${CFLAGS+set}" != "set"; then
+    CFLAGS="-g -O2"
+  fi
+  CFLAGS="$CFLAGS -fno-unwind-tables"
 
   base_machine=arm
   # Lets ask the compiler which ARM family we've got
--- a/sysdeps/microblaze/nptl/tls.h
+++ b/sysdeps/microblaze/nptl/tls.h
@@ -99,7 +99,7 @@  static inline void *__microblaze_get_thread_area (void)
 /* Code to initially initialize the thread pointer.
    r21 is reserved for thread pointer.  */
 # define TLS_INIT_TP(tcbp) \
-  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); 0; })
+  ({ __asm __volatile ("or r21,r0,%0" : : "r" ((void *)tcbp)); NULL; })
 
 # define TLS_DEFINE_INIT_TP(tp, pd) void *tp = (pd) + 1
 
--- a/sysdeps/unix/sysv/linux/arm/configure
+++ /dev/null
@@ -1,9 +0,0 @@ 
-# This file is generated from configure.ac by Autoconf.  DO NOT EDIT!
- # Local configure fragment for sysdeps/unix/sysv/linux/arm.
-
-libc_cv_gcc_unwind_find_fde=no
-# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
-CFLAGS=${CFLAGS% -fno-unwind-tables}
-
-libc_cv_gcc_exceptions=yes
-exceptions=-fexceptions
--- a/sysdeps/unix/sysv/linux/arm/configure.ac
+++ /dev/null
@@ -1,12 +0,0 @@ 
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# Local configure fragment for sysdeps/unix/sysv/linux/arm.
-
-libc_cv_gcc_unwind_find_fde=no
-# Remove -fno-unwind-tables that was added in sysdeps/arm/preconfigure.ac.
-CFLAGS=${CFLAGS% -fno-unwind-tables}
-
-dnl The normal configure check for gcc -fexecptions fails because it can't
-dnl find __aeabi_unwind_cpp_pr0.  Work around this here; our GCC definitely
-dnl has -fexceptions.
-libc_cv_gcc_exceptions=yes
-exceptions=-fexceptions