about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-04-06 16:26:32 -0500
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>2014-04-06 16:48:08 -0500
commit7ffa9423020fe331b45a56b804c95929a0398e8b (patch)
tree2db5161018046fbcf34bd145c5095765dec6f3c1 /sysdeps/unix/sysv/linux
parent8bd70862e11023e7f827f240a5a214f847ae982d (diff)
downloadglibc-7ffa9423020fe331b45a56b804c95929a0398e8b.tar.gz
glibc-7ffa9423020fe331b45a56b804c95929a0398e8b.tar.xz
glibc-7ffa9423020fe331b45a56b804c95929a0398e8b.zip
PowerPC: define _CALL_ELF if compiler does not
This patch makes the configure adds -D_CALL_ELF=1 when compiler does
not define _CALL_ELF (versions before powerpc64le support).  It cleans
up compiler warnings on old compiler where _CALL_ELF is not defined
on powerpc64(be) builds.

It does by add a new config.make variable for configure-deduced
CPPFLAGS and accumulate into that (confix-extra-cppflags).  It also
generalizes libc_extra_cflags so it accumulates in sysdeps configure
fragmenets.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/configure27
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac10
2 files changed, 37 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
index fbb6334a90..8262fdd530 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure
@@ -163,4 +163,31 @@ default-abi = 64-v2"
 else
   config_vars="$config_vars
 default-abi = 64-v1"
+  # Compiler that do not support ELFv2 ABI does not define _CALL_ELF
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the compiler defines _CALL_ELF" >&5
+$as_echo_n "checking whether the compiler defines _CALL_ELF... " >&6; }
+if ${libc_cv_ppc64_def_call_elf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef _CALL_ELF
+                         yes
+                       #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then :
+  libc_cv_ppc64_def_call_elf=yes
+else
+  libc_cv_ppc64_def_call_elf=no
+fi
+rm -f conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ppc64_def_call_elf" >&5
+$as_echo "$libc_cv_ppc64_def_call_elf" >&6; }
+  if test $libc_cv_ppc64_def_call_elf = no; then
+    libc_extra_cppflags="$libc_extra_cppflags -D_CALL_ELF=1"
+  fi
 fi
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
index c9cd4bc8fd..d60b05ef7f 100644
--- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
+++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac
@@ -12,4 +12,14 @@ if test $libc_cv_ppc64_elfv2_abi = yes; then
   LIBC_CONFIG_VAR([default-abi], [64-v2])
 else
   LIBC_CONFIG_VAR([default-abi], [64-v1])
+  # Compiler that do not support ELFv2 ABI does not define _CALL_ELF
+  AC_CACHE_CHECK([whether the compiler defines _CALL_ELF],
+    [libc_cv_ppc64_def_call_elf],
+    [AC_EGREP_CPP(yes,[#ifdef _CALL_ELF
+                         yes
+                       #endif
+    ], libc_cv_ppc64_def_call_elf=yes, libc_cv_ppc64_def_call_elf=no)])
+  if test $libc_cv_ppc64_def_call_elf = no; then
+    libc_extra_cppflags="$libc_extra_cppflags -D_CALL_ELF=1"
+  fi
 fi