From patchwork Fri Jul 4 01:49:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roland McGrath X-Patchwork-Id: 1913 Received: (qmail 16075 invoked by alias); 4 Jul 2014 01:49:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16035 invoked by uid 89); 4 Jul 2014 01:49:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: topped-with-meat.com MIME-Version: 1.0 From: Roland McGrath To: "GNU C. Library" Subject: [PATCH roland/arm] ARM: Clean up EABI-related configury Message-Id: <20140704014928.435BC2C3988@topped-with-meat.com> Date: Thu, 3 Jul 2014 18:49:28 -0700 (PDT) X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=SvUDtp+0 c=1 sm=1 tr=0 a=WkljmVdYkabdwxfqvArNOQ==:117 a=14OXPxybAAAA:8 a=UIRQXSLmNfsA:10 a=Z6MIti7PxpgA:10 a=kj9zAlcOel0A:10 a=hOe2yjtxAAAA:8 a=-oU4vrLrhx8hBJiiEjcA:9 a=CjuIK1q_8ugA:10 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 * 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