From 44c4e5d598bfcbb309f05ceb7a57ab02662e7f34 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 13 Mar 2014 10:38:27 -0700 Subject: Use __ehdr_start, when available, for rtld to get its own headers. --- configure | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'configure') diff --git a/configure b/configure index fc023d0c70..3ee1848b30 100755 --- a/configure +++ b/configure @@ -7268,6 +7268,44 @@ if test $libc_cv_predef_stack_protector = yes; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker provides __ehdr_start" >&5 +$as_echo_n "checking whether the linker provides __ehdr_start... " >&6; } +if ${libc_cv_ehdr_start+:} false; then : + $as_echo_n "(cached) " >&6 +else + +old_CFLAGS="$CFLAGS" +old_LDFLAGS="$LDFLAGS" +old_LIBS="$LIBS" +CFLAGS="$CFLAGS -fPIC" +LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared" +LIBS= +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +extern const char __ehdr_start __attribute__ ((visibility ("hidden"))); +const char *ehdr (void) { return &__ehdr_start; } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + libc_cv_ehdr_start=yes +else + libc_cv_ehdr_start=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +CFLAGS="$old_CFLAGS" +LDFLAGS="$old_LDFLAGS" +LIBS="$old_LIBS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ehdr_start" >&5 +$as_echo "$libc_cv_ehdr_start" >&6; } +if test $libc_cv_ehdr_start = yes; then + $as_echo "#define HAVE_EHDR_START 1" >>confdefs.h + +fi + ### End of automated tests. ### Now run sysdeps configure fragments. -- cgit v1.2.3 From c66e48b4a704ab20c0a9e04e9237c62b9b5aedae Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 25 Jan 2014 00:39:31 -0500 Subject: delete ksh checks Nothing in the tree uses ksh anymore, so punt these checks. --- ChangeLog | 7 +++++++ config.make.in | 2 -- configure | 56 -------------------------------------------------------- configure.ac | 15 --------------- 4 files changed, 7 insertions(+), 73 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 64b93efed8..60eefba740 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-03-13 Mike Frysinger + + * config.make.in (have-ksh): Delete. + (KSH): Delete. + * configure.ac (libc_cv_have_ksh): Delete. + * configure: Regenerate. + 2014-03-13 Mike Frysinger * elf/Makefile: Delete $(have-ksh) check. diff --git a/config.make.in b/config.make.in index b5308d85b8..4ca250d3bf 100644 --- a/config.make.in +++ b/config.make.in @@ -74,7 +74,6 @@ multi-arch = @multi_arch@ mach-interface-list = @mach_interface_list@ have-bash2 = @libc_cv_have_bash2@ -have-ksh = @libc_cv_have_ksh@ sizeof-long-double = @sizeof_long_double@ @@ -125,7 +124,6 @@ MSGFMT = @MSGFMT@ # Script execution tools. BASH = @BASH_SHELL@ -KSH = @KSH@ AWK = @AWK@ PERL = @PERL@ diff --git a/configure b/configure index 3ee1848b30..1781860ab6 100755 --- a/configure +++ b/configure @@ -616,8 +616,6 @@ libc_cv_cc_with_libunwind BISON INSTALL_INFO PERL -libc_cv_have_ksh -KSH libc_cv_have_bash2 BASH_SHELL libc_cv_gcc_static_libgcc @@ -5329,60 +5327,6 @@ else fi -if test "$BASH_SHELL" = no; then - # Extract the first word of "ksh", so it can be a program name with args. -set dummy ksh; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_KSH+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $KSH in - [\\/]* | ?:[\\/]*) - ac_cv_path_KSH="$KSH" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_KSH="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_KSH" && ac_cv_path_KSH="no" - ;; -esac -fi -KSH=$ac_cv_path_KSH -if test -n "$KSH"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $KSH" >&5 -$as_echo "$KSH" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$KSH" = no; then - libc_cv_have_ksh=no - else - libc_cv_have_ksh=yes - fi -else - KSH="$BASH_SHELL" - - libc_cv_have_ksh=yes -fi - - # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/configure.ac b/configure.ac index 59dbb5e1b2..df3e177cdc 100644 --- a/configure.ac +++ b/configure.ac @@ -1108,21 +1108,6 @@ else fi AC_SUBST(libc_cv_have_bash2) -dnl We need a ksh compatible shell for tzselect. -if test "$BASH_SHELL" = no; then - AC_PATH_PROG(KSH, ksh, no) - if test "$KSH" = no; then - libc_cv_have_ksh=no - else - libc_cv_have_ksh=yes - fi -else - KSH="$BASH_SHELL" - AC_SUBST(KSH) - libc_cv_have_ksh=yes -fi -AC_SUBST(libc_cv_have_ksh) - AC_PATH_PROG(PERL, perl, no) if test "$PERL" != no && (eval `$PERL -V:apiversion`; test `expr "$apiversion" \< 5` -ne 0); then -- cgit v1.2.3 From 43ca83ecc482f34e002d5f0accfb4a7cef471e4a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 25 Jan 2014 00:44:37 -0500 Subject: stop supporting bash-1.x We've stopped supporting toolchain packages older than 2009, so punting bash-1.x is reasonable when bash-2 was released almost 20 years ago. --- ChangeLog | 12 ++++++++++++ config.make.in | 2 -- configure | 9 --------- configure.ac | 8 -------- elf/Makefile | 23 ++++++++--------------- 5 files changed, 20 insertions(+), 34 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 60eefba740..a9cff1d809 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2014-03-13 Mike Frysinger + + * config.make.in (have-bash2): Delete. + * configure.ac (libc_cv_have_bash2): Delete. + * configure: Regenerate. + * elf/Makefile (common-ldd-rewrite): Rename to ... + (ldd-rewrite): ... this. Move bash-ldd-rewrite content to end. + (sh-ldd-rewrite): Delete. + (bash-ldd-rewrite): Delete. + (have-bash2): Delete checks. + [ldd-rewrite-script]: Change $(ldd-shell)-ldd-rewrite to ldd-rewrite. + 2014-03-13 Mike Frysinger * config.make.in (have-ksh): Delete. diff --git a/config.make.in b/config.make.in index 4ca250d3bf..416fb9ef6c 100644 --- a/config.make.in +++ b/config.make.in @@ -73,8 +73,6 @@ multi-arch = @multi_arch@ mach-interface-list = @mach_interface_list@ -have-bash2 = @libc_cv_have_bash2@ - sizeof-long-double = @sizeof_long_double@ nss-crypt = @libc_cv_nss_crypt@ diff --git a/configure b/configure index 1781860ab6..d4b5edb636 100755 --- a/configure +++ b/configure @@ -616,7 +616,6 @@ libc_cv_cc_with_libunwind BISON INSTALL_INFO PERL -libc_cv_have_bash2 BASH_SHELL libc_cv_gcc_static_libgcc CXX_SYSINCLUDES @@ -5318,14 +5317,6 @@ $as_echo "no" >&6; } fi -if test "$BASH_SHELL" != no && - $BASH_SHELL -c 'test "$BASH_VERSINFO" \ - && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then - libc_cv_have_bash2=yes -else - libc_cv_have_bash2=no -fi - # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 diff --git a/configure.ac b/configure.ac index df3e177cdc..43bd8a5303 100644 --- a/configure.ac +++ b/configure.ac @@ -1099,14 +1099,6 @@ fi]) AC_SUBST(libc_cv_gcc_static_libgcc) AC_PATH_PROG(BASH_SHELL, bash, no) -if test "$BASH_SHELL" != no && - $BASH_SHELL -c 'test "$BASH_VERSINFO" \ - && test "$BASH_VERSINFO" -ge 2 >&/dev/null'; then - libc_cv_have_bash2=yes -else - libc_cv_have_bash2=no -fi -AC_SUBST(libc_cv_have_bash2) AC_PATH_PROG(PERL, perl, no) if test "$PERL" != no && diff --git a/elf/Makefile b/elf/Makefile index 8abc60b821..df138fc2d8 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -397,27 +397,20 @@ ldso_install: $(inst_rtlddir)/$(rtld-installed-name) endif -common-ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ - -e 's%@VERSION@%$(version)%g' \ - -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ - -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' -sh-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%/bin/sh%g;s/\$$"/"/g' -bash-ldd-rewrite = $(common-ldd-rewrite) -e 's%@BASH@%$(BASH)%g' \ - -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' - -ifneq ($(have-bash2),yes) -ldd-shell = sh -else -ldd-shell = bash -endif +ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \ + -e 's%@VERSION@%$(version)%g' \ + -e 's|@PKGVERSION@|$(PKGVERSION)|g' \ + -e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \ + -e 's%@BASH@%$(BASH)%g' \ + -e 's%@TEXTDOMAINDIR@%$(msgcatdir)%g' ifeq ($(ldd-rewrite-script),no) define gen-ldd -LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< > $@.new +LC_ALL=C sed $(ldd-rewrite) < $< > $@.new endef else define gen-ldd -LC_ALL=C sed $($(ldd-shell)-ldd-rewrite) < $< \ +LC_ALL=C sed $(ldd-rewrite) < $< \ | LC_ALL=C sed -f $(patsubst $(..)/%,/%,$(..)$(ldd-rewrite-script)) > $@.new endef endif -- cgit v1.2.3 From 7ffa9423020fe331b45a56b804c95929a0398e8b Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Sun, 6 Apr 2014 16:26:32 -0500 Subject: 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. --- ChangeLog | 14 +++++++++++ Makeconfig | 3 ++- config.make.in | 1 + configure | 8 +++++-- configure.ac | 7 ++++-- .../unix/sysv/linux/powerpc/powerpc64/configure | 27 ++++++++++++++++++++++ .../unix/sysv/linux/powerpc/powerpc64/configure.ac | 10 ++++++++ 7 files changed, 65 insertions(+), 5 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index faaea3ccc5..221a474da6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2014-04-06 Adhemerval Zanella + + * Makeconfig (CPPFLAGS): Add config-extra-cppflags to list. + * config.make.in (config-extra-cppflags): Set it from + libc_extra_cppflags. + * configure.ac (libc_extra_cflags): Make it accumulate over + configure fragments. + (libc_extra_cppflags): New flag. + * configure. Regenerate. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac + (libc_cv_ppc64_def_call_elf): Define it to yes if compiler does not set + _CALL_ELF and add -D_CALL_ELF=1 to libc_extra_cppflags. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: Regenerate. + 2014-04-06 Adhemerval Zanella [BZ #16815] diff --git a/Makeconfig b/Makeconfig index 3338ab698b..f9653983b6 100644 --- a/Makeconfig +++ b/Makeconfig @@ -792,7 +792,8 @@ libio-include = -I$(..)libio # Note that we can't use -std=* in CPPFLAGS, because it overrides # the implicit -lang-asm and breaks cpp behavior for .S files--notably # it causes cpp to stop predefining __ASSEMBLER__. -CPPFLAGS = $(CPPUNDEFS) $(CPPFLAGS-config) $($(subdir)-CPPFLAGS) \ +CPPFLAGS = $(config-extra-cppflags) $(CPPUNDEFS) $(CPPFLAGS-config) \ + $($(subdir)-CPPFLAGS) \ $(+includes) $(defines) \ -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \ $(CPPFLAGS-$(suffix $@)) \ diff --git a/config.make.in b/config.make.in index 416fb9ef6c..132d17920c 100644 --- a/config.make.in +++ b/config.make.in @@ -37,6 +37,7 @@ cflags-cpu = @libc_cv_cc_submachine@ asflags-cpu = @libc_cv_cc_submachine@ config-extra-cflags = @libc_extra_cflags@ +config-extra-cppflags = @libc_extra_cppflags@ config-cflags-nofma = @libc_cv_cc_nofma@ defines = @DEFINES@ diff --git a/configure b/configure index d4b5edb636..abefcdb521 100755 --- a/configure +++ b/configure @@ -591,6 +591,7 @@ libc_cv_slibdir old_glibc_headers use_nscd libc_cv_gcc_unwind_find_fde +libc_extra_cppflags libc_extra_cflags CPPUNDEFS sizeof_long_double @@ -7199,9 +7200,9 @@ fi $as_echo "$libc_cv_predef_stack_protector" >&6; } libc_extra_cflags= if test $libc_cv_predef_stack_protector = yes; then - libc_extra_cflags=-fno-stack-protector + libc_extra_cflags="$libc_extra_cflags -fno-stack-protector" fi - +libc_extra_cppflags= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker provides __ehdr_start" >&5 $as_echo_n "checking whether the linker provides __ehdr_start... " >&6; } @@ -7266,6 +7267,9 @@ $as_echo "running configure fragment for $dir" >&6; } fi done + + + if test x$libc_cv_gcc_unwind_find_fde = xyes; then $as_echo "#define EXPORT_UNWIND_FIND_FDE 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 43bd8a5303..629187232f 100644 --- a/configure.ac +++ b/configure.ac @@ -2042,9 +2042,9 @@ esac], ]) libc_extra_cflags= if test $libc_cv_predef_stack_protector = yes; then - libc_extra_cflags=-fno-stack-protector + libc_extra_cflags="$libc_extra_cflags -fno-stack-protector" fi -AC_SUBST(libc_extra_cflags) +libc_extra_cppflags= AC_CACHE_CHECK([whether the linker provides __ehdr_start], libc_cv_ehdr_start, [ @@ -2091,6 +2091,9 @@ for dir in $sysnames; do fi done +AC_SUBST(libc_extra_cflags) +AC_SUBST(libc_extra_cppflags) + if test x$libc_cv_gcc_unwind_find_fde = xyes; then AC_DEFINE(EXPORT_UNWIND_FIND_FDE) fi 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 -- cgit v1.2.3 From 0699f766b10c86912b75f35bef697106b70c1cf6 Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Thu, 10 Apr 2014 18:31:53 -0400 Subject: nscd: Make SELinux checks dynamic. The SELinux team has indicated to me that glibc's SELinux checks in nscd are not being carried out as they would expect the API to be used today. They would like to move away from static header defines for class and permissions and instead use dynamic checks at runtime that provide an answer which is dependent on the runtime status of SELinux i.e. more dynamic. The following patch is a minimal change that moves us forward in this direction. It does the following: * Stop checking for SELinux headers that define NSCD__SHMEMHOST. Check only for the presence or absence of the library. * Don't encode the specific SELinux permission constants into a table at build time, and instead use the symbolic name for the permission as expected. * Lookup the "What do we do if we don't know this permission?" policy and use that if we find SELinux's policy is older than the glibc policy e.g. we make a request for a permission that SELinux doesn't know about. * Lastly, translate the class and permission and then make the permission check. This is done every time we lookup a permission, and this is the expected way to use the API. SELinux will optimize this for us, and we expect the network latencies to hide these extra library calls. Tested on x86, x86-64, and via Fedora Rawhide since November 2013. See: https://sourceware.org/ml/libc-alpha/2014-04/msg00179.html --- ChangeLog | 10 ++++++ configure | 31 +---------------- configure.ac | 15 +------- nscd/selinux.c | 107 ++++++++++++++++++++++++++++++++++++--------------------- 4 files changed, 80 insertions(+), 83 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 431c7c0ddf..77fc36e4ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-04-14 Carlos O'Donell + + * configure.ac: Remove SELinux header check. + * configure: Regenerate. + * nscd/selinux.c (perms): Array of const char* to permission names. + (nscd_request_avc_has_perm): Call security_deny_unknown to find + default policy. Call string_to_security_class and string_to_av_perm to + translate strings. Enforce default policy and call avs_has_perm with + results of translated strings. + 2014-04-13 David S. Miller * sysdeps/sparc/fpu/libm-test-ulps: Update. diff --git a/configure b/configure index abefcdb521..8b0b22241d 100755 --- a/configure +++ b/configure @@ -6938,38 +6938,9 @@ else have_selinux=no fi - # See if we have the SELinux header with the NSCD permissions in it. - if test x$have_selinux = xyes ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NSCD Flask permissions in selinux/av_permissions.h" >&5 -$as_echo_n "checking for NSCD Flask permissions in selinux/av_permissions.h... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -#ifdef NSCD__SHMEMHOST - return 0; - #else - #error NSCD__SHMEMHOST not defined - #endif - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - have_selinux=yes -else - have_selinux=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_selinux" >&5 -$as_echo "$have_selinux" >&6; } - fi - if test x$with_selinux = xyes ; then if test x$have_selinux = xno ; then - as_fn_error $? "SELinux explicitly required, but sufficiently recent SELinux library not found" "$LINENO" 5 + as_fn_error $? "SELinux explicitly required, but SELinux library not found" "$LINENO" 5 fi fi fi diff --git a/configure.ac b/configure.ac index 629187232f..97a959114d 100644 --- a/configure.ac +++ b/configure.ac @@ -1945,22 +1945,9 @@ else # See if we have the SELinux library AC_CHECK_LIB(selinux, is_selinux_enabled, have_selinux=yes, have_selinux=no) - # See if we have the SELinux header with the NSCD permissions in it. - if test x$have_selinux = xyes ; then - AC_MSG_CHECKING([for NSCD Flask permissions in selinux/av_permissions.h]) - AC_TRY_COMPILE([#include ], - [#ifdef NSCD__SHMEMHOST - return 0; - #else - #error NSCD__SHMEMHOST not defined - #endif], - have_selinux=yes, have_selinux=no) - AC_MSG_RESULT($have_selinux) - fi - if test x$with_selinux = xyes ; then if test x$have_selinux = xno ; then - AC_MSG_ERROR([SELinux explicitly required, but sufficiently recent SELinux library not found]) + AC_MSG_ERROR([SELinux explicitly required, but SELinux library not found]) fi fi fi diff --git a/nscd/selinux.c b/nscd/selinux.c index 46b0ea9779..9a8a5a86d3 100644 --- a/nscd/selinux.c +++ b/nscd/selinux.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -44,35 +43,31 @@ /* Global variable to tell if the kernel has SELinux support. */ int selinux_enabled; -/* Define mappings of access vector permissions to request types. */ -static const access_vector_t perms[LASTREQ] = +/* Define mappings of request type to AVC permission name. */ +static const char *perms[LASTREQ] = { - [GETPWBYNAME] = NSCD__GETPWD, - [GETPWBYUID] = NSCD__GETPWD, - [GETGRBYNAME] = NSCD__GETGRP, - [GETGRBYGID] = NSCD__GETGRP, - [GETHOSTBYNAME] = NSCD__GETHOST, - [GETHOSTBYNAMEv6] = NSCD__GETHOST, - [GETHOSTBYADDR] = NSCD__GETHOST, - [GETHOSTBYADDRv6] = NSCD__GETHOST, - [GETSTAT] = NSCD__GETSTAT, - [SHUTDOWN] = NSCD__ADMIN, - [INVALIDATE] = NSCD__ADMIN, - [GETFDPW] = NSCD__SHMEMPWD, - [GETFDGR] = NSCD__SHMEMGRP, - [GETFDHST] = NSCD__SHMEMHOST, - [GETAI] = NSCD__GETHOST, - [INITGROUPS] = NSCD__GETGRP, -#ifdef NSCD__GETSERV - [GETSERVBYNAME] = NSCD__GETSERV, - [GETSERVBYPORT] = NSCD__GETSERV, - [GETFDSERV] = NSCD__SHMEMSERV, -#endif -#ifdef NSCD__GETNETGRP - [GETNETGRENT] = NSCD__GETNETGRP, - [INNETGR] = NSCD__GETNETGRP, - [GETFDNETGR] = NSCD__SHMEMNETGRP, -#endif + [GETPWBYNAME] = "getpwd", + [GETPWBYUID] = "getpwd", + [GETGRBYNAME] = "getgrp", + [GETGRBYGID] = "getgrp", + [GETHOSTBYNAME] = "gethost", + [GETHOSTBYNAMEv6] = "gethost", + [GETHOSTBYADDR] = "gethost", + [GETHOSTBYADDRv6] = "gethost", + [SHUTDOWN] = "admin", + [GETSTAT] = "getstat", + [INVALIDATE] = "admin", + [GETFDPW] = "shmempwd", + [GETFDGR] = "shmemgrp", + [GETFDHST] = "shmemhost", + [GETAI] = "gethost", + [INITGROUPS] = "getgrp", + [GETSERVBYNAME] = "getserv", + [GETSERVBYPORT] = "getserv", + [GETFDSERV] = "shmemserv", + [GETNETGRENT] = "getnetgrp", + [INNETGR] = "getnetgrp", + [GETFDNETGR] = "shmemnetgrp", }; /* Store an entry ref to speed AVC decisions. */ @@ -344,7 +339,16 @@ nscd_avc_init (void) /* Check the permission from the caller (via getpeercon) to nscd. - Returns 0 if access is allowed, 1 if denied, and -1 on error. */ + Returns 0 if access is allowed, 1 if denied, and -1 on error. + + The SELinux policy, enablement, and permission bits are all dynamic and the + caching done by glibc is not entirely correct. This nscd support should be + rewritten to use selinux_check_permission. A rewrite is risky though and + requires some refactoring. Currently we use symbolic mappings instead of + compile time constants (which SELinux upstream says are going away), and we + use security_deny_unknown to determine what to do if selinux-policy* doesn't + have a definition for the the permission or object class we are looking + up. */ int nscd_request_avc_has_perm (int fd, request_type req) { @@ -354,6 +358,33 @@ nscd_request_avc_has_perm (int fd, request_type req) security_id_t ssid = NULL; security_id_t tsid = NULL; int rc = -1; + security_class_t sc_nscd; + access_vector_t perm; + int avc_deny_unknown; + + /* Check if SELinux denys or allows unknown object classes + and permissions. It is 0 if they are allowed, 1 if they + are not allowed and -1 on error. */ + if ((avc_deny_unknown = security_deny_unknown ()) == -1) + dbg_log (_("Error querying policy for undefined object classes " + "or permissions.")); + + /* Get the security class for nscd. If this fails we will likely be + unable to do anything unless avc_deny_unknown is 0. */ + sc_nscd = string_to_security_class ("nscd"); + if (perm == 0 && avc_deny_unknown == 1) + dbg_log (_("Error getting security class for nscd.")); + + /* Convert permission to AVC bits. */ + perm = string_to_av_perm (sc_nscd, perms[req]); + if (perm == 0 && avc_deny_unknown == 1) + dbg_log (_("Error translating permission name " + "\"%s\" to access vector bit."), perms[req]); + + /* If the nscd security class was not found or perms were not + found and AVC does not deny unknown values then allow it. */ + if ((sc_nscd == 0 || perm == 0) && avc_deny_unknown == 0) + return 0; if (getpeercon (fd, &scon) < 0) { @@ -372,15 +403,13 @@ nscd_request_avc_has_perm (int fd, request_type req) goto out; } -#ifndef NSCD__GETSERV - if (perms[req] == 0) - { - dbg_log (_("compile-time support for database policy missing")); - goto out; - } -#endif - - rc = avc_has_perm (ssid, tsid, SECCLASS_NSCD, perms[req], &aeref, NULL) < 0; + /* The SELinux API for avc_has_perm conflates access denied and error into + the return code -1, while nscd_request_avs_has_perm has distinct error + (-1) and denied (1) return codes. We map the avc_has_perm access denied or + error into an access denied at the nscd interface level (we do accurately + report error for the getpeercon, getcon, and avc_context_to_sid interfaces + used above). */ + rc = avc_has_perm (ssid, tsid, sc_nscd, perm, &aeref, NULL) < 0; out: if (scon) -- cgit v1.2.3 From 5a414ff70c3a45e52b5f5c0741bd459a84cf56b8 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Fri, 9 May 2014 16:58:46 +0200 Subject: S/390: Port of lock elision to System/z Added support for TX lock elision of pthread mutexes on s390 and s390x. This may improve lock scaling of existing programs on TX capable systems. The lock elision code is only built with --enable-lock-elision=yes and then requires a GCC version supporting the TX builtins. With lock elision default mutexes are elided via __builtin_tbegin, if the cpu supports transactions. By default lock elision is not enabled and the elision code is not built. --- ChangeLog | 35 ++++++ NEWS | 8 ++ config.make.in | 1 + configure | 2 + configure.ac | 1 + nptl/sysdeps/unix/sysv/linux/s390/Makefile | 10 ++ .../unix/sysv/linux/s390/bits/pthreadtypes.h | 25 ++++- nptl/sysdeps/unix/sysv/linux/s390/elision-conf.c | 82 ++++++++++++++ nptl/sysdeps/unix/sysv/linux/s390/elision-conf.h | 44 ++++++++ nptl/sysdeps/unix/sysv/linux/s390/elision-lock.c | 119 +++++++++++++++++++++ nptl/sysdeps/unix/sysv/linux/s390/elision-timed.c | 26 +++++ .../sysdeps/unix/sysv/linux/s390/elision-trylock.c | 94 ++++++++++++++++ nptl/sysdeps/unix/sysv/linux/s390/elision-unlock.c | 38 +++++++ nptl/sysdeps/unix/sysv/linux/s390/force-elision.h | 33 ++++++ nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | 27 +++++ .../unix/sysv/linux/s390/pthread_mutex_cond_lock.c | 22 ++++ .../unix/sysv/linux/s390/pthread_mutex_lock.c | 22 ++++ .../unix/sysv/linux/s390/pthread_mutex_timedlock.c | 22 ++++ .../unix/sysv/linux/s390/pthread_mutex_trylock.c | 22 ++++ sysdeps/s390/configure | 36 +++++++ sysdeps/s390/configure.ac | 26 +++++ 21 files changed, 693 insertions(+), 2 deletions(-) create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/Makefile create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/elision-conf.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/elision-conf.h create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/elision-lock.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/elision-timed.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/elision-trylock.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/elision-unlock.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/force-elision.h create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c create mode 100644 nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index cd9dec29c9..a64ca9f269 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2014-05-09 Dominik Vogt + Stefan Liebler + + * config.make.in (enable-lock-elision): New Makefile variable. + * configure.ac: Likewise. + * configure: Regenerate. + * sysdeps/s390/configure.ac: + Add check for gcc transactions support. + * sysdeps/s390/configure: Regenerate. + * nptl/sysdeps/unix/sysv/linux/s390/Makefile: New file. + Build elision files if enabled. + * nptl/sysdeps/unix/sysv/linux/s390/elision-conf.c: New file. + Add lock elision support for s390. + * nptl/sysdeps/unix/sysv/linux/s390/elision-conf.h: Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/elision-lock.c: Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/elision-timed.c: Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/elision-trylock.c: Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/elision-unlock.c: Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/force-elision.h: Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c: + Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c: + Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c: + Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c: + Likewise. + * nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h: + (__lll_timedlock_elision, __lll_lock_elision) + (__lll_unlock_elision, __lll_trylock_elision) + (lll_timedlock_elision, lll_lock_elision) + (lll_unlock_elision, lll_trylock_elision): Add. + * nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h + (pthread_mutex_t): Add lock elision support for s390. + 2014-05-09 Will Newton * sysdeps/arm/armv7/strcmp.S: New file. diff --git a/NEWS b/NEWS index 40068712dc..fae2b82607 100644 --- a/NEWS +++ b/NEWS @@ -40,6 +40,14 @@ Version 2.20 test macros defined. * Optimized strcmp implementation for ARMv7. Contributed by ARM Ltd. + +* Added support for TX lock elision of pthread mutexes on s390 and s390x. + This may improve lock scaling of existing programs on TX capable systems. + The lock elision code is only built with --enable-lock-elision=yes and + then requires a GCC version supporting the TX builtins. With lock elision + default mutexes are elided via __builtin_tbegin, if the cpu supports + transactions. By default lock elision is not enabled and the elision code + is not built. Version 2.19 diff --git a/config.make.in b/config.make.in index 132d17920c..6bcab8adb1 100644 --- a/config.make.in +++ b/config.make.in @@ -93,6 +93,7 @@ build-nscd = @build_nscd@ use-nscd = @use_nscd@ build-hardcoded-path-in-tests= @hardcoded_path_in_tests@ build-pt-chown = @build_pt_chown@ +enable-lock-elision = @enable_lock_elision@ # Build tools. CC = @CC@ diff --git a/configure b/configure index 8b0b22241d..ecc282bd2e 100755 --- a/configure +++ b/configure @@ -651,6 +651,7 @@ libc_cv_nss_crypt all_warnings force_install bindnow +enable_lock_elision hardcoded_path_in_tests oldest_abi use_default_link @@ -3476,6 +3477,7 @@ else enable_lock_elision=no fi + if test "$enable_lock_elision" = yes ; then $as_echo "#define ENABLE_LOCK_ELISION 1" >>confdefs.h diff --git a/configure.ac b/configure.ac index 97a959114d..babfe5713c 100644 --- a/configure.ac +++ b/configure.ac @@ -184,6 +184,7 @@ AC_ARG_ENABLE([lock-elision], [Enable lock elision for pthread mutexes by default]), [enable_lock_elision=$enableval], [enable_lock_elision=no]) +AC_SUBST(enable_lock_elision) if test "$enable_lock_elision" = yes ; then AC_DEFINE(ENABLE_LOCK_ELISION) fi diff --git a/nptl/sysdeps/unix/sysv/linux/s390/Makefile b/nptl/sysdeps/unix/sysv/linux/s390/Makefile new file mode 100644 index 0000000000..269832f999 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/Makefile @@ -0,0 +1,10 @@ +ifeq ($(enable-lock-elision),yes) +libpthread-sysdep_routines += elision-lock elision-unlock elision-timed \ + elision-trylock + +elision-CFLAGS = -mhtm +CFLAGS-elision-lock.c = $(elision-CFLAGS) +CFLAGS-elision-timed.c = $(elision-CFLAGS) +CFLAGS-elision-trylock.c = $(elision-CFLAGS) +CFLAGS-elision-unlock.c = $(elision-CFLAGS) +endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h index 8264de0591..d70f8b35b1 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h @@ -89,14 +89,37 @@ typedef union binary compatibility. */ int __kind; #if __WORDSIZE == 64 +# ifdef ENABLE_LOCK_ELISION + short __spins; + short __elision; + /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +# define __PTHREAD_SPINS 0, 0 +# else int __spins; + /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +# define __PTHREAD_SPINS 0 +# endif __pthread_list_t __list; # define __PTHREAD_MUTEX_HAVE_PREV 1 #else unsigned int __nusers; __extension__ union { +# ifdef ENABLE_LOCK_ELISION + struct + { + short __espins; + short __elision; + } _d; +# define __spins _d.__espins +# define __elision _d.__elision + /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +# define __PTHREAD_SPINS { 0, 0 } +# else int __spins; + /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ +# define __PTHREAD_SPINS 0 +# endif __pthread_slist_t __list; }; #endif @@ -105,8 +128,6 @@ typedef union long int __align; } pthread_mutex_t; -/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER. */ -#define __PTHREAD_SPINS 0 typedef union { diff --git a/nptl/sysdeps/unix/sysv/linux/s390/elision-conf.c b/nptl/sysdeps/unix/sysv/linux/s390/elision-conf.c new file mode 100644 index 0000000000..69c04836ed --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/elision-conf.c @@ -0,0 +1,82 @@ +/* Lock elision tunable parameters. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include + +/* Reasonable initial tuning values, may be revised in the future. + This is a conservative initial value. */ + +struct elision_config __elision_aconf = + { + /* How often to not attempt to use elision if a transaction aborted + because the lock is already acquired. Expressed in number of lock + acquisition attempts. */ + .skip_lock_busy = 3, + /* How often to not attempt to use elision if a transaction aborted due + to reasons other than other threads' memory accesses. Expressed in + number of lock acquisition attempts. */ + .skip_lock_internal_abort = 3, + /* How often to not attempt to use elision if a lock used up all retries + without success. Expressed in number of lock acquisition attempts. */ + .skip_lock_out_of_tbegin_retries = 3, + /* How often we try using elision if there is chance for the transaction + to finish execution (e.g., it wasn't aborted due to the lock being + already acquired. */ + .try_tbegin = 3, + /* Same as SKIP_LOCK_INTERNAL_ABORT but for trylock. */ + .skip_trylock_internal_abort = 3, + }; + +/* Force elision for all new locks. This is used to decide whether existing + DEFAULT locks should be automatically upgraded to elision in + pthread_mutex_lock(). Disabled for suid programs. Only used when elision + is available. */ + +int __pthread_force_elision attribute_hidden = 0; + +/* Initialize elison. */ + +static void +elision_init (int argc __attribute__ ((unused)), + char **argv __attribute__ ((unused)), + char **environ) +{ + /* Set when the CPU and the kernel supports transactional execution. + When false elision is never attempted. */ + int elision_available = (GLRO (dl_hwcap) & HWCAP_S390_TE) ? 1 : 0; + + __pthread_force_elision = __libc_enable_secure ? 0 : elision_available; +} + +#ifdef SHARED +# define INIT_SECTION ".init_array" +# define MAYBE_CONST +#else +# define INIT_SECTION ".preinit_array" +# define MAYBE_CONST const +#endif + +void (*MAYBE_CONST __pthread_init_array []) (int, char **, char **) + __attribute__ ((section (INIT_SECTION), aligned (sizeof (void *)))) = +{ + &elision_init +}; diff --git a/nptl/sysdeps/unix/sysv/linux/s390/elision-conf.h b/nptl/sysdeps/unix/sysv/linux/s390/elision-conf.h new file mode 100644 index 0000000000..d9e97947a0 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/elision-conf.h @@ -0,0 +1,44 @@ +/* Lock elision tunable parameters. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ +#ifdef ENABLE_LOCK_ELISION +#ifndef _ELISION_CONF_H +#define _ELISION_CONF_H 1 + +#include +#include + +/* Should make sure there is no false sharing on this. */ + +struct elision_config +{ + int skip_lock_busy; + int skip_lock_internal_abort; + int skip_lock_out_of_tbegin_retries; + int try_tbegin; + int skip_trylock_internal_abort; +}; + +extern struct elision_config __elision_aconf attribute_hidden; + +extern int __pthread_force_elision attribute_hidden; + +/* Tell the test suite to test elision for this architecture. */ +#define HAVE_ELISION 1 + +#endif +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/elision-lock.c b/nptl/sysdeps/unix/sysv/linux/s390/elision-lock.c new file mode 100644 index 0000000000..ba5338fbb9 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/elision-lock.c @@ -0,0 +1,119 @@ +/* Elided pthread mutex lock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include +#include + +#if !defined(LLL_LOCK) && !defined(EXTRAARG) +/* Make sure the configuration code is always linked in for static + libraries. */ +#include "elision-conf.c" +#endif + +#ifndef EXTRAARG +#define EXTRAARG +#endif +#ifndef LLL_LOCK +#define LLL_LOCK(a,b) lll_lock(a,b), 0 +#endif + +#define aconf __elision_aconf + +/* Adaptive lock using transactions. + By default the lock region is run as a transaction, and when it + aborts or the lock is busy the lock adapts itself. */ + +int +__lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private) +{ + if (*adapt_count > 0) + { + /* Lost updates are possible, but harmless. Due to races this might lead + to *adapt_count becoming less than zero. */ + (*adapt_count)--; + goto use_lock; + } + + __asm__ volatile (".machinemode \"zarch_nohighgprs\"\n\t" + ".machine \"all\"" + : : : "memory"); + + int try_tbegin; + for (try_tbegin = aconf.try_tbegin; + try_tbegin > 0; + try_tbegin--) + { + unsigned status; + if (__builtin_expect + ((status = __builtin_tbegin((void *)0)) == _HTM_TBEGIN_STARTED, 1)) + { + if (*futex == 0) + return 0; + /* Lock was busy. Fall back to normal locking. */ + if (__builtin_expect (__builtin_tx_nesting_depth (), 1)) + { + /* In a non-nested transaction there is no need to abort, + which is expensive. */ + __builtin_tend (); + if (aconf.skip_lock_busy > 0) + *adapt_count = aconf.skip_lock_busy; + goto use_lock; + } + else /* nesting depth is > 1 */ + { + /* A nested transaction will abort eventually because it + cannot make any progress before *futex changes back to 0. + So we may as well abort immediately. + This persistently aborts the outer transaction to force + the outer mutex use the default lock instead of retrying + with transactions until the try_tbegin of the outer mutex + is zero. + The adapt_count of this inner mutex is not changed, + because using the default lock with the inner mutex + would abort the outer transaction. + */ + __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE | 1); + } + } + else + { + if (status != _HTM_TBEGIN_TRANSIENT) + { + /* A persistent abort (cc 1 or 3) indicates that a retry is + probably futile. Use the normal locking now and for the + next couple of calls. + Be careful to avoid writing to the lock. */ + if (aconf.skip_lock_internal_abort > 0) + *adapt_count = aconf.skip_lock_internal_abort; + goto use_lock; + } + } + } + + /* Same logic as above, but for for a number of temporary failures in a + row. */ + if (aconf.skip_lock_out_of_tbegin_retries > 0 && aconf.try_tbegin > 0) + *adapt_count = aconf.skip_lock_out_of_tbegin_retries; + + use_lock: + return LLL_LOCK ((*futex), private); +} diff --git a/nptl/sysdeps/unix/sysv/linux/s390/elision-timed.c b/nptl/sysdeps/unix/sysv/linux/s390/elision-timed.c new file mode 100644 index 0000000000..a8d8b2a348 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/elision-timed.c @@ -0,0 +1,26 @@ +/* Lock elision timed lock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#define __lll_lock_elision __lll_timedlock_elision +#define EXTRAARG const struct timespec *t, +#undef LLL_LOCK +#define LLL_LOCK(a, b) lll_timedlock(a, t, b) +#include "elision-lock.c" diff --git a/nptl/sysdeps/unix/sysv/linux/s390/elision-trylock.c b/nptl/sysdeps/unix/sysv/linux/s390/elision-trylock.c new file mode 100644 index 0000000000..61447d6bf4 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/elision-trylock.c @@ -0,0 +1,94 @@ +/* Elided pthread mutex trylock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include +#include +#include +#include + +#define aconf __elision_aconf + +/* Try to elide a futex trylock. FUTEX is the futex variable. ADAPT_COUNT is + the adaptation counter in the mutex. */ + +int +__lll_trylock_elision (int *futex, short *adapt_count) +{ + __asm__ volatile (".machinemode \"zarch_nohighgprs\"\n\t" + ".machine \"all\"" + : : : "memory"); + + /* Implement POSIX semantics by forbiding nesting elided trylocks. + Sorry. After the abort the code is re-executed + non transactional and if the lock was already locked + return an error. */ + if (__builtin_tx_nesting_depth () > 0) + { + /* Note that this abort may terminate an outermost transaction that + was created outside glibc. + This persistently aborts the current transactions to force + them to use the default lock instead of retrying transactions + until their try_tbegin is zero. + */ + __builtin_tabort (_HTM_FIRST_USER_ABORT_CODE | 1); + } + + /* Only try a transaction if it's worth it. */ + if (*adapt_count <= 0) + { + unsigned status; + + if (__builtin_expect + ((status = __builtin_tbegin ((void *)0)) == _HTM_TBEGIN_STARTED, 1)) + { + if (*futex == 0) + return 0; + /* Lock was busy. Fall back to normal locking. */ + /* Since we are in a non-nested transaction there is no need to abort, + which is expensive. */ + __builtin_tend (); + /* Note: Changing the adapt_count here might abort a transaction on a + different cpu, but that could happen anyway when the futex is + acquired, so there's no need to check the nesting depth here. */ + if (aconf.skip_lock_busy > 0) + *adapt_count = aconf.skip_lock_busy; + } + else + { + if (status != _HTM_TBEGIN_TRANSIENT) + { + /* A persistent abort (cc 1 or 3) indicates that a retry is + probably futile. Use the normal locking now and for the + next couple of calls. + Be careful to avoid writing to the lock. */ + if (aconf.skip_trylock_internal_abort > 0) + *adapt_count = aconf.skip_trylock_internal_abort; + } + } + /* Could do some retries here. */ + } + else + { + /* Lost updates are possible, but harmless. Due to races this might lead + to *adapt_count becoming less than zero. */ + (*adapt_count)--; + } + + return lll_trylock (*futex); +} diff --git a/nptl/sysdeps/unix/sysv/linux/s390/elision-unlock.c b/nptl/sysdeps/unix/sysv/linux/s390/elision-unlock.c new file mode 100644 index 0000000000..9ceae3ee1e --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/elision-unlock.c @@ -0,0 +1,38 @@ +/* Commit an elided pthread lock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +int +__lll_unlock_elision(int *futex, int private) +{ + /* If the lock is free, we elided the lock earlier. This does not + necessarily mean that we are in a transaction, because the user code may + have closed the transaction, but that is impossible to detect reliably. */ + if (*futex == 0) + { + __asm__ volatile (".machinemode \"zarch_nohighgprs\"\n\t" + ".machine \"all\"" + : : : "memory"); + __builtin_tend(); + } + else + lll_unlock ((*futex), private); + return 0; +} diff --git a/nptl/sysdeps/unix/sysv/linux/s390/force-elision.h b/nptl/sysdeps/unix/sysv/linux/s390/force-elision.h new file mode 100644 index 0000000000..8fd7684d9a --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/force-elision.h @@ -0,0 +1,33 @@ +/* Automatic enabling of elision for mutexes + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifdef ENABLE_LOCK_ELISION +/* Check for elision on this lock without upgrading. */ +#define DO_ELISION(m) \ + (__pthread_force_elision \ + && (m->__data.__kind & PTHREAD_MUTEX_NO_ELISION_NP) == 0) \ + +/* Automatically enable elision for existing user lock kinds. */ +#define FORCE_ELISION(m, s) \ + if (__pthread_force_elision \ + && (m->__data.__kind & PTHREAD_MUTEX_ELISION_FLAGS_NP) == 0) \ + { \ + mutex->__data.__kind |= PTHREAD_MUTEX_ELISION_NP; \ + s; \ + } +#endif diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h index 864dcbccc0..cabff30be9 100644 --- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h +++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h @@ -285,6 +285,15 @@ __lll_timedlock (int *futex, const struct timespec *abstime, int private) #define lll_timedlock(futex, abstime, private) \ __lll_timedlock (&(futex), abstime, private) +#ifdef ENABLE_LOCK_ELISION +extern int __lll_timedlock_elision + (int *futex, short *adapt_count, const struct timespec *timeout, int private) + attribute_hidden; + +# define lll_timedlock_elision(futex, adapt_count, timeout, private) \ + __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private) +#endif + static inline int __attribute__ ((always_inline)) __lll_robust_timedlock (int *futex, const struct timespec *abstime, @@ -360,4 +369,22 @@ extern int __lll_timedwait_tid (int *, const struct timespec *) __res; \ }) +#ifdef ENABLE_LOCK_ELISION +extern int __lll_lock_elision (int *futex, short *adapt_count, int private) + attribute_hidden; + +extern int __lll_unlock_elision(int *futex, int private) + attribute_hidden; + +extern int __lll_trylock_elision(int *futex, short *adapt_count) + attribute_hidden; + +# define lll_lock_elision(futex, adapt_count, private) \ + __lll_lock_elision (&(futex), &(adapt_count), private) +# define lll_unlock_elision(futex, private) \ + __lll_unlock_elision (&(futex), private) +# define lll_trylock_elision(futex, adapt_count) \ + __lll_trylock_elision(&(futex), &(adapt_count)) +#endif + #endif /* lowlevellock.h */ diff --git a/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c new file mode 100644 index 0000000000..6fc0f969ef --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_cond_lock.c @@ -0,0 +1,22 @@ +/* Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* The cond lock is not actually elided yet, but we still need to handle + already elided locks. */ +#include + +#include diff --git a/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c new file mode 100644 index 0000000000..6fd6a9866f --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_lock.c @@ -0,0 +1,22 @@ +/* Elided version of pthread_mutex_lock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +#include diff --git a/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c new file mode 100644 index 0000000000..d0e6537ecc --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_timedlock.c @@ -0,0 +1,22 @@ +/* Elided version of pthread_mutex_timedlock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +#include diff --git a/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c new file mode 100644 index 0000000000..ea8a8fff93 --- /dev/null +++ b/nptl/sysdeps/unix/sysv/linux/s390/pthread_mutex_trylock.c @@ -0,0 +1,22 @@ +/* Elided version of pthread_mutex_trylock. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +#include diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index c2d05f7b4a..6948cc2190 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -68,5 +68,41 @@ if test $ac_verc_fail = yes; then fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_tbegin" >&5 +$as_echo_n "checking for __builtin_tbegin... " >&6; } +if ${libc_cv_gcc_builtin_tbegin+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <<\EOF +#include +void testtransaction () +{ + if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED) + { + __builtin_tend (); + } +} +EOF +if { ac_try='${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null' + { { 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 + libc_cv_gcc_builtin_tbegin=yes +else + libc_cv_gcc_builtin_tbegin=no +fi +rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_gcc_builtin_tbegin" >&5 +$as_echo "$libc_cv_gcc_builtin_tbegin" >&6; } + +if test "$enable_lock_elision" = yes && test "$libc_cv_gcc_builtin_tbegin" = no ; then + critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390." +fi + test -n "$critic_missing" && as_fn_error $? " *** $critic_missing" "$LINENO" 5 diff --git a/sysdeps/s390/configure.ac b/sysdeps/s390/configure.ac index 59cfdd132a..493e9a469c 100644 --- a/sysdeps/s390/configure.ac +++ b/sysdeps/s390/configure.ac @@ -10,5 +10,31 @@ AC_CHECK_PROG_VER(AS, $AS, --version, [GNU assembler.* \([0-9]*\.[0-9.]*\)], [2.2[4-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], critic_missing="$critic_missing The program AS is required in version >= 2.24 for target S390.") + +AC_CACHE_CHECK(for __builtin_tbegin, libc_cv_gcc_builtin_tbegin, [dnl +cat > conftest.c <<\EOF +#include +void testtransaction () +{ + if (__builtin_tbegin (0) == _HTM_TBEGIN_STARTED) + { + __builtin_tend (); + } +} +EOF +dnl +dnl test, if the tbegin instruction is used by __builtin_tbegin +if AC_TRY_COMMAND([${CC-cc} -mhtm -O2 -S conftest.c -o - | grep -w tbegin > /dev/null]) ; +then + libc_cv_gcc_builtin_tbegin=yes +else + libc_cv_gcc_builtin_tbegin=no +fi +rm -f conftest* ]) + +if test "$enable_lock_elision" = yes && test "$libc_cv_gcc_builtin_tbegin" = no ; then + critic_missing="$critic_missing The used GCC has no support for __builtin_tbegin, which is needed for lock-elision on target S390." +fi + test -n "$critic_missing" && AC_MSG_ERROR([ *** $critic_missing]) -- cgit v1.2.3 From 3e239be647036760563e62639ea574a2c55b9191 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 25 Jun 2014 17:52:56 +0000 Subject: Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments. This patch makes non-ex-ports architectures set base_machine and machine based on the original configured machine value in preconfigure fragments, like ex-ports architectures, rather than in the toplevel configure.ac. Tested x86 that the disassembly of installed shared libraries is unchanged by the patch. * configure.ac (base_machine): Do not set specially for particular machines here. * configure: Regenerated. * sysdeps/powerpc/preconfigure: Move machine and base_machine settings from configure.ac. * sysdeps/i386/preconfigure: New file. * sysdeps/s390/preconfigure: Likewise. * sysdeps/sh/preconfigure: Likewise. * sysdeps/sparc/preconfigure: Likewise. --- ChangeLog | 12 ++++++++++++ configure | 35 ++--------------------------------- configure.ac | 38 ++------------------------------------ sysdeps/i386/preconfigure | 5 +++++ sysdeps/powerpc/preconfigure | 10 ++++++++-- sysdeps/s390/preconfigure | 6 ++++++ sysdeps/sh/preconfigure | 6 ++++++ sysdeps/sparc/preconfigure | 24 ++++++++++++++++++++++++ 8 files changed, 65 insertions(+), 71 deletions(-) create mode 100644 sysdeps/i386/preconfigure create mode 100644 sysdeps/s390/preconfigure create mode 100644 sysdeps/sh/preconfigure create mode 100644 sysdeps/sparc/preconfigure (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 94a1f40b4f..7ba560d046 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2014-06-25 Joseph Myers + + * configure.ac (base_machine): Do not set specially for particular + machines here. + * configure: Regenerated. + * sysdeps/powerpc/preconfigure: Move machine and base_machine + settings from configure.ac. + * sysdeps/i386/preconfigure: New file. + * sysdeps/s390/preconfigure: Likewise. + * sysdeps/sh/preconfigure: Likewise. + * sysdeps/sparc/preconfigure: Likewise. + 2014-06-25 Roland McGrath * sysdeps/sparc/sparc64/nptl/cpu_relax.S: Moved ... diff --git a/configure b/configure index ecc282bd2e..e7ffb831d5 100755 --- a/configure +++ b/configure @@ -3965,39 +3965,8 @@ if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then esac fi -# Expand the configuration machine name into a subdirectory by architecture -# type and particular chip. If an add-on configure fragment already set -# base_machine, we don't change it. -test -n "$base_machine" || case "$machine" in -i[4567]86) base_machine=i386 machine=i386/$machine ;; -powerpc64*) base_machine=powerpc machine=powerpc/powerpc64 ;; -powerpc*) base_machine=powerpc machine=powerpc/powerpc32 ;; -s390) base_machine=s390 machine=s390/s390-32 ;; -s390x) base_machine=s390 machine=s390/s390-64 ;; -sh3*) base_machine=sh machine=sh/sh3 ;; -sh4*) base_machine=sh machine=sh/sh4 ;; -sparc | sparcv[67]) - base_machine=sparc machine=sparc/sparc32 ;; -sparcv8 | supersparc | hypersparc) - base_machine=sparc machine=sparc/sparc32/sparcv8 ;; -sparcv8plus | sparcv8plusa | sparcv9) - base_machine=sparc machine=sparc/sparc32/sparcv9 ;; -sparcv8plusb | sparcv9b) - base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;; -sparcv9v) - base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;; -sparcv9v2) - base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;; -sparc64) - base_machine=sparc machine=sparc/sparc64 ;; -sparc64b) - base_machine=sparc machine=sparc/sparc64/sparcv9b ;; -sparc64v) - base_machine=sparc machine=sparc/sparc64/sparcv9v ;; -sparc64v2) - base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;; -*) base_machine=$machine ;; -esac +# Set base_machine if not set by a preconfigure fragment. +test -n "$base_machine" || base_machine=$machine if test "$base_machine" = "i386"; then diff --git a/configure.ac b/configure.ac index babfe5713c..2d5b902a49 100644 --- a/configure.ac +++ b/configure.ac @@ -582,42 +582,8 @@ if test -z "$enable_hacker_mode" && test x"$libc_config_ok" != xyes; then esac fi -dnl We need to use [ and ] for other purposes for a while now. -changequote(,)dnl -# Expand the configuration machine name into a subdirectory by architecture -# type and particular chip. If an add-on configure fragment already set -# base_machine, we don't change it. -test -n "$base_machine" || case "$machine" in -i[4567]86) base_machine=i386 machine=i386/$machine ;; -powerpc64*) base_machine=powerpc machine=powerpc/powerpc64 ;; -powerpc*) base_machine=powerpc machine=powerpc/powerpc32 ;; -s390) base_machine=s390 machine=s390/s390-32 ;; -s390x) base_machine=s390 machine=s390/s390-64 ;; -sh3*) base_machine=sh machine=sh/sh3 ;; -sh4*) base_machine=sh machine=sh/sh4 ;; -sparc | sparcv[67]) - base_machine=sparc machine=sparc/sparc32 ;; -sparcv8 | supersparc | hypersparc) - base_machine=sparc machine=sparc/sparc32/sparcv8 ;; -sparcv8plus | sparcv8plusa | sparcv9) - base_machine=sparc machine=sparc/sparc32/sparcv9 ;; -sparcv8plusb | sparcv9b) - base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;; -sparcv9v) - base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;; -sparcv9v2) - base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;; -sparc64) - base_machine=sparc machine=sparc/sparc64 ;; -sparc64b) - base_machine=sparc machine=sparc/sparc64/sparcv9b ;; -sparc64v) - base_machine=sparc machine=sparc/sparc64/sparcv9v ;; -sparc64v2) - base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;; -*) base_machine=$machine ;; -esac -changequote([,])dnl +# Set base_machine if not set by a preconfigure fragment. +test -n "$base_machine" || base_machine=$machine AC_SUBST(base_machine) if test "$base_machine" = "i386"; then diff --git a/sysdeps/i386/preconfigure b/sysdeps/i386/preconfigure new file mode 100644 index 0000000000..c8fefd1bff --- /dev/null +++ b/sysdeps/i386/preconfigure @@ -0,0 +1,5 @@ +# preconfigure fragment for i386. + +case "$machine" in +i[4567]86) base_machine=i386 machine=i386/$machine ;; +esac diff --git a/sysdeps/powerpc/preconfigure b/sysdeps/powerpc/preconfigure index 1741c251f1..0c6fdde7aa 100644 --- a/sysdeps/powerpc/preconfigure +++ b/sysdeps/powerpc/preconfigure @@ -1,10 +1,16 @@ -# Check for e500. +# preconfigure fragment for powerpc. case "$machine" in -powerpc) +powerpc64*) + base_machine=powerpc machine=powerpc/powerpc64 + ;; +powerpc*) + # Check for e500. $CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null > conftest.i if grep -q __NO_FPRS__ conftest.i && ! grep -q _SOFT_FLOAT conftest.i; then base_machine=powerpc machine=powerpc/powerpc32/e500 + else + base_machine=powerpc machine=powerpc/powerpc32 fi rm -f conftest.i ;; diff --git a/sysdeps/s390/preconfigure b/sysdeps/s390/preconfigure new file mode 100644 index 0000000000..d6302b0c15 --- /dev/null +++ b/sysdeps/s390/preconfigure @@ -0,0 +1,6 @@ +# preconfigure fragment for s390. + +case "$machine" in +s390) base_machine=s390 machine=s390/s390-32 ;; +s390x) base_machine=s390 machine=s390/s390-64 ;; +esac diff --git a/sysdeps/sh/preconfigure b/sysdeps/sh/preconfigure new file mode 100644 index 0000000000..c1f6537797 --- /dev/null +++ b/sysdeps/sh/preconfigure @@ -0,0 +1,6 @@ +# preconfigure fragment for sh. + +case "$machine" in +sh3*) base_machine=sh machine=sh/sh3 ;; +sh4*) base_machine=sh machine=sh/sh4 ;; +esac diff --git a/sysdeps/sparc/preconfigure b/sysdeps/sparc/preconfigure new file mode 100644 index 0000000000..de86749573 --- /dev/null +++ b/sysdeps/sparc/preconfigure @@ -0,0 +1,24 @@ +# preconfigure fragment for sparc. + +case "$machine" in +sparc | sparcv[67]) + base_machine=sparc machine=sparc/sparc32 ;; +sparcv8 | supersparc | hypersparc) + base_machine=sparc machine=sparc/sparc32/sparcv8 ;; +sparcv8plus | sparcv8plusa | sparcv9) + base_machine=sparc machine=sparc/sparc32/sparcv9 ;; +sparcv8plusb | sparcv9b) + base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9b ;; +sparcv9v) + base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v ;; +sparcv9v2) + base_machine=sparc machine=sparc/sparc32/sparcv9/sparcv9v2 ;; +sparc64) + base_machine=sparc machine=sparc/sparc64 ;; +sparc64b) + base_machine=sparc machine=sparc/sparc64/sparcv9b ;; +sparc64v) + base_machine=sparc machine=sparc/sparc64/sparcv9v ;; +sparc64v2) + base_machine=sparc machine=sparc/sparc64/sparcv9v2 ;; +esac -- cgit v1.2.3 From 92072d57c6754a4874f673439bc2b5a30f4c8918 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 25 Jun 2014 17:54:44 +0000 Subject: Remove BROKEN_PPC_ASM_CR0 configure test. One piece of architecture-specific code in the main configure.ac is the powerpc test that can define BROKEN_PPC_ASM_CR0. There's no need to move this to a sysdeps configure script, or to work out what bug it was testing in May 1998 to see if it's still relevant, since nothing in the source tree now uses the results of this test. Thus, this patch just removes the test in question. Not tested. * configure.ac (libc_cv_c_asmcr0_bug): Remove configure test. * configure: Regenerated. * config.h.in (BROKEN_PPC_ASM_CR0): Remove macro. --- ChangeLog | 4 ++++ config.h.in | 4 ---- configure | 34 ---------------------------------- configure.ac | 12 ------------ 4 files changed, 4 insertions(+), 50 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 7ba560d046..3a8869f126 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2014-06-25 Joseph Myers + * configure.ac (libc_cv_c_asmcr0_bug): Remove configure test. + * configure: Regenerated. + * config.h.in (BROKEN_PPC_ASM_CR0): Remove macro. + * configure.ac (base_machine): Do not set specially for particular machines here. * configure: Regenerated. diff --git a/config.h.in b/config.h.in index a9ff1e3ac1..38d4aa4b6a 100644 --- a/config.h.in +++ b/config.h.in @@ -73,10 +73,6 @@ (gcc on ix86 only). */ #undef USE_REGPARMS -/* Defined on PowerPC if the GCC being used has a problem with clobbering - certain registers (CR0, MQ, CTR, LR) in asm statements. */ -#undef BROKEN_PPC_ASM_CR0 - /* Defined on SPARC if GCC emits GOTDATA relocations. */ #undef HAVE_GCC_GOTDATA diff --git a/configure b/configure index e7ffb831d5..34bcd53bbf 100755 --- a/configure +++ b/configure @@ -6596,40 +6596,6 @@ if test $libc_cv_gcc_exceptions = yes; then exceptions=-fexceptions fi -if test "$host_cpu" = powerpc ; then -# Check for a bug present in at least versions 2.8.x of GCC -# and versions 1.0.x of EGCS. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether clobbering cr0 causes problems" >&5 -$as_echo_n "checking whether clobbering cr0 causes problems... " >&6; } -if ${libc_cv_c_asmcr0_bug+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int tester(int x) { asm ("" : : : "cc"); return x & 123; } -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - libc_cv_c_asmcr0_bug='no' -else - libc_cv_c_asmcr0_bug='yes' -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_c_asmcr0_bug" >&5 -$as_echo "$libc_cv_c_asmcr0_bug" >&6; } -if test "$libc_cv_c_asmcr0_bug" != 'no'; then - $as_echo "#define BROKEN_PPC_ASM_CR0 1" >>confdefs.h - -fi -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_memset" >&5 $as_echo_n "checking for __builtin_memset... " >&6; } if ${libc_cv_gcc_builtin_memset+:} false; then : diff --git a/configure.ac b/configure.ac index 2d5b902a49..589b3d053c 100644 --- a/configure.ac +++ b/configure.ac @@ -1763,18 +1763,6 @@ if test $libc_cv_gcc_exceptions = yes; then fi AC_SUBST(exceptions)dnl -if test "$host_cpu" = powerpc ; then -# Check for a bug present in at least versions 2.8.x of GCC -# and versions 1.0.x of EGCS. -AC_CACHE_CHECK(whether clobbering cr0 causes problems,libc_cv_c_asmcr0_bug,[dnl -AC_TRY_COMPILE([int tester(int x) { asm ("" : : : "cc"); return x & 123; }],, - libc_cv_c_asmcr0_bug='no', - libc_cv_c_asmcr0_bug='yes')]) -if test "$libc_cv_c_asmcr0_bug" != 'no'; then - AC_DEFINE(BROKEN_PPC_ASM_CR0) -fi -fi - AC_CACHE_CHECK(for __builtin_memset, libc_cv_gcc_builtin_memset, [dnl cat > conftest.c <<\EOF void zero (void *x) -- cgit v1.2.3 From c2570a0b35fa8f4568f3897f4f7db8cb5515383f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 25 Jun 2014 20:26:14 +0000 Subject: Move USE_REGPARMS define to sysdeps/i386/configure.ac. This patch moves the USE_REGPARMS define from the toplevel configure.ac to sysdeps/i386/configure.ac. Tested x86 that the disassembly of installed shared libraries is unchanged by this patch. * configure.ac (USE_REGPARMS): Don't define here. * configure: Regenerated. * sysdeps/i386/configure.ac (USE_REGPARMS): Define here. * sysdeps/i386/configure: Regenerated. --- ChangeLog | 5 +++++ configure | 5 ----- configure.ac | 4 ---- sysdeps/i386/configure | 3 +++ sysdeps/i386/configure.ac | 2 ++ 5 files changed, 10 insertions(+), 9 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index e1be998da4..2727f7fe6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2014-06-25 Joseph Myers + * configure.ac (USE_REGPARMS): Don't define here. + * configure: Regenerated. + * sysdeps/i386/configure.ac (USE_REGPARMS): Define here. + * sysdeps/i386/configure: Regenerated. + * nptl/createthread.c: Don't include kernel-features.h. * nptl/pthread_cancel.c: Likewise. * nptl/pthread_condattr_setclock.c: Likewise. diff --git a/configure b/configure index 34bcd53bbf..ac5a67cf9d 100755 --- a/configure +++ b/configure @@ -3969,11 +3969,6 @@ fi test -n "$base_machine" || base_machine=$machine -if test "$base_machine" = "i386"; then - $as_echo "#define USE_REGPARMS 1" >>confdefs.h - -fi - # For the multi-arch option we need support in the assembler & linker. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler and linker STT_GNU_IFUNC support" >&5 $as_echo_n "checking for assembler and linker STT_GNU_IFUNC support... " >&6; } diff --git a/configure.ac b/configure.ac index 589b3d053c..bd3e829666 100644 --- a/configure.ac +++ b/configure.ac @@ -586,10 +586,6 @@ fi test -n "$base_machine" || base_machine=$machine AC_SUBST(base_machine) -if test "$base_machine" = "i386"; then - AC_DEFINE(USE_REGPARMS) -fi - # For the multi-arch option we need support in the assembler & linker. AC_CACHE_CHECK([for assembler and linker STT_GNU_IFUNC support], libc_cv_ld_gnu_indirect_function, [dnl diff --git a/sysdeps/i386/configure b/sysdeps/i386/configure index 5dcc159900..f0a20e3d3b 100644 --- a/sysdeps/i386/configure +++ b/sysdeps/i386/configure @@ -240,5 +240,8 @@ $as_echo "$libc_cv_cc_novzeroupper" >&6; } config_vars="$config_vars config-cflags-novzeroupper = $libc_cv_cc_novzeroupper" +$as_echo "#define USE_REGPARMS 1" >>confdefs.h + + $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h diff --git a/sysdeps/i386/configure.ac b/sysdeps/i386/configure.ac index 96ab7b0f5a..dfe0b47343 100644 --- a/sysdeps/i386/configure.ac +++ b/sysdeps/i386/configure.ac @@ -88,6 +88,8 @@ LIBC_TRY_CC_OPTION([-mno-vzeroupper], ]) LIBC_CONFIG_VAR([config-cflags-novzeroupper], [$libc_cv_cc_novzeroupper]) +AC_DEFINE(USE_REGPARMS) + dnl It is always possible to access static and hidden symbols in an dnl position independent way. AC_DEFINE(PI_STATIC_AND_HIDDEN) -- cgit v1.2.3 From a8779c28a8172b6573c9dd1724540e679c77168c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 26 Jun 2014 17:33:32 +0000 Subject: Remove configure tests for assembler CFI support. This patch removes configure tests for assembler CFI support (and thereby eliminates an architecture-specific case in the main configure.ac), instead assuming that support is present unconditionally. The main test was added in 2003 around the time CFI support was added to the assembler. cfi_personality and cfi_lsda support were added to the assembler in 2006. cfi_sections support was added in 2009, a few weeks before binutils 2.20 was released; it's in 2.20, the minimum supported version, so even that configure test is obsolete. Tested x86_64 that the installed shared libraries are unchanged by this patch. * configure.ac (libc_cv_asm_cfi_directives): Remove configure test. * configure: Regenerated. * config.h.in (HAVE_ASM_CFI_DIRECTIVES): Remove macro undefine. * sysdeps/arm/configure.ac (libc_cv_asm_cfi_directive_sections): Remove configure test. * sysdeps/arm/configure: Regenerated. * sysdeps/nptl/configure.ac: Do not check libc_cv_asm_cfi_directives. * sysdeps/nptl/configure: Regenerated. * sysdeps/x86_64/nptl/configure.ac: Remove file. * sysdeps/x86_64/nptl/configure: Remove generated file. * b/sysdeps/generic/sysdep.h [HAVE_ASM_CFI_DIRECTIVES]: Make code unconditional. [!HAVE_ASM_CFI_DIRECTIVES]: Remove conditional code. --- ChangeLog | 18 +++++++ config.h.in | 3 -- configure | 37 --------------- configure.ac | 24 ---------- sysdeps/arm/configure | 29 ------------ sysdeps/arm/configure.ac | 18 ------- sysdeps/generic/sysdep.h | 100 +++++++++++++++------------------------ sysdeps/nptl/configure | 8 ---- sysdeps/nptl/configure.ac | 9 ---- sysdeps/x86_64/nptl/configure | 34 ------------- sysdeps/x86_64/nptl/configure.ac | 23 --------- 11 files changed, 57 insertions(+), 246 deletions(-) delete mode 100644 sysdeps/x86_64/nptl/configure delete mode 100644 sysdeps/x86_64/nptl/configure.ac (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index c159faa45a..e90652fba1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2014-06-26 Joseph Myers + + * configure.ac (libc_cv_asm_cfi_directives): Remove configure + test. + * configure: Regenerated. + * config.h.in (HAVE_ASM_CFI_DIRECTIVES): Remove macro undefine. + * sysdeps/arm/configure.ac (libc_cv_asm_cfi_directive_sections): + Remove configure test. + * sysdeps/arm/configure: Regenerated. + * sysdeps/nptl/configure.ac: Do not check + libc_cv_asm_cfi_directives. + * sysdeps/nptl/configure: Regenerated. + * sysdeps/x86_64/nptl/configure.ac: Remove file. + * sysdeps/x86_64/nptl/configure: Remove generated file. + * b/sysdeps/generic/sysdep.h [HAVE_ASM_CFI_DIRECTIVES]: Make code + unconditional. + [!HAVE_ASM_CFI_DIRECTIVES]: Remove conditional code. + 2014-06-26 Siddhesh Poyarekar * posix/fnmatch.c: Define WIDE_CHAR_VERSION. diff --git a/config.h.in b/config.h.in index 38d4aa4b6a..2dcd1351c7 100644 --- a/config.h.in +++ b/config.h.in @@ -24,9 +24,6 @@ /* Define if weak symbols are available via the `.weakext' directive. */ #undef HAVE_ASM_WEAKEXT_DIRECTIVE -/* Define if CFI directives are available. */ -#undef HAVE_ASM_CFI_DIRECTIVES - /* Define to the assembler line separator character for multiple assembler instructions per line. Default is `;' */ #undef ASM_LINE_SEP diff --git a/configure b/configure index ac5a67cf9d..eefc43001d 100755 --- a/configure +++ b/configure @@ -6494,43 +6494,6 @@ elif test $libc_cv_asm_weakext_directive = yes; then fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CFI directives are supported" >&5 -$as_echo_n "checking whether CFI directives are supported... " >&6; } -if ${libc_cv_asm_cfi_directives+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $machine in - sparc/sparc64*) cfi_offset=2047;; - *) cfi_offset=0;; -esac -cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - libc_cv_asm_cfi_directives=yes -else - libc_cv_asm_cfi_directives=no -fi -rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_cfi_directives" >&5 -$as_echo "$libc_cv_asm_cfi_directives" >&6; } -if test $libc_cv_asm_cfi_directives = yes; then - $as_echo "#define HAVE_ASM_CFI_DIRECTIVES 1" >>confdefs.h - -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld --no-whole-archive" >&5 $as_echo_n "checking for ld --no-whole-archive... " >&6; } if ${libc_cv_ld_no_whole_archive+:} false; then : diff --git a/configure.ac b/configure.ac index bd3e829666..22c2b4c376 100644 --- a/configure.ac +++ b/configure.ac @@ -1696,30 +1696,6 @@ elif test $libc_cv_asm_weakext_directive = yes; then AC_DEFINE(HAVE_ASM_WEAKEXT_DIRECTIVE) fi -AC_CACHE_CHECK(whether CFI directives are supported, libc_cv_asm_cfi_directives, [dnl -case $machine in - sparc/sparc64*) cfi_offset=2047;; - *) cfi_offset=0;; -esac -cat > conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_asm_cfi_directives=yes -else - libc_cv_asm_cfi_directives=no -fi -rm -f conftest*]) -if test $libc_cv_asm_cfi_directives = yes; then - AC_DEFINE(HAVE_ASM_CFI_DIRECTIVES) -fi - AC_CACHE_CHECK(for ld --no-whole-archive, libc_cv_ld_no_whole_archive, [dnl cat > conftest.c <<\EOF _start () {} diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure index 953ef4406d..860f41289d 100644 --- a/sysdeps/arm/configure +++ b/sysdeps/arm/configure @@ -3,35 +3,6 @@ #AC_DEFINE(PI_STATIC_AND_HIDDEN) -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the CFI directive .cfi_sections is supported" >&5 -$as_echo_n "checking whether the CFI directive .cfi_sections is supported... " >&6; } -if ${libc_cv_asm_cfi_directive_sections+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - libc_cv_asm_cfi_directive_sections=yes - else - libc_cv_asm_cfi_directive_sections=no - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_cfi_directive_sections" >&5 -$as_echo "$libc_cv_asm_cfi_directive_sections" >&6; } -if test $libc_cv_asm_cfi_directive_sections != yes; then - as_fn_error $? "need .cfi_sections in this configuration" "$LINENO" 5 -fi - # We check to see if the compiler and flags are # selecting the hard-float ABI and if they are then # we set libc_cv_arm_pcs_vfp to yes which causes diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac index fdc52c0408..f1d980436b 100644 --- a/sysdeps/arm/configure.ac +++ b/sysdeps/arm/configure.ac @@ -7,24 +7,6 @@ dnl NOTE: This feature was added by the GCC TLS patches. We should test for dnl it. Until we do, don't define it. #AC_DEFINE(PI_STATIC_AND_HIDDEN) -AC_CACHE_CHECK([whether the CFI directive .cfi_sections is supported], - [libc_cv_asm_cfi_directive_sections], - [cat > conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_asm_cfi_directive_sections=yes - else - libc_cv_asm_cfi_directive_sections=no - fi - rm -f conftest*]) -if test $libc_cv_asm_cfi_directive_sections != yes; then - AC_MSG_ERROR([need .cfi_sections in this configuration]) -fi - # We check to see if the compiler and flags are # selecting the hard-float ABI and if they are then # we set libc_cv_arm_pcs_vfp to yes which causes diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h index d1104efdf4..583696c8c9 100644 --- a/sysdeps/generic/sysdep.h +++ b/sysdeps/generic/sysdep.h @@ -36,84 +36,62 @@ #endif /* Makros to generate eh_frame unwind information. */ -#ifdef HAVE_ASM_CFI_DIRECTIVES -# ifdef __ASSEMBLER__ -# define cfi_startproc .cfi_startproc -# define cfi_endproc .cfi_endproc -# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off -# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg -# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off -# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off -# define cfi_offset(reg, off) .cfi_offset reg, off -# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off -# define cfi_register(r1, r2) .cfi_register r1, r2 -# define cfi_return_column(reg) .cfi_return_column reg -# define cfi_restore(reg) .cfi_restore reg -# define cfi_same_value(reg) .cfi_same_value reg -# define cfi_undefined(reg) .cfi_undefined reg -# define cfi_remember_state .cfi_remember_state -# define cfi_restore_state .cfi_restore_state -# define cfi_window_save .cfi_window_save -# define cfi_personality(enc, exp) .cfi_personality enc, exp -# define cfi_lsda(enc, exp) .cfi_lsda enc, exp +#ifdef __ASSEMBLER__ +# define cfi_startproc .cfi_startproc +# define cfi_endproc .cfi_endproc +# define cfi_def_cfa(reg, off) .cfi_def_cfa reg, off +# define cfi_def_cfa_register(reg) .cfi_def_cfa_register reg +# define cfi_def_cfa_offset(off) .cfi_def_cfa_offset off +# define cfi_adjust_cfa_offset(off) .cfi_adjust_cfa_offset off +# define cfi_offset(reg, off) .cfi_offset reg, off +# define cfi_rel_offset(reg, off) .cfi_rel_offset reg, off +# define cfi_register(r1, r2) .cfi_register r1, r2 +# define cfi_return_column(reg) .cfi_return_column reg +# define cfi_restore(reg) .cfi_restore reg +# define cfi_same_value(reg) .cfi_same_value reg +# define cfi_undefined(reg) .cfi_undefined reg +# define cfi_remember_state .cfi_remember_state +# define cfi_restore_state .cfi_restore_state +# define cfi_window_save .cfi_window_save +# define cfi_personality(enc, exp) .cfi_personality enc, exp +# define cfi_lsda(enc, exp) .cfi_lsda enc, exp -# else /* ! ASSEMBLER */ +#else /* ! ASSEMBLER */ -# define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name) -# define CFI_STRINGIFY2(Name) #Name -# define CFI_STARTPROC ".cfi_startproc" -# define CFI_ENDPROC ".cfi_endproc" -# define CFI_DEF_CFA(reg, off) \ +# define CFI_STRINGIFY(Name) CFI_STRINGIFY2 (Name) +# define CFI_STRINGIFY2(Name) #Name +# define CFI_STARTPROC ".cfi_startproc" +# define CFI_ENDPROC ".cfi_endproc" +# define CFI_DEF_CFA(reg, off) \ ".cfi_def_cfa " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off) -# define CFI_DEF_CFA_REGISTER(reg) \ +# define CFI_DEF_CFA_REGISTER(reg) \ ".cfi_def_cfa_register " CFI_STRINGIFY(reg) -# define CFI_DEF_CFA_OFFSET(off) \ +# define CFI_DEF_CFA_OFFSET(off) \ ".cfi_def_cfa_offset " CFI_STRINGIFY(off) -# define CFI_ADJUST_CFA_OFFSET(off) \ +# define CFI_ADJUST_CFA_OFFSET(off) \ ".cfi_adjust_cfa_offset " CFI_STRINGIFY(off) -# define CFI_OFFSET(reg, off) \ +# define CFI_OFFSET(reg, off) \ ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off) -# define CFI_REL_OFFSET(reg, off) \ +# define CFI_REL_OFFSET(reg, off) \ ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off) -# define CFI_REGISTER(r1, r2) \ +# define CFI_REGISTER(r1, r2) \ ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2) -# define CFI_RETURN_COLUMN(reg) \ +# define CFI_RETURN_COLUMN(reg) \ ".cfi_return_column " CFI_STRINGIFY(reg) -# define CFI_RESTORE(reg) \ +# define CFI_RESTORE(reg) \ ".cfi_restore " CFI_STRINGIFY(reg) -# define CFI_UNDEFINED(reg) \ +# define CFI_UNDEFINED(reg) \ ".cfi_undefined " CFI_STRINGIFY(reg) -# define CFI_REMEMBER_STATE \ +# define CFI_REMEMBER_STATE \ ".cfi_remember_state" -# define CFI_RESTORE_STATE \ +# define CFI_RESTORE_STATE \ ".cfi_restore_state" -# define CFI_WINDOW_SAVE \ +# define CFI_WINDOW_SAVE \ ".cfi_window_save" -# define CFI_PERSONALITY(enc, exp) \ +# define CFI_PERSONALITY(enc, exp) \ ".cfi_personality " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp) -# define CFI_LSDA(enc, exp) \ +# define CFI_LSDA(enc, exp) \ ".cfi_lsda " CFI_STRINGIFY(enc) "," CFI_STRINGIFY(exp) -# endif - -#else - -# define CFI_STARTPROC -# define CFI_ENDPROC -# define CFI_DEF_CFA(reg, off) -# define CFI_DEF_CFA_REGISTER(reg) -# define CFI_DEF_CFA_OFFSET(off) -# define CFI_ADJUST_CFA_OFFSET(off) -# define CFI_OFFSET(reg, off) -# define CFI_REL_OFFSET(reg, off) -# define CFI_REGISTER(r1, r2) -# define CFI_RETURN_COLUMN(reg) -# define CFI_RESTORE(reg) -# define CFI_UNDEFINED(reg) -# define CFI_REMEMBER_STATE -# define CFI_RESTORE_STATE -# define CFI_WINDOW_SAVE -# define CFI_PERSONALITY(enc, exp) -# define CFI_LSDA(enc, exp) #endif #include "dwarf2.h" diff --git a/sysdeps/nptl/configure b/sysdeps/nptl/configure index 239a039e3a..65ed16400c 100644 --- a/sysdeps/nptl/configure +++ b/sysdeps/nptl/configure @@ -9,14 +9,6 @@ if test "x${libc_cv_visibility_attribute}" != xyes || as_fn_error $? "working compiler support for visibility attribute is required" "$LINENO" 5 fi -if test "x$libc_cv_asm_cfi_directives" != xyes; then - case "$base_machine" in - i386 | x86_64 | powerpc | s390) - as_fn_error $? "CFI directive support in assembler is required" "$LINENO" 5 ;; - *) ;; - esac -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for forced unwind support" >&5 $as_echo_n "checking for forced unwind support... " >&6; } diff --git a/sysdeps/nptl/configure.ac b/sysdeps/nptl/configure.ac index 413af96799..ab9d5e624a 100644 --- a/sysdeps/nptl/configure.ac +++ b/sysdeps/nptl/configure.ac @@ -10,15 +10,6 @@ if test "x${libc_cv_visibility_attribute}" != xyes || AC_MSG_ERROR(working compiler support for visibility attribute is required) fi -if test "x$libc_cv_asm_cfi_directives" != xyes; then - dnl We need this only for some architectures. - case "$base_machine" in - i386 | x86_64 | powerpc | s390) - AC_MSG_ERROR(CFI directive support in assembler is required) ;; - *) ;; - esac -fi - dnl Iff is available, make sure it is the right one and it dnl contains struct _Unwind_Exception. AC_CACHE_CHECK(dnl diff --git a/sysdeps/x86_64/nptl/configure b/sysdeps/x86_64/nptl/configure deleted file mode 100644 index c9dea5a7a1..0000000000 --- a/sysdeps/x86_64/nptl/configure +++ /dev/null @@ -1,34 +0,0 @@ -# This file is generated from configure.ac by Autoconf. DO NOT EDIT! - # Local configure fragment for sysdeps/i386. - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for .cfi_personality and .cfi_lsda pseudo-ops" >&5 -$as_echo_n "checking for .cfi_personality and .cfi_lsda pseudo-ops... " >&6; } -if ${libc_cv_asm_cfi_personality+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - libc_cv_asm_cfi_personality=yes - else - libc_cv_asm_cfi_personality=no - fi - rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_cfi_personality" >&5 -$as_echo "$libc_cv_asm_cfi_personality" >&6; } -if test x"$libc_cv_asm_cfi_personality" != xyes; then - as_fn_error $? "assembler too old, .cfi_personality support missing" "$LINENO" 5 -fi diff --git a/sysdeps/x86_64/nptl/configure.ac b/sysdeps/x86_64/nptl/configure.ac deleted file mode 100644 index 0ba0cc3726..0000000000 --- a/sysdeps/x86_64/nptl/configure.ac +++ /dev/null @@ -1,23 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. -# Local configure fragment for sysdeps/i386. - -AC_CACHE_CHECK([for .cfi_personality and .cfi_lsda pseudo-ops], - libc_cv_asm_cfi_personality, [dnl - cat > conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_asm_cfi_personality=yes - else - libc_cv_asm_cfi_personality=no - fi - rm -f conftest* -]) -if test x"$libc_cv_asm_cfi_personality" != xyes; then - AC_MSG_ERROR([assembler too old, .cfi_personality support missing]) -fi -- cgit v1.2.3 From e64708de3674314ee73a490d9d3e36b59e61612a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 26 Jun 2014 17:34:27 +0000 Subject: Remove powerpc special cases in configure.ac. This patch removes two powerpc special cases in the main configure.ac. The test for rs6000 is irrelevant to currently supported configurations (config.guess reports rs6000 for some OSes, of which the only one currently supported by GCC is AIX, but not for Linux). There's no need either for a special case for powerpc*-*soft; --without-fp suffices, and GCC doesn't have any special handling of such a triplet. Not tested. * configure.ac: Do not test for machine being rs6000. Do not test for powerpc*-*soft. * configure: Regenerated. --- ChangeLog | 4 ++++ configure | 13 ------------- configure.ac | 13 ------------- 3 files changed, 4 insertions(+), 26 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index e90652fba1..4b26a77710 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2014-06-26 Joseph Myers + * configure.ac: Do not test for machine being rs6000. Do not test + for powerpc*-*soft. + * configure: Regenerated. + * configure.ac (libc_cv_asm_cfi_directives): Remove configure test. * configure: Regenerated. diff --git a/configure b/configure index eefc43001d..ea44f64dc5 100755 --- a/configure +++ b/configure @@ -3761,19 +3761,6 @@ vendor=$config_vendor os=$config_os base_os='' -# config.guess on some IBM machines says `rs6000' instead of `powerpc'. -# Unify this here. -if test "$machine" = rs6000; then - machine="powerpc" -fi - -# Braindead PowerPC box with absolutely no FPU. -case "$machine-$host_os" in - powerpc*-*soft) - with_fp=no - ;; -esac - submachine= # Check whether --with-cpu was given. diff --git a/configure.ac b/configure.ac index 22c2b4c376..f8d78608c0 100644 --- a/configure.ac +++ b/configure.ac @@ -398,19 +398,6 @@ vendor=$config_vendor os=$config_os base_os='' -# config.guess on some IBM machines says `rs6000' instead of `powerpc'. -# Unify this here. -if test "$machine" = rs6000; then - machine="powerpc" -fi - -# Braindead PowerPC box with absolutely no FPU. -case "$machine-$host_os" in - powerpc*-*soft) - with_fp=no - ;; -esac - submachine= AC_ARG_WITH([cpu], AS_HELP_STRING([--with-cpu=CPU], [select code for CPU variant]), -- cgit v1.2.3 From cb403c34c6f6e1cce5018864485958cfc2e28906 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 27 Jun 2014 16:51:22 +0000 Subject: Remove relro configure test. This patch removes the configure test for working -z relro. The use of -z relro in Makeconfig became unconditional with commit 2e6ab1df44c412bb9d30b26a4d8a679150a7e375 Author: Ulrich Drepper Date: Sat Oct 28 06:44:04 2006 +0000 Remove conditional code which now is unnecessary. (commit reference from git://repo.or.cz/glibc/history), so since then the configure test has not controlled anything about how glibc is built - simply about whether configure succeeds and allows a build to be attempted. The test for whether the option did something useful (as opposed to whether it exists - which we can certainly just assume by now) was originally added in to disable the option in a case when it did nothing useful on ia64 (as a result of something deliberate in the linker on ia64). Since 2006 that disabling has been of no effect, and given that the current test does not set libc_relro_required for ia64, it does nothing whatever useful for the original motivating case. Also at around the same time in 2006 the test was made to give an error for missing or broken -z relro support on various architectures. So effectively all the test does now is verify that, on certain architectures, the linker has not been changed deliberately to make the option ineffective. I see no apparent reason why such a change should be expected, or why the build should be stopped if it were to be made (any more than we disallow build on ia64); I think we can trust binutils patch review to point out the consequences of any change to COMMONPAGESIZE setting. The only thing that might now make sense would be disabling the -z relro use on an architecture-specific basis if there were an architecture-specific reason to consider that to make sense; it would be for the ia64 maintainer to decide if that makes sense for ia64 at present, but I think that could be done through sysdeps Makefiles - no special configure tests needed. Tested for x86_64 that this patch makes no change to the installed shared libraries. Together with (pending review) this substantially eliminates architecture-specific cases from architecture-independent configure.ac files. There remains an i386 case in sysdeps/mach/hurd/configure.ac that should properly move to the i386 subdirectory. (There are also OS-specific cases outside OS-specific directories; in principle I think should should also move.) * configure.ac (libc_commonpagesize): Remove variable. (libc_relro_required): Likewise. (libc_cv_z_relro): Remove configure test. * configure: Regenerated. * sysdeps/aarch64/preconfigure (libc_commonpagesize): Do not set variable. (libc_relro_required): Likewise. * sysdeps/alpha/preconfigure (libc_commonpagesize): Likewise. (libc_relro_required): Likewise. * sysdeps/arm/preconfigure.ac (libc_commonpagesize): Likewise. (libc_relro_required): Likewise. * sysdeps/arm/preconfigure: Regenerated. * sysdeps/ia64/preconfigure: Remove file. * sysdeps/tile/preconfigure (libc_commonpagesize): Do not set variable. (libc_relro_required): Likewise. --- ChangeLog | 17 ++++++++ configure | 92 -------------------------------------------- configure.ac | 67 -------------------------------- sysdeps/aarch64/preconfigure | 8 ---- sysdeps/alpha/preconfigure | 3 -- sysdeps/arm/preconfigure | 8 ---- sysdeps/arm/preconfigure.ac | 8 ---- sysdeps/ia64/preconfigure | 3 -- sysdeps/tile/preconfigure | 5 --- 9 files changed, 17 insertions(+), 194 deletions(-) delete mode 100644 sysdeps/ia64/preconfigure (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 027bf9df1a..510e78ac0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,22 @@ 2014-06-27 Joseph Myers + * configure.ac (libc_commonpagesize): Remove variable. + (libc_relro_required): Likewise. + (libc_cv_z_relro): Remove configure test. + * configure: Regenerated. + * sysdeps/aarch64/preconfigure (libc_commonpagesize): Do not set + variable. + (libc_relro_required): Likewise. + * sysdeps/alpha/preconfigure (libc_commonpagesize): Likewise. + (libc_relro_required): Likewise. + * sysdeps/arm/preconfigure.ac (libc_commonpagesize): Likewise. + (libc_relro_required): Likewise. + * sysdeps/arm/preconfigure: Regenerated. + * sysdeps/ia64/preconfigure: Remove file. + * sysdeps/tile/preconfigure (libc_commonpagesize): Do not set + variable. + (libc_relro_required): Likewise. + [BZ #16561] [BZ #16562] * sysdeps/ieee754/dbl-64/e_jn.c: Include . diff --git a/configure b/configure index ea44f64dc5..c8d2967f9e 100755 --- a/configure +++ b/configure @@ -5940,98 +5940,6 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_linker_feature" >&5 $as_echo "$libc_linker_feature" >&6; } -# Add-on fragments can set these for other machines. -libc_commonpagesize=${libc_commonpagesize:-no} -libc_relro_required=${libc_relro_required:-no} -case "$base_machine" in - i[34567]86 | x86_64 | powerpc* | s390*) - libc_commonpagesize=0x1000 - libc_relro_required=yes - ;; - sparc*) - libc_commonpagesize=0x2000 - libc_relro_required=yes - ;; -esac - -if test $libc_commonpagesize != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -z relro option" >&5 -$as_echo_n "checking for -z relro option... " >&6; } -if ${libc_cv_z_relro+:} false; then : - $as_echo_n "(cached) " >&6 -else - libc_cv_z_relro=no - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int _start (void) { return 42; } -extern void _exit (int); -/* Since these pointers are const, they should go in rodata. - Since they refer to functions that have to be resolved by - dynamic linking, they should instead go in RELRO data. */ -const void *const relro[] = { &_start, &_exit, 0 }; -/* GNU ld fails to produce RELRO data when it's very small and there is no - normal writable data following it, or if only uninitialized (.bss) data - follows it, or only very small writable data. */ -int data[0x10000] = { 1, }; - -_ACEOF - cat > conftest.awk <<\EOF -BEGIN { - result = "no" - commonpagesize = strtonum(commonpagesize) -} -{ print "LINE:", $0 > "/dev/stderr" } -$1 == "GNU_RELRO" { - vaddr = strtonum($3) - memsz = strtonum($6) - end = vaddr + memsz - printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \ - vaddr, memsz, end, commonpagesize > "/dev/stderr" - result = (end % commonpagesize == 0) ? "yes" : "broken" -} -END { print result } -EOF - { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS - -fPIC -shared -o conftest.so conftest.c - -nostartfiles -nostdlib - -Wl,-z,relro 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; }; } && - { ac_try='$READELF -Wl conftest.so > conftest.ph' - { { 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; }; } && - { ac_try=' - $AWK -v commonpagesize=$libc_commonpagesize -f conftest.awk - conftest.ph > conftest.cps - ' - { { 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; }; } && - libc_cv_z_relro=`cat conftest.cps 2>&5` - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_z_relro" >&5 -$as_echo "$libc_cv_z_relro" >&6; } - if { test "x$libc_relro_required" = xyes && - test "x$libc_cv_z_relro" != xyes - } - then - as_fn_error $? "linker with -z relro support required" "$LINENO" 5 - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing architecture parameter to check for working -z relro" >&5 -$as_echo "$as_me: WARNING: missing architecture parameter to check for working -z relro" >&2;} -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Bgroup option" >&5 $as_echo_n "checking for -Bgroup option... " >&6; } if ${libc_cv_Bgroup+:} false; then : diff --git a/configure.ac b/configure.ac index f8d78608c0..566ecb276d 100644 --- a/configure.ac +++ b/configure.ac @@ -1342,73 +1342,6 @@ LIBC_LINKER_FEATURE([-z initfirst], [-Wl,--enable-new-dtags,-z,initfirst], [libc_cv_z_initfirst=yes], [AC_MSG_ERROR(linker with -z initfirst support required)]) -# Add-on fragments can set these for other machines. -libc_commonpagesize=${libc_commonpagesize:-no} -libc_relro_required=${libc_relro_required:-no} -case "$base_machine" in - i[[34567]]86 | x86_64 | powerpc* | s390*) - libc_commonpagesize=0x1000 - libc_relro_required=yes - ;; - sparc*) - libc_commonpagesize=0x2000 - libc_relro_required=yes - ;; -esac - -if test $libc_commonpagesize != no; then - AC_CACHE_CHECK(for -z relro option, - libc_cv_z_relro, [dnl - libc_cv_z_relro=no - AC_LANG_CONFTEST([AC_LANG_SOURCE([[ -int _start (void) { return 42; } -extern void _exit (int); -/* Since these pointers are const, they should go in rodata. - Since they refer to functions that have to be resolved by - dynamic linking, they should instead go in RELRO data. */ -const void *const relro[] = { &_start, &_exit, 0 }; -/* GNU ld fails to produce RELRO data when it's very small and there is no - normal writable data following it, or if only uninitialized (.bss) data - follows it, or only very small writable data. */ -int data[0x10000] = { 1, }; -]])]) - cat > conftest.awk <<\EOF -BEGIN { - result = "no" - commonpagesize = strtonum(commonpagesize) -} -{ print "LINE:", $0 > "/dev/stderr" } -$1 == "GNU_RELRO" { - vaddr = strtonum($3) - memsz = strtonum($6) - end = vaddr + memsz - printf "vaddr %#x memsz %#x end %#x commonpagesize %#x\n", \ - vaddr, memsz, end, commonpagesize > "/dev/stderr" - result = (end % commonpagesize == 0) ? "yes" : "broken" -} -END { print result } -EOF - AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS - -fPIC -shared -o conftest.so conftest.c - -nostartfiles -nostdlib - -Wl,-z,relro 1>&AS_MESSAGE_LOG_FD]) && - AC_TRY_COMMAND([$READELF -Wl conftest.so > conftest.ph]) && - AC_TRY_COMMAND([ - $AWK -v commonpagesize=$libc_commonpagesize -f conftest.awk - conftest.ph > conftest.cps - ]) && - libc_cv_z_relro=`cat conftest.cps 2>&AS_MESSAGE_LOG_FD` - rm -f conftest*]) - if { test "x$libc_relro_required" = xyes && - test "x$libc_cv_z_relro" != xyes - } - then - AC_MSG_ERROR(linker with -z relro support required) - fi -else - AC_MSG_WARN([missing architecture parameter to check for working -z relro]) -fi - AC_CACHE_CHECK(for -Bgroup option, libc_cv_Bgroup, [dnl cat > conftest.c < Date: Thu, 31 Jul 2014 13:07:19 -0700 Subject: Use __builtin_trap for ABORT_INSTRUCTION. --- ChangeLog | 6 ++++++ config.h.in | 4 ++++ configure | 38 ++++++++++++++++++++++++++++++++++++++ configure.ac | 17 +++++++++++++++++ sysdeps/generic/abort-instr.h | 31 ++++++++++++++++++++++++++++++- 5 files changed, 95 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index d50535c6fb..e359c139d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2014-07-31 Roland McGrath + * config.h.in (HAVE_BUILTIN_TRAP): New #define to 0. + * configure.ac (libc_cv_builtin_trap): New test. + * configure: Regenerated. + * sysdeps/generic/abort-instr.h [HAVE_BUILTIN_TRAP] + (ABORT_INSTRUCTION): Define using __builtin_trap. + * nptl/pthreadP.h (SIGCANCEL, SIGTIMER, SIGSETXID, __xidcmd): Moved ... * sysdeps/unix/sysv/linux/nptl-signals.h: ... to this new file. * sysdeps/nptl/nptl-signals.h: New file. diff --git a/config.h.in b/config.h.in index d612a04fe8..7da1a9f6f8 100644 --- a/config.h.in +++ b/config.h.in @@ -249,6 +249,10 @@ /* The pt_chown binary is being built and used by grantpt. */ #define HAVE_PT_CHOWN 0 +/* Define if the compiler supports __builtin_trap without + any external dependencies such as making a function call. */ +#define HAVE_BUILTIN_TRAP 0 + /* ports/sysdeps/mips/configure.in */ /* Define if using the IEEE 754-2008 NaN encoding on the MIPS target. */ #undef HAVE_MIPS_NAN2008 diff --git a/configure b/configure index c8d2967f9e..646e0bc9af 100755 --- a/configure +++ b/configure @@ -7003,6 +7003,44 @@ if test $libc_cv_ehdr_start = yes; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_trap with no external dependencies" >&5 +$as_echo_n "checking for __builtin_trap with no external dependencies... " >&6; } +if ${libc_cv_builtin_trap+:} false; then : + $as_echo_n "(cached) " >&6 +else + libc_cv_builtin_trap=no +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__builtin_trap () + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +libc_undefs=`$NM -u conftest.o | + LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \ + 2>&5` || { + as_fn_error $? "confusing output from $NM -u" "$LINENO" 5 +} +echo >&5 "libc_undefs='$libc_undefs'" +if test -z "$libc_undefs"; then + libc_cv_builtin_trap=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_builtin_trap" >&5 +$as_echo "$libc_cv_builtin_trap" >&6; } +if test $libc_cv_builtin_trap = yes; then + $as_echo "#define HAVE_BUILTIN_TRAP 1" >>confdefs.h + +fi + ### End of automated tests. ### Now run sysdeps configure fragments. diff --git a/configure.ac b/configure.ac index 566ecb276d..e89faa0dfe 100644 --- a/configure.ac +++ b/configure.ac @@ -1901,6 +1901,23 @@ if test $libc_cv_ehdr_start = yes; then AC_DEFINE([HAVE_EHDR_START]) fi +AC_CACHE_CHECK(for __builtin_trap with no external dependencies, + libc_cv_builtin_trap, [dnl +libc_cv_builtin_trap=no +AC_TRY_COMPILE([], [__builtin_trap ()], [ +libc_undefs=`$NM -u conftest.o | + LC_ALL=C $AWK '$1 == "U" { print $2 | "sort -u"; next } { exit(1) }' \ + 2>&AS_MESSAGE_LOG_FD` || { + AC_MSG_ERROR([confusing output from $NM -u]) +} +echo >&AS_MESSAGE_LOG_FD "libc_undefs='$libc_undefs'" +if test -z "$libc_undefs"; then + libc_cv_builtin_trap=yes +fi])]) +if test $libc_cv_builtin_trap = yes; then + AC_DEFINE([HAVE_BUILTIN_TRAP]) +fi + ### End of automated tests. ### Now run sysdeps configure fragments. diff --git a/sysdeps/generic/abort-instr.h b/sysdeps/generic/abort-instr.h index 106a330b2b..4ac11d2ea5 100644 --- a/sysdeps/generic/abort-instr.h +++ b/sysdeps/generic/abort-instr.h @@ -1,2 +1,31 @@ +/* Magic instruction to crash quickly and reliably. Generic/stub version. + Copyright (C) 2014 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#ifndef _ABORT_INSTR_H +#define _ABORT_INSTR_H 1 + +/* If the compiler provides the generic way to generate the right + instruction, we can use that without any machine-specific knowledge. */ +#if HAVE_BUILTIN_TRAP +# define ABORT_INSTRUCTION __builtin_trap () +#else /* We cannot give any generic instruction to crash the program. - abort() will have to make sure it never returns. */ + abort will have to make sure it never returns. */ +#endif + +#endif /* abort-instr.h */ -- cgit v1.2.3 From 61b1ef6e7cc4518cdadb808dfa78980cc15a63c3 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 6 Aug 2014 23:44:29 -0400 Subject: detect broken linker handling of __ehdr_start Older versions of ld on ia64 support __ehdr_start, but generate relocs when they shouldn't. This causes the ld.so to not run because it tries to resolve the __ehdr_start symbol (but it's not exported). --- ChangeLog | 6 ++++++ configure | 26 ++++++++++++++++++++------ configure.ac | 23 ++++++++++++++++++----- 3 files changed, 44 insertions(+), 11 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 279bad7d41..d385cc937e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2014-08-12 Mike Frysinger + + * configure.ac: Change __ehdr_start code to dereference the struct. + Run readelf on the output to look for relocations. + * configure: Regenerated. + 2014-08-12 Joseph Myers [BZ #17261] diff --git a/configure b/configure index 646e0bc9af..86ba30774b 100755 --- a/configure +++ b/configure @@ -6965,8 +6965,11 @@ if test $libc_cv_predef_stack_protector = yes; then fi libc_extra_cppflags= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker provides __ehdr_start" >&5 -$as_echo_n "checking whether the linker provides __ehdr_start... " >&6; } +# Some linkers on some architectures support __ehdr_start but with +# bugs. Make sure usage of it does not create relocations in the +# output (as the linker should resolve them all for us). +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker provides working __ehdr_start" >&5 +$as_echo_n "checking whether the linker provides working __ehdr_start... " >&6; } if ${libc_cv_ehdr_start+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6980,12 +6983,20 @@ LIBS= cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -extern const char __ehdr_start __attribute__ ((visibility ("hidden"))); -const char *ehdr (void) { return &__ehdr_start; } +typedef struct { + char foo; + long val; +} Ehdr; +extern const Ehdr __ehdr_start __attribute__ ((visibility ("hidden"))); +long ehdr (void) { return __ehdr_start.val; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - libc_cv_ehdr_start=yes + if $READELF -r conftest | fgrep __ehdr_start >/dev/null; then + libc_cv_ehdr_start=broken + else + libc_cv_ehdr_start=yes + fi else libc_cv_ehdr_start=no fi @@ -6998,9 +7009,12 @@ LIBS="$old_LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_ehdr_start" >&5 $as_echo "$libc_cv_ehdr_start" >&6; } -if test $libc_cv_ehdr_start = yes; then +if test "$libc_cv_ehdr_start" = yes; then $as_echo "#define HAVE_EHDR_START 1" >>confdefs.h +elif test "$libc_cv_ehdr_start" = broken; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: linker is broken -- you should upgrade" >&5 +$as_echo "$as_me: WARNING: linker is broken -- you should upgrade" >&2;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_trap with no external dependencies" >&5 diff --git a/configure.ac b/configure.ac index e89faa0dfe..255339983a 100644 --- a/configure.ac +++ b/configure.ac @@ -1880,7 +1880,10 @@ if test $libc_cv_predef_stack_protector = yes; then fi libc_extra_cppflags= -AC_CACHE_CHECK([whether the linker provides __ehdr_start], +# Some linkers on some architectures support __ehdr_start but with +# bugs. Make sure usage of it does not create relocations in the +# output (as the linker should resolve them all for us). +AC_CACHE_CHECK([whether the linker provides working __ehdr_start], libc_cv_ehdr_start, [ old_CFLAGS="$CFLAGS" old_LDFLAGS="$LDFLAGS" @@ -1889,16 +1892,26 @@ CFLAGS="$CFLAGS -fPIC" LDFLAGS="$LDFLAGS -nostdlib -nostartfiles -shared" LIBS= AC_LINK_IFELSE([AC_LANG_SOURCE([ -extern const char __ehdr_start __attribute__ ((visibility ("hidden"))); -const char *ehdr (void) { return &__ehdr_start; } +typedef struct { + char foo; + long val; +} Ehdr; +extern const Ehdr __ehdr_start __attribute__ ((visibility ("hidden"))); +long ehdr (void) { return __ehdr_start.val; } ])], - [libc_cv_ehdr_start=yes], [libc_cv_ehdr_start=no]) + [if $READELF -r conftest | fgrep __ehdr_start >/dev/null; then + libc_cv_ehdr_start=broken + else + libc_cv_ehdr_start=yes + fi], [libc_cv_ehdr_start=no]) CFLAGS="$old_CFLAGS" LDFLAGS="$old_LDFLAGS" LIBS="$old_LIBS" ]) -if test $libc_cv_ehdr_start = yes; then +if test "$libc_cv_ehdr_start" = yes; then AC_DEFINE([HAVE_EHDR_START]) +elif test "$libc_cv_ehdr_start" = broken; then + AC_MSG_WARN([linker is broken -- you should upgrade]) fi AC_CACHE_CHECK(for __builtin_trap with no external dependencies, -- cgit v1.2.3 From ba90e05052ce57db51e3cb18978614fd0db5c7ef Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 12 Sep 2014 12:28:47 +0000 Subject: Remove configuration name patterns from shlib-versions. This patch removes the first column (patterns matching configuration names) from shlib-versions, leaving shlib-versions entry selection based purely on sysdeps directories. An implication of this removal is that the default for any non-Linux ports using NPTL will be the same SONAMEs for NPTL libraries as for Linux (as those defaults, previously limited to .*-.*-linux.*, are left in nptl/shlib-versions and nptl_db/shlib-versions). Special host_os handling in configure.ac that was purely for shlib-versions is removed. (The host_os setting is still used for libc-abis - see regarding that - but no entries there are affected by this change.) Tested on x86_64 and x86 that the installed shared libraries are unchanged by this patch. * scripts/soversions.awk: Do not handle configuration names. * Makeconfig ($(common-objpfx)soversions.i): Do not pass cpu, vendor and os variables to soversions.awk. * configure.ac: Do not modify gnu-* host_os. * configure: Regenerated * shlib-versions: Remove first column with configuration names. * nptl/shlib-versions: Likewise. * nptl_db/shlib-versions: Likewise. * sysdeps/hppa/shlib-versions: Likewise. * sysdeps/m68k/shlib-versions: Likewise. * sysdeps/mach/hurd/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/aarch64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/alpha/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/arm/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/hppa/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/ia64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/microblaze/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/mips/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/sh/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/tile/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Likewise. libidn/ChangeLog: * shlib-versions: Remove first column with configuration names. --- ChangeLog | 30 ++++++++++ Makeconfig | 3 - configure | 13 ----- configure.ac | 13 ----- libidn/ChangeLog | 4 ++ libidn/shlib-versions | 2 +- nptl/shlib-versions | 2 +- nptl_db/shlib-versions | 2 +- scripts/soversions.awk | 64 ++++++++-------------- shlib-versions | 61 +++++++++++---------- sysdeps/hppa/shlib-versions | 2 +- sysdeps/m68k/shlib-versions | 2 +- sysdeps/mach/hurd/shlib-versions | 10 ++-- sysdeps/unix/sysv/linux/aarch64/shlib-versions | 6 +- sysdeps/unix/sysv/linux/alpha/shlib-versions | 18 +++--- sysdeps/unix/sysv/linux/arm/shlib-versions | 6 +- sysdeps/unix/sysv/linux/hppa/shlib-versions | 10 ++-- sysdeps/unix/sysv/linux/ia64/shlib-versions | 10 ++-- .../unix/sysv/linux/m68k/coldfire/shlib-versions | 2 +- sysdeps/unix/sysv/linux/microblaze/shlib-versions | 2 +- sysdeps/unix/sysv/linux/mips/shlib-versions | 32 +++++------ .../sysv/linux/powerpc/powerpc64/shlib-versions | 8 +-- .../unix/sysv/linux/s390/s390-64/shlib-versions | 4 +- sysdeps/unix/sysv/linux/sh/shlib-versions | 10 ++-- sysdeps/unix/sysv/linux/shlib-versions | 4 +- .../unix/sysv/linux/sparc/sparc32/shlib-versions | 2 +- .../unix/sysv/linux/sparc/sparc64/shlib-versions | 10 ++-- sysdeps/unix/sysv/linux/tile/shlib-versions | 2 +- sysdeps/unix/sysv/linux/x86_64/64/shlib-versions | 8 +-- sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions | 8 +-- 30 files changed, 169 insertions(+), 181 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index fbd013b39c..d02d8b6c1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,35 @@ 2014-09-12 Joseph Myers + * scripts/soversions.awk: Do not handle configuration names. + * Makeconfig ($(common-objpfx)soversions.i): Do not pass cpu, + vendor and os variables to soversions.awk. + * configure.ac: Do not modify gnu-* host_os. + * configure: Regenerated + * shlib-versions: Remove first column with configuration names. + * nptl/shlib-versions: Likewise. + * nptl_db/shlib-versions: Likewise. + * sysdeps/hppa/shlib-versions: Likewise. + * sysdeps/m68k/shlib-versions: Likewise. + * sysdeps/mach/hurd/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/aarch64/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/alpha/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/arm/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/hppa/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/ia64/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/microblaze/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/mips/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions: + Likewise. + * sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/sh/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/tile/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/x86_64/64/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure.ac (HAVE_ELFV2_ABI): AC_DEFINE in ELFv2 case. * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: diff --git a/Makeconfig b/Makeconfig index 0f8069b82a..07807880fb 100644 --- a/Makeconfig +++ b/Makeconfig @@ -964,9 +964,6 @@ soversions-default-setname = $(patsubst %, %,\ $(common-objpfx)soversions.i: $(..)scripts/soversions.awk \ $(common-objpfx)shlib-versions.v $(AWK) -v default_setname='$(soversions-default-setname)' \ - -v cpu='$(config-machine)' \ - -v vendor='$(config-vendor)' \ - -v os='$(config-os)' \ -f $^ > $@T mv -f $@T $@ $(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig diff --git a/configure b/configure index 86ba30774b..ff5c730a02 100755 --- a/configure +++ b/configure @@ -3728,19 +3728,6 @@ if test "$build_pt_chown" = yes; then fi -# The way shlib-versions is used to generate soversions.mk uses a -# fairly simplistic model for name recognition that can't distinguish -# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os -# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can -# tell. This doesn't get used much beyond that, so it's fairly safe. -case "$host_os" in -linux*) - ;; -gnu*) - host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'` - ;; -esac - # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. diff --git a/configure.ac b/configure.ac index 255339983a..794ffc2f1d 100644 --- a/configure.ac +++ b/configure.ac @@ -365,19 +365,6 @@ if test "$build_pt_chown" = yes; then AC_DEFINE(HAVE_PT_CHOWN) fi -# The way shlib-versions is used to generate soversions.mk uses a -# fairly simplistic model for name recognition that can't distinguish -# i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a $host_os -# of `gnu*' here to be `gnu-gnu*' just so that shlib-versions can -# tell. This doesn't get used much beyond that, so it's fairly safe. -case "$host_os" in -linux*) - ;; -gnu*) - host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'` - ;; -esac - # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. diff --git a/libidn/ChangeLog b/libidn/ChangeLog index 7a48fd5c6d..740340fde3 100644 --- a/libidn/ChangeLog +++ b/libidn/ChangeLog @@ -1,3 +1,7 @@ +2014-09-12 Joseph Myers + + * shlib-versions: Remove first column with configuration names. + 2014-02-26 Joseph Myers * Makefile: Include Makeconfig immediately after defining subdir. diff --git a/libidn/shlib-versions b/libidn/shlib-versions index 9b27e5196b..0aa1a59db4 100644 --- a/libidn/shlib-versions +++ b/libidn/shlib-versions @@ -1 +1 @@ -.*-.*-.* libcidn=1 +libcidn=1 diff --git a/nptl/shlib-versions b/nptl/shlib-versions index f2cc32d235..e08931af1a 100644 --- a/nptl/shlib-versions +++ b/nptl/shlib-versions @@ -1 +1 @@ -.*-.*-linux.* libpthread=0 +libpthread=0 diff --git a/nptl_db/shlib-versions b/nptl_db/shlib-versions index 592f7fa284..cf5a9e9694 100644 --- a/nptl_db/shlib-versions +++ b/nptl_db/shlib-versions @@ -1,2 +1,2 @@ # The thread debug library -.*-.*-linux.* libthread_db=1 +libthread_db=1 diff --git a/scripts/soversions.awk b/scripts/soversions.awk index adba1556f0..dbc90590e8 100644 --- a/scripts/soversions.awk +++ b/scripts/soversions.awk @@ -1,59 +1,41 @@ # awk script for shlib-versions.v -> soversions.i; see Makeconfig. -BEGIN { - config = cpu "-" vendor "-" os; - configs[config] = "DEFAULT"; -} - -{ thiscf = $1 } - # Obey the first matching DEFAULT line. -$2 == "DEFAULT" { - $1 = $2 = ""; - default_set[++ndefault_set] = thiscf "\n" $0; +$1 == "DEFAULT" { + $1 = ""; + default_set[++ndefault_set] = $0; next } # Collect all lib lines before emitting anything, so DEFAULT # can be interspersed. { - lib = number = $2; + lib = number = $1; sub(/=.*$/, "", lib); sub(/^.*=/, "", number); - if ((thiscf FS lib) in numbers) next; - numbers[thiscf FS lib] = number; - order[thiscf FS lib] = ++order_n; - if (NF > 2) { - $1 = $2 = ""; - versions[thiscf FS lib] = $0 + if (lib in numbers) next; + numbers[lib] = number; + order[lib] = ++order_n; + if (NF > 1) { + $1 = ""; + versions[lib] = $0 } } END { - for (elt in numbers) { - split(elt, x); - cf = x[1]; - lib = x[2]; - for (c in configs) - if (c ~ cf) { - if (elt in versions) - set = versions[elt]; - else { - set = (c == config) ? default_setname : ""; - for (i = 1; i <= ndefault_set; ++i) { - split(default_set[i], x, "\n"); - if (c ~ x[1]) { - set = x[2]; - break; - } - } - } - line = set ? (lib FS numbers[elt] FS set) : (lib FS numbers[elt]); - if (!((c FS lib) in lineorder) || order[elt] < lineorder[c FS lib]) { - lineorder[c FS lib] = order[elt]; - lines[c FS lib] = configs[c] FS line; - } - } + for (lib in numbers) { + if (lib in versions) + set = versions[lib]; + else { + set = default_setname; + if (ndefault_set >= 1) + set = default_set[1]; + } + line = set ? (lib FS numbers[lib] FS set) : (lib FS numbers[lib]); + if (!(lib in lineorder) || order[lib] < lineorder[lib]) { + lineorder[lib] = order[lib]; + lines[lib] = "DEFAULT" FS line; + } } for (c in lines) { print lines[c] diff --git a/shlib-versions b/shlib-versions index d34dea8e42..e05b248e8d 100644 --- a/shlib-versions +++ b/shlib-versions @@ -1,72 +1,73 @@ # This file (and shlib-versions files in sysdeps directories) defines # the shared library version numbers we will install. -# The following lines list filename patterns matching canonical configurations, -# and the associated versions to use for various libraries. The entire -# list is processed, with earlier entries taking precedence over later -# entries. So loose patterns at the end of the list can give defaults. +# The following lines list the associated versions to use for various +# libraries. The entire list is processed, with earlier entries +# taking precedence over later entries (and the files from sysdeps +# directories coming before those from other subdirectories, which +# come before this file). # This file can use cpp-style conditionals starting with % instead of # # to test the symbols defined in config.h by configure. -# In the optional third column, there can one or more symbol set names +# In the optional second column, there can one or more symbol set names # listed, which must be in ascending version order reading left to right # and must appear in this same order in the Versions.def file. Each listed # version subsumes all prior versions back to the previous listed version. # -# An entry with DEFAULT in the second column gives a default third column -# to apply on matching configurations when the matching entry for a particular -# library has no third column. The defaults must precede the entries they -# apply to. +# An entry with DEFAULT in the first column gives a default second +# column to apply when the matching entry for a particular library has +# no second column. The defaults must precede the entries they apply +# to. -# Configuration Library=version Earliest symbol set (optional) -# ------------- --------------- ------------------------------ +# Library=version Earliest symbol set (optional) +# --------------- ------------------------------ # We use the ELF ABI standard name for the default. -.*-.*-.* ld=ld.so.1 +ld=ld.so.1 # The -ldl interface (see ) is the same on all platforms. -.*-.*-.* libdl=2 +libdl=2 # So far the -lutil interface is the same on all platforms, except for the # `struct utmp' format, which depends on libc. -.*-.*-.* libutil=1 +libutil=1 # Version number 2 is used on other systems for the BIND 4.9.5 resolver # interface. -.*-.*-.* libresolv=2 +libresolv=2 # Interface revision of nss_* modules. This must match NSS_SHLIB_REVISION # in nss/nsswitch.h, which determines the library names used for service # names given in /etc/nsswitch.conf. -.*-.*-.* libnss_files=2 -.*-.*-.* libnss_dns=2 -.*-.*-.* libnss_compat=2 -.*-.*-.* libnss_nis=2 -.*-.*-.* libnss_nisplus=2 -.*-.*-.* libnss_ldap=2 -.*-.*-.* libnss_hesiod=2 -.*-.*-.* libnss_db=2 +libnss_files=2 +libnss_dns=2 +libnss_compat=2 +libnss_nis=2 +libnss_nisplus=2 +libnss_ldap=2 +libnss_hesiod=2 +libnss_db=2 # Tests for NSS. They must have the same NSS_SHLIB_REVISION number as # the rest. -.*-.*-.* libnss_test1=2 +libnss_test1=2 # Version for libnsl with YP and NIS+ functions. -.*-.*-.* libnsl=1 +libnsl=1 # This defines the shared library version numbers we will install. -.*-.*-.* libcrypt=1 +libcrypt=1 # The gross patch for programs assuming broken locale implementations. -.*-.*-.* libBrokenLocale=1 +libBrokenLocale=1 # The real-time library from POSIX.1b. -.*-.*-.* librt=1 +librt=1 # The asynchronous name lookup library. -.*-.*-.* libanl=1 +libanl=1 # This defines the libgcc soname version this glibc is to load for # asynchronous cancellation to work correctly. -.*-.*-.* libgcc_s=1 +libgcc_s=1 diff --git a/sysdeps/hppa/shlib-versions b/sysdeps/hppa/shlib-versions index ae3a3f195f..34e9347125 100644 --- a/sysdeps/hppa/shlib-versions +++ b/sysdeps/hppa/shlib-versions @@ -1 +1 @@ -hppa.*-.*-.* libgcc_s=4 +libgcc_s=4 diff --git a/sysdeps/m68k/shlib-versions b/sysdeps/m68k/shlib-versions index b65b00b212..c8db251c22 100644 --- a/sysdeps/m68k/shlib-versions +++ b/sysdeps/m68k/shlib-versions @@ -1 +1 @@ -m68k-.*-linux.* libgcc_s=2 +libgcc_s=2 diff --git a/sysdeps/mach/hurd/shlib-versions b/sysdeps/mach/hurd/shlib-versions index f79c6331b5..edbc3014a6 100644 --- a/sysdeps/mach/hurd/shlib-versions +++ b/sysdeps/mach/hurd/shlib-versions @@ -1,12 +1,12 @@ -.*-.*-gnu-gnu.* DEFAULT GLIBC_2.2.6 +DEFAULT GLIBC_2.2.6 -.*-.*-gnu-gnu.* libm=6 +libm=6 # libmachuser.so.1 corresponds to mach/*.defs as of Utah's UK22 release. -.*-.*-gnu-gnu.* libmachuser=1 +libmachuser=1 # libhurduser.so.0.3 corresponds to hurd/*.defs as of 11 June 2002. -.*-.*-gnu-gnu.* libhurduser=0.3 +libhurduser=0.3 # libc.so.0.3 is the first Hurd libc using libio. -.*-.*-gnu-gnu.* libc=0.3 +libc=0.3 diff --git a/sysdeps/unix/sysv/linux/aarch64/shlib-versions b/sysdeps/unix/sysv/linux/aarch64/shlib-versions index 67f19119aa..e1768a7361 100644 --- a/sysdeps/unix/sysv/linux/aarch64/shlib-versions +++ b/sysdeps/unix/sysv/linux/aarch64/shlib-versions @@ -1,7 +1,7 @@ -aarch64.*-.*-linux.* DEFAULT GLIBC_2.17 +DEFAULT GLIBC_2.17 %ifdef HAVE_AARCH64_BE -aarch64.*-.*-linux.* ld=ld-linux-aarch64_be.so.1 +ld=ld-linux-aarch64_be.so.1 %else -aarch64.*-.*-linux.* ld=ld-linux-aarch64.so.1 +ld=ld-linux-aarch64.so.1 %endif diff --git a/sysdeps/unix/sysv/linux/alpha/shlib-versions b/sysdeps/unix/sysv/linux/alpha/shlib-versions index cd4b9af78d..cd913c257c 100644 --- a/sysdeps/unix/sysv/linux/alpha/shlib-versions +++ b/sysdeps/unix/sysv/linux/alpha/shlib-versions @@ -1,14 +1,14 @@ -alpha.*-.*-linux.* libm=6.1 -alpha.*-.*-linux.* libc=6.1 +libm=6.1 +libc=6.1 -alpha.*-.*-linux.* ld=ld-linux.so.2 +ld=ld-linux.so.2 -alpha.*-.*-linux.* libdl=2.1 +libdl=2.1 -alpha.*-.*-linux.* libutil=1.1 +libutil=1.1 -alpha.*-.*-linux.* libresolv=2.1 +libresolv=2.1 -alpha.*-.*-linux.* libnsl=1.1 -alpha.*-.*-linux.* libcrypt=1.1 -alpha.*-.*-linux.* libBrokenLocale=1.1 +libnsl=1.1 +libcrypt=1.1 +libBrokenLocale=1.1 diff --git a/sysdeps/unix/sysv/linux/arm/shlib-versions b/sysdeps/unix/sysv/linux/arm/shlib-versions index 1ac597abbb..9b169530d4 100644 --- a/sysdeps/unix/sysv/linux/arm/shlib-versions +++ b/sysdeps/unix/sysv/linux/arm/shlib-versions @@ -1,9 +1,9 @@ -arm.*-.*-linux-gnueabi.* DEFAULT GLIBC_2.4 +DEFAULT GLIBC_2.4 %ifdef HAVE_ARM_PCS_VFP # The EABI-derived hard-float ABI uses a new dynamic linker. -arm.*-.*-linux-gnueabi.* ld=ld-linux-armhf.so.3 +ld=ld-linux-armhf.so.3 %else # The EABI-derived soft-float ABI continues to use ld-linux.so.3. -arm.*-.*-linux-gnueabi.* ld=ld-linux.so.3 +ld=ld-linux.so.3 %endif diff --git a/sysdeps/unix/sysv/linux/hppa/shlib-versions b/sysdeps/unix/sysv/linux/hppa/shlib-versions index ee46e4ab00..3a2d496220 100644 --- a/sysdeps/unix/sysv/linux/hppa/shlib-versions +++ b/sysdeps/unix/sysv/linux/hppa/shlib-versions @@ -1,9 +1,9 @@ -hppa.*-.*-.* libm=6 GLIBC_2.2 +libm=6 GLIBC_2.2 -hppa.*-.*-.* libc=6 GLIBC_2.2 +libc=6 GLIBC_2.2 -hppa.*-.*-.* ld=ld.so.1 GLIBC_2.2 +ld=ld.so.1 GLIBC_2.2 -hppa-.*-.* libBrokenLocale=1 GLIBC_2.2 +libBrokenLocale=1 GLIBC_2.2 -hppa.*-.*-linux.* libpthread=0 GLIBC_2.2 +libpthread=0 GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/ia64/shlib-versions b/sysdeps/unix/sysv/linux/ia64/shlib-versions index c8e1482892..37374c0e20 100644 --- a/sysdeps/unix/sysv/linux/ia64/shlib-versions +++ b/sysdeps/unix/sysv/linux/ia64/shlib-versions @@ -1,8 +1,8 @@ -ia64-.*-linux.* libc=6.1 GLIBC_2.2 -ia64-.*-linux.* libm=6.1 GLIBC_2.2 +libc=6.1 GLIBC_2.2 +libm=6.1 GLIBC_2.2 -ia64-.*-linux.* ld=ld-linux-ia64.so.2 GLIBC_2.2 +ld=ld-linux-ia64.so.2 GLIBC_2.2 -ia64-.*-.* libBrokenLocale=1 GLIBC_2.2 +libBrokenLocale=1 GLIBC_2.2 -ia64.*-.*-linux.* libpthread=0 GLIBC_2.2 +libpthread=0 GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions b/sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions index f4c68b2a51..4309e4a368 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/shlib-versions @@ -1 +1 @@ -m68k-.*-linux.* DEFAULT GLIBC_2.4 +DEFAULT GLIBC_2.4 diff --git a/sysdeps/unix/sysv/linux/microblaze/shlib-versions b/sysdeps/unix/sysv/linux/microblaze/shlib-versions index 6ec43db15b..eaf37a118e 100644 --- a/sysdeps/unix/sysv/linux/microblaze/shlib-versions +++ b/sysdeps/unix/sysv/linux/microblaze/shlib-versions @@ -1 +1 @@ -microblaze.*-.*-linux.* DEFAULT GLIBC_2.18 +DEFAULT GLIBC_2.18 diff --git a/sysdeps/unix/sysv/linux/mips/shlib-versions b/sysdeps/unix/sysv/linux/mips/shlib-versions index d1414ede64..c5bd7db098 100644 --- a/sysdeps/unix/sysv/linux/mips/shlib-versions +++ b/sysdeps/unix/sysv/linux/mips/shlib-versions @@ -1,27 +1,27 @@ -mips.*-.*-linux.* libm=6 GLIBC_2.0 GLIBC_2.2 +libm=6 GLIBC_2.0 GLIBC_2.2 # Working mips versions were never released between 2.0 and 2.2. -mips.*-.*-linux.* libc=6 GLIBC_2.0 GLIBC_2.2 +libc=6 GLIBC_2.0 GLIBC_2.2 %ifdef HAVE_MIPS_NAN2008 -mips.*-.*-linux.* ld=ld-linux-mipsn8.so.1 GLIBC_2.0 GLIBC_2.2 +ld=ld-linux-mipsn8.so.1 GLIBC_2.0 GLIBC_2.2 %else -mips.*-.*-linux.* ld=ld.so.1 GLIBC_2.0 GLIBC_2.2 +ld=ld.so.1 GLIBC_2.0 GLIBC_2.2 %endif -mips.*-.*-linux.* libdl=2 GLIBC_2.0 GLIBC_2.2 +libdl=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libresolv=2 GLIBC_2.0 GLIBC_2.2 +libresolv=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_files=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_dns=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_compat=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_nis=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_nisplus=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_ldap=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnss_hesiod=2 GLIBC_2.0 GLIBC_2.2 +libnss_files=2 GLIBC_2.0 GLIBC_2.2 +libnss_dns=2 GLIBC_2.0 GLIBC_2.2 +libnss_compat=2 GLIBC_2.0 GLIBC_2.2 +libnss_nis=2 GLIBC_2.0 GLIBC_2.2 +libnss_nisplus=2 GLIBC_2.0 GLIBC_2.2 +libnss_ldap=2 GLIBC_2.0 GLIBC_2.2 +libnss_hesiod=2 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libnsl=1 GLIBC_2.0 GLIBC_2.2 +libnsl=1 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* librt=1 GLIBC_2.0 GLIBC_2.2 +librt=1 GLIBC_2.0 GLIBC_2.2 -mips.*-.*-linux.* libpthread=0 GLIBC_2.0 GLIBC_2.2 +libpthread=0 GLIBC_2.0 GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions b/sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions index 1febda46d0..0b83af114e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions @@ -1,7 +1,7 @@ %ifdef HAVE_ELFV2_ABI -powerpc.*le-.*-linux.* DEFAULT GLIBC_2.17 -powerpc.*le-.*-linux.* libpthread=0 GLIBC_2.17 +DEFAULT GLIBC_2.17 +libpthread=0 GLIBC_2.17 %else -powerpc64-.*-linux.* DEFAULT GLIBC_2.3 -powerpc64-.*-linux.* libpthread=0 GLIBC_2.3 +DEFAULT GLIBC_2.3 +libpthread=0 GLIBC_2.3 %endif diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions b/sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions index cab0c0b2fa..31edcfc4e1 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions +++ b/sysdeps/unix/sysv/linux/s390/s390-64/shlib-versions @@ -1,2 +1,2 @@ -s390x-.*-linux.* DEFAULT GLIBC_2.2 -s390x-.*-linux.* libpthread=0 GLIBC_2.2 +DEFAULT GLIBC_2.2 +libpthread=0 GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/sh/shlib-versions b/sysdeps/unix/sysv/linux/sh/shlib-versions index c376fe8011..9333bbd7a3 100644 --- a/sysdeps/unix/sysv/linux/sh/shlib-versions +++ b/sysdeps/unix/sysv/linux/sh/shlib-versions @@ -1,5 +1,5 @@ -sh.*-.*-linux.* libm=6 GLIBC_2.2 -sh.*-.*-linux.* libc=6 GLIBC_2.2 -sh.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2 -sh.*-.*-.* libBrokenLocale=1 GLIBC_2.2 -sh.*-.*-linux.* libpthread=0 GLIBC_2.2 +libm=6 GLIBC_2.2 +libc=6 GLIBC_2.2 +ld=ld-linux.so.2 GLIBC_2.2 +libBrokenLocale=1 GLIBC_2.2 +libpthread=0 GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/shlib-versions b/sysdeps/unix/sysv/linux/shlib-versions index 2c06a8e40c..9160557733 100644 --- a/sysdeps/unix/sysv/linux/shlib-versions +++ b/sysdeps/unix/sysv/linux/shlib-versions @@ -1,2 +1,2 @@ -.*-.*-linux.* libm=6 -.*-.*-linux.* libc=6 +libm=6 +libc=6 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions b/sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions index 26ca1f4858..ca5d15b1df 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/shlib-versions @@ -1 +1 @@ -sparc.*-.*-linux.* ld=ld-linux.so.2 +ld=ld-linux.so.2 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions b/sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions index 58d2c241ed..9333bbd7a3 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/shlib-versions @@ -1,5 +1,5 @@ -sparc64.*-.*-linux.* libm=6 GLIBC_2.2 -sparc64.*-.*-linux.* libc=6 GLIBC_2.2 -sparc64.*-.*-linux.* ld=ld-linux.so.2 GLIBC_2.2 -sparc64.*-.*-.* libBrokenLocale=1 GLIBC_2.2 -sparc64.*-.*-linux.* libpthread=0 GLIBC_2.2 +libm=6 GLIBC_2.2 +libc=6 GLIBC_2.2 +ld=ld-linux.so.2 GLIBC_2.2 +libBrokenLocale=1 GLIBC_2.2 +libpthread=0 GLIBC_2.2 diff --git a/sysdeps/unix/sysv/linux/tile/shlib-versions b/sysdeps/unix/sysv/linux/tile/shlib-versions index f50868ff64..b4360d35e1 100644 --- a/sysdeps/unix/sysv/linux/tile/shlib-versions +++ b/sysdeps/unix/sysv/linux/tile/shlib-versions @@ -1,2 +1,2 @@ # glibc 2.12 was released to customers; 2.15 was the first community version. -tile.*-.*-linux-gnu DEFAULT GLIBC_2.12 GLIBC_2.15 +DEFAULT GLIBC_2.12 GLIBC_2.15 diff --git a/sysdeps/unix/sysv/linux/x86_64/64/shlib-versions b/sysdeps/unix/sysv/linux/x86_64/64/shlib-versions index 90ea1b79af..3d28722178 100644 --- a/sysdeps/unix/sysv/linux/x86_64/64/shlib-versions +++ b/sysdeps/unix/sysv/linux/x86_64/64/shlib-versions @@ -1,4 +1,4 @@ -# Configuration DEFAULT Earliest symbol set -# ------------- --------------- ------------------------------ -x86_64-.*-linux.* DEFAULT GLIBC_2.2.5 -x86_64-.*-linux.* libpthread=0 GLIBC_2.2.5 +# DEFAULT Earliest symbol set +# --------------- ------------------------------ +DEFAULT GLIBC_2.2.5 +libpthread=0 GLIBC_2.2.5 diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions b/sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions index 8dd73e487d..e4db8b92ef 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions +++ b/sysdeps/unix/sysv/linux/x86_64/x32/shlib-versions @@ -1,4 +1,4 @@ -# Configuration DEFAULT Earliest symbol set -# ------------- --------------- ------------------------------ -x86_64-.*-linux.* DEFAULT GLIBC_2.16 -x86_64-.*-linux.* libpthread=0 GLIBC_2.16 +# DEFAULT Earliest symbol set +# --------------- ------------------------------ +DEFAULT GLIBC_2.16 +libpthread=0 GLIBC_2.16 -- cgit v1.2.3 From af296fcdaba31c3a8062fec0b4198443bb43bd47 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 16 Sep 2014 17:45:03 +0000 Subject: Remove bitrotten --enable-oldest-abi (bug 6652). This patch removes the --enable-oldest-abi configure option, which has long been bitrotten (as reported in bug 6652). The principle of removing this option was agreed in the thread starting at . Tested for x86_64 and x86 that the installed shared libraries other than libc.so are unchanged by this patch and that libc.so disassembly and symbol versions are unchanged (debug info changes because of changed line numbers in csu/version.c). [BZ #6652] * Makeconfig (soversions-default-setname): Remove variable. ($(common-objpfx)soversions.i): Don't pass default_setname to soversions.awk. * Makerules ($(common-objpfx)abi-versions.h): Don't pass oldest_abi to abi-versions.awk. * config.h.in (GLIBC_OLDEST_ABI): Remove macro undefine. * config.make.in (oldest-abi): Remove variable. * configure.ac (--enable-oldest-abi): Remove configure option. * configure: Regenerated. * csu/version.c (banner) [GLIBC_OLDEST_ABI]: Remove conditional text. * scripts/abi-versions.awk: Do not handle oldest_abi variable. * scripts/soversions.awk: Do not handle default_setname variable. * sysdeps/mach/hurd/configure.ac: Do not handle oldest_abi variable. * sysdeps/mach/hurd/configure: Regenerated. * sysdeps/unix/sysv/linux/configure.ac: Do not handle oldest_abi variable. * sysdeps/unix/sysv/linux/configure: Regenerated. --- ChangeLog | 23 +++++++++++++++++++++++ Makeconfig | 6 +----- Makerules | 2 +- NEWS | 2 +- config.h.in | 3 --- config.make.in | 1 - configure | 21 --------------------- configure.ac | 12 ------------ csu/version.c | 3 --- scripts/abi-versions.awk | 9 --------- scripts/soversions.awk | 2 +- sysdeps/mach/hurd/configure | 10 ---------- sysdeps/mach/hurd/configure.ac | 10 ---------- sysdeps/unix/sysv/linux/configure | 6 ------ sysdeps/unix/sysv/linux/configure.ac | 6 ------ 15 files changed, 27 insertions(+), 89 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 37907ea248..0d96ac4e39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2014-09-16 Joseph Myers + + [BZ #6652] + * Makeconfig (soversions-default-setname): Remove variable. + ($(common-objpfx)soversions.i): Don't pass default_setname to + soversions.awk. + * Makerules ($(common-objpfx)abi-versions.h): Don't pass + oldest_abi to abi-versions.awk. + * config.h.in (GLIBC_OLDEST_ABI): Remove macro undefine. + * config.make.in (oldest-abi): Remove variable. + * configure.ac (--enable-oldest-abi): Remove configure option. + * configure: Regenerated. + * csu/version.c (banner) [GLIBC_OLDEST_ABI]: Remove conditional + text. + * scripts/abi-versions.awk: Do not handle oldest_abi variable. + * scripts/soversions.awk: Do not handle default_setname variable. + * sysdeps/mach/hurd/configure.ac: Do not handle oldest_abi + variable. + * sysdeps/mach/hurd/configure: Regenerated. + * sysdeps/unix/sysv/linux/configure.ac: Do not handle oldest_abi + variable. + * sysdeps/unix/sysv/linux/configure: Regenerated. + 2014-09-16 Siddhesh Poyarekar * elf/Makefile (CFLAGS-interp.c): Remove. diff --git a/Makeconfig b/Makeconfig index 07807880fb..fad29715b6 100644 --- a/Makeconfig +++ b/Makeconfig @@ -958,13 +958,9 @@ $(common-objpfx)shlib-versions.v.i: \ $(subdir-srcdirs:=/shlib-versions)) \ $(..)shlib-versions -soversions-default-setname = $(patsubst %, %,\ - $(filter-out %_default,\ - $(oldest-abi:%=GLIBC_%))) $(common-objpfx)soversions.i: $(..)scripts/soversions.awk \ $(common-objpfx)shlib-versions.v - $(AWK) -v default_setname='$(soversions-default-setname)' \ - -f $^ > $@T + $(AWK) -f $^ > $@T mv -f $@T $@ $(common-objpfx)soversions.mk: $(common-objpfx)soversions.i $(..)Makeconfig (while read which lib number setname; do \ diff --git a/Makerules b/Makerules index 695c9ab597..12d01eed7c 100644 --- a/Makerules +++ b/Makerules @@ -98,7 +98,7 @@ ifndef avoid-generated before-compile := $(common-objpfx)abi-versions.h $(before-compile) $(common-objpfx)abi-versions.h: $(..)scripts/abi-versions.awk \ $(common-objpfx)Versions.all - LC_ALL=C $(AWK) -v oldest_abi=$(oldest-abi) -f $^ > $@T + LC_ALL=C $(AWK) -f $^ > $@T mv -f $@T $@ $(common-objpfx)%.latest: $(common-objpfx)abi-versions.h diff --git a/NEWS b/NEWS index bf8c122499..19ece5a79e 100644 --- a/NEWS +++ b/NEWS @@ -9,7 +9,7 @@ Version 2.21 * The following bugs are resolved with this release: - 17266, 17363, 17370, 17371. + 6652, 17266, 17363, 17370, 17371. Version 2.20 diff --git a/config.h.in b/config.h.in index fcbe8ad808..20c082586d 100644 --- a/config.h.in +++ b/config.h.in @@ -54,9 +54,6 @@ directive. */ #undef HAVE_ASM_POPSECTION_DIRECTIVE -/* Defined to the oldest ABI we support, like 2.1. */ -#undef GLIBC_OLDEST_ABI - /* Define if static NSS modules are wanted. */ #undef DO_STATIC_NSS diff --git a/config.make.in b/config.make.in index 6bcab8adb1..4a781fdc4a 100644 --- a/config.make.in +++ b/config.make.in @@ -68,7 +68,6 @@ output-format = @libc_cv_output_format@ static-libgcc = @libc_cv_gcc_static_libgcc@ -oldest-abi = @oldest_abi@ exceptions = @exceptions@ multi-arch = @multi_arch@ diff --git a/configure b/configure index ff5c730a02..28f2b444cd 100755 --- a/configure +++ b/configure @@ -653,7 +653,6 @@ force_install bindnow enable_lock_elision hardcoded_path_in_tests -oldest_abi use_default_link sysheaders with_fp @@ -737,7 +736,6 @@ with_default_link enable_sanity_checks enable_shared enable_profile -enable_oldest_abi enable_hardcoded_path_in_tests enable_stackguard_randomization enable_lock_elision @@ -1390,8 +1388,6 @@ Optional Features: in special situations) [default=yes] --enable-shared build shared library [default=yes if GNU ld] --enable-profile build profiled library [default=no] - --enable-oldest-abi=ABI configure the oldest ABI supported [e.g. 2.2] - [default=glibc default] --enable-hardcoded-path-in-tests hardcode newly built glibc path in tests [default=no] @@ -3432,23 +3428,6 @@ else fi -# Check whether --enable-oldest-abi was given. -if test "${enable_oldest_abi+set}" = set; then : - enableval=$enable_oldest_abi; oldest_abi=$enableval -else - oldest_abi=no -fi - -if test "$oldest_abi" = yes || test "$oldest_abi" = no; then - oldest_abi=default -else - cat >>confdefs.h <<_ACEOF -#define GLIBC_OLDEST_ABI "$oldest_abi" -_ACEOF - -fi - - # Check whether --enable-hardcoded-path-in-tests was given. if test "${enable_hardcoded_path_in_tests+set}" = set; then : enableval=$enable_hardcoded_path_in_tests; hardcoded_path_in_tests=$enableval diff --git a/configure.ac b/configure.ac index 794ffc2f1d..82d0896c31 100644 --- a/configure.ac +++ b/configure.ac @@ -151,18 +151,6 @@ AC_ARG_ENABLE([profile], [profile=$enableval], [profile=no]) -AC_ARG_ENABLE([oldest-abi], - AC_HELP_STRING([--enable-oldest-abi=ABI], - [configure the oldest ABI supported @<:@e.g. 2.2@:>@ @<:@default=glibc default@:>@]), - [oldest_abi=$enableval], - [oldest_abi=no]) -if test "$oldest_abi" = yes || test "$oldest_abi" = no; then - oldest_abi=default -else - AC_DEFINE_UNQUOTED(GLIBC_OLDEST_ABI, "$oldest_abi") -fi -AC_SUBST(oldest_abi) - AC_ARG_ENABLE([hardcoded-path-in-tests], AC_HELP_STRING([--enable-hardcoded-path-in-tests], [hardcode newly built glibc path in tests @<:@default=no@:>@]), diff --git a/csu/version.c b/csu/version.c index b117b0266b..4238c2fc4a 100644 --- a/csu/version.c +++ b/csu/version.c @@ -34,9 +34,6 @@ Compiled by GNU CC version "__VERSION__".\n" #ifdef LIBC_ABIS_STRING LIBC_ABIS_STRING #endif -#ifdef GLIBC_OLDEST_ABI -"The oldest ABI supported: " GLIBC_OLDEST_ABI ".\n" -#endif "For bug reporting instructions, please see:\n\ "REPORT_BUGS_TO".\n"; diff --git a/scripts/abi-versions.awk b/scripts/abi-versions.awk index 06fa14833c..c369793459 100644 --- a/scripts/abi-versions.awk +++ b/scripts/abi-versions.awk @@ -1,9 +1,6 @@ # Script to generate header file from Versions.all list. # See include/shlib-compat.h comments for explanation. -# This script expects the following variables to be defined: -# oldest_abi the oldest ABI supported - BEGIN { print "/* This file is automatically generated by abi-versions.awk."; print " It defines symbols used by shlib-compat.h, which see. */"; @@ -31,8 +28,6 @@ $2 == "=" { printf "#define ABI_%s_%s\tABI_%s_%s\n", libid, oldid, libid, newid; printf "#define VERSION_%s_%s\t%s\n", libid, oldid, new; - if ("GLIBC_" oldest_abi == old) - oldest_abi = "default"; next; } @@ -43,10 +38,6 @@ $2 == "=" { printf "#define ABI_%s_%s\t%d\t/* support %s */\n", libid, versid, ++n, vers; printf "#define VERSION_%s_%s\t%s\n", libid, versid, vers; - if ("GLIBC_" oldest_abi == vers) - start = 1; - if (start == 0 && oldest_abi != "default") - --n; next; } diff --git a/scripts/soversions.awk b/scripts/soversions.awk index dbc90590e8..247f061bc3 100644 --- a/scripts/soversions.awk +++ b/scripts/soversions.awk @@ -27,7 +27,7 @@ END { if (lib in versions) set = versions[lib]; else { - set = default_setname; + set = ""; if (ndefault_set >= 1) set = default_set[1]; } diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure index 21999f708b..4248758b30 100644 --- a/sysdeps/mach/hurd/configure +++ b/sysdeps/mach/hurd/configure @@ -3,16 +3,6 @@ $as_echo "#define NO_HIDDEN 1" >>confdefs.h -case "$machine" in - i386*) - # The default oldest ABI is 2.2.6. - # We only need a "yes" here if the oldest ABI supported will be < 2.2.6. - if test "$oldest_abi" != default && test "$oldest_abi" \< "2.2.6"; then - libc_cv_gcc_unwind_find_fde=yes - fi - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking Hurd header version" >&5 $as_echo_n "checking Hurd header version... " >&6; } diff --git a/sysdeps/mach/hurd/configure.ac b/sysdeps/mach/hurd/configure.ac index 40b0743a17..b1f16a569e 100644 --- a/sysdeps/mach/hurd/configure.ac +++ b/sysdeps/mach/hurd/configure.ac @@ -3,16 +3,6 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. dnl We need this setting because of the need for PLT calls in ld.so. AC_DEFINE([NO_HIDDEN]) -case "$machine" in - i386*) - # The default oldest ABI is 2.2.6. - # We only need a "yes" here if the oldest ABI supported will be < 2.2.6. - if test "$oldest_abi" != default && test "$oldest_abi" \< "2.2.6"; then - libc_cv_gcc_unwind_find_fde=yes - fi - ;; -esac - AC_CACHE_CHECK(Hurd header version, libc_cv_hurd_version, [dnl AC_TRY_COMPILE(dnl [#include ], [ diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure index 7825ff66ca..ef9d4256d3 100644 --- a/sysdeps/unix/sysv/linux/configure +++ b/sysdeps/unix/sysv/linux/configure @@ -148,12 +148,6 @@ fi -# The result of the above test for the use of the FDE code is invalid if -# the user overrides the decision about the minimum ABI. -if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then - libc_cv_gcc_unwind_find_fde=no -fi - if test -n "$sysheaders"; then CPPFLAGS=$OLD_CPPFLAGS fi diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac index f207c26c77..6738e2d653 100644 --- a/sysdeps/unix/sysv/linux/configure.ac +++ b/sysdeps/unix/sysv/linux/configure.ac @@ -71,12 +71,6 @@ AC_CHECK_HEADER(linux/fanotify.h, [AC_DEFINE(HAVE_LINUX_FANOTIFY_H)], , [/* No default includes. */]) -# The result of the above test for the use of the FDE code is invalid if -# the user overrides the decision about the minimum ABI. -if test "$oldest_abi" != default && test "2.2.4" \< "$oldest_abi"; then - libc_cv_gcc_unwind_find_fde=no -fi - if test -n "$sysheaders"; then CPPFLAGS=$OLD_CPPFLAGS fi -- cgit v1.2.3 From f4a58f0d3577546bb3978b042863ba0ef82a7d18 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 29 Sep 2014 07:45:59 -0700 Subject: Require autoconf 2.69 * aclocal.m4: Require autoconf 2.69. * configure: Regenerated. * sysdeps/aarch64/configure: Likewise. * sysdeps/alpha/configure: Likewise. * sysdeps/arm/armv7/configure: Likewise. * sysdeps/arm/configure: Likewise. * sysdeps/ia64/configure: Likewise. * sysdeps/mach/configure: Likewise. * sysdeps/mips/configure: Likewise. * sysdeps/s390/configure: Likewise. * sysdeps/unix/sysv/linux/mips/configure: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: Likewise. * sysdeps/alpha/configure.ac: Avoid empty lines at the end of file. * sysdeps/ia64/configure.ac: Likewise. --- ChangeLog | 19 ++ aclocal.m4 | 2 +- configure | 239 +++++++++++---------- sysdeps/aarch64/configure | 4 +- sysdeps/alpha/configure | 2 + sysdeps/alpha/configure.ac | 1 + sysdeps/arm/armv7/configure | 2 +- sysdeps/arm/configure | 4 +- sysdeps/ia64/configure | 4 +- sysdeps/ia64/configure.ac | 1 + sysdeps/mach/configure | 8 +- sysdeps/mips/configure | 4 +- sysdeps/s390/configure | 2 +- sysdeps/unix/sysv/linux/mips/configure | 4 +- .../unix/sysv/linux/powerpc/powerpc64/configure | 4 +- 15 files changed, 168 insertions(+), 132 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 3195d51352..dce2bbb639 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2014-09-29 H.J. Lu + + * aclocal.m4: Require autoconf 2.69. + * configure: Regenerated. + * sysdeps/aarch64/configure: Likewise. + * sysdeps/alpha/configure: Likewise. + * sysdeps/arm/armv7/configure: Likewise. + * sysdeps/arm/configure: Likewise. + * sysdeps/ia64/configure: Likewise. + * sysdeps/mach/configure: Likewise. + * sysdeps/mips/configure: Likewise. + * sysdeps/s390/configure: Likewise. + * sysdeps/unix/sysv/linux/mips/configure: Likewise. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/configure: Likewise. + + * sysdeps/alpha/configure.ac: Avoid empty lines at the end of + file. + * sysdeps/ia64/configure.ac: Likewise. + 2014-09-26 Joseph Myers * sysdeps/unix/sysv/linux/powerpc/powerpc64/shlib-versions: Do not diff --git a/aclocal.m4 b/aclocal.m4 index 98b9987921..23569b65f7 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,7 +1,7 @@ dnl We require that everyone use exactly the same Autoconf version so that dnl the internal functions defined and used by the main configure script dnl match those expected by the fragments. -m4_define([GLIBC_AUTOCONF_VERSION], [2.68]) +m4_define([GLIBC_AUTOCONF_VERSION], [2.69]) m4_if(m4_defn([AC_AUTOCONF_VERSION]), GLIBC_AUTOCONF_VERSION, [], [m4_fatal(m4_flatten( Exactly version GLIBC_AUTOCONF_VERSION of Autoconf is required but you have diff --git a/configure b/configure index 28f2b444cd..89566c54c6 100755 --- a/configure +++ b/configure @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for GNU C Library (see version.h). +# Generated by GNU Autoconf 2.69 for GNU C Library (see version.h). # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -214,21 +238,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -331,6 +359,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -452,6 +488,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -486,16 +526,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -507,28 +547,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -1224,8 +1244,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1517,9 +1535,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GNU C Library configure (see version.h) -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1633,7 +1651,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -1711,7 +1729,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1727,7 +1746,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1753,7 +1773,8 @@ int main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1769,7 +1790,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1803,7 +1825,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -1876,7 +1899,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GNU C Library $as_me (see version.h), which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2426,7 +2449,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2466,7 +2489,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2519,7 +2542,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2560,7 +2583,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2618,7 +2641,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2662,7 +2685,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2925,7 +2948,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_BUILD_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2988,7 +3011,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3032,7 +3055,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3234,7 +3257,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_READELF="${ac_tool_prefix}readelf" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3274,7 +3297,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_READELF="readelf" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4320,7 +4343,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -4465,7 +4488,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4528,7 +4551,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LD="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4594,7 +4617,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4657,7 +4680,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4721,7 +4744,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MSGFMT="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4784,7 +4807,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKEINFO="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4847,7 +4870,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_SED="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4910,7 +4933,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4973,7 +4996,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="${ac_tool_prefix}nm" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5013,7 +5036,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NM="nm" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5068,7 +5091,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AUTOCONF="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5214,7 +5237,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_BASH_SHELL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5256,7 +5279,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5302,7 +5325,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5344,7 +5367,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -7554,16 +7577,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -7623,28 +7646,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -7666,7 +7677,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by GNU C Library $as_me (see version.h), which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7734,10 +7745,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ GNU C Library config.status (see version.h) -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -7826,7 +7837,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' diff --git a/sysdeps/aarch64/configure b/sysdeps/aarch64/configure index af870b7b49..5bd355a691 100644 --- a/sysdeps/aarch64/configure +++ b/sysdeps/aarch64/configure @@ -26,7 +26,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -92,7 +92,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in diff --git a/sysdeps/alpha/configure b/sysdeps/alpha/configure index f1e4103dd0..464b596527 100644 --- a/sysdeps/alpha/configure +++ b/sysdeps/alpha/configure @@ -4,3 +4,5 @@ # With required gcc+binutils, we can always access static and hidden # symbols in a position independent way. $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h + +# work around problem with autoconf and empty lines at the end of files diff --git a/sysdeps/alpha/configure.ac b/sysdeps/alpha/configure.ac index eadc57afe3..38e52e71ac 100644 --- a/sysdeps/alpha/configure.ac +++ b/sysdeps/alpha/configure.ac @@ -4,3 +4,4 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. # With required gcc+binutils, we can always access static and hidden # symbols in a position independent way. AC_DEFINE(PI_STATIC_AND_HIDDEN) +# work around problem with autoconf and empty lines at the end of files diff --git a/sysdeps/arm/armv7/configure b/sysdeps/arm/armv7/configure index 46e5d52df4..fc8f43436d 100644 --- a/sysdeps/arm/armv7/configure +++ b/sysdeps/arm/armv7/configure @@ -21,7 +21,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure index fe86006569..238b335f7d 100644 --- a/sysdeps/arm/configure +++ b/sysdeps/arm/configure @@ -28,7 +28,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -94,7 +94,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in diff --git a/sysdeps/ia64/configure b/sysdeps/ia64/configure index 7b411db3ec..1ef70921bc 100644 --- a/sysdeps/ia64/configure +++ b/sysdeps/ia64/configure @@ -1,4 +1,6 @@ # This file is generated from configure.ac by Autoconf. DO NOT EDIT! -# Local configure fragment for sysdeps/ia64. + # Local configure fragment for sysdeps/ia64. $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h + +# work around problem with autoconf and empty lines at the end of files diff --git a/sysdeps/ia64/configure.ac b/sysdeps/ia64/configure.ac index 4ad04ff2f7..3bae9fc5e1 100644 --- a/sysdeps/ia64/configure.ac +++ b/sysdeps/ia64/configure.ac @@ -4,3 +4,4 @@ GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. dnl It is always possible to access static and hidden symbols in an dnl position independent way. AC_DEFINE(PI_STATIC_AND_HIDDEN) +# work around problem with autoconf and empty lines at the end of files diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure index 61ac7d9684..228f99ef9e 100644 --- a/sysdeps/mach/configure +++ b/sysdeps/mach/configure @@ -84,7 +84,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MIG="${ac_tool_prefix}mig" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -124,7 +124,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MIG="mig" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -311,7 +311,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -377,7 +377,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in diff --git a/sysdeps/mips/configure b/sysdeps/mips/configure index f3f5d2e00d..4e13248c03 100644 --- a/sysdeps/mips/configure +++ b/sysdeps/mips/configure @@ -20,7 +20,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -86,7 +86,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in diff --git a/sysdeps/s390/configure b/sysdeps/s390/configure index 6948cc2190..be6397e271 100644 --- a/sysdeps/s390/configure +++ b/sysdeps/s390/configure @@ -22,7 +22,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure index 7fac4f423e..6db1f80a4f 100644 --- a/sysdeps/unix/sysv/linux/mips/configure +++ b/sysdeps/unix/sysv/linux/mips/configure @@ -122,7 +122,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -188,7 +188,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure index eb46415e2d..70bb18ad51 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/configure @@ -33,7 +33,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -99,7 +99,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in -- cgit v1.2.3 From 461a7b1e4551ee9018f7542c21ff32b0f9872e7f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 24 Oct 2014 14:45:47 -0700 Subject: Rework compiler version check in configure. --- ChangeLog | 5 ++++ configure | 96 +++++++++++++++++++++--------------------------------------- configure.ac | 13 ++++++-- 3 files changed, 48 insertions(+), 66 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index b52ff14f95..149ecc41ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2014-10-24 Roland McGrath + * configure.ac: Validate compiler version with a empirical test of + __GNUC__ and __GNUC_MINOR__ predefined values, rather than by grepping + $CC -v output. + * configure: Regenerated. + * inet/htons.c (htons): Prototypify. * inet/htonl.c (htonl): Likewise. diff --git a/configure b/configure index 89566c54c6..24888d990b 100755 --- a/configure +++ b/configure @@ -4599,69 +4599,6 @@ fi # These programs are version sensitive. -for ac_prog in ${ac_tool_prefix}gcc ${ac_tool_prefix}cc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break -done - -if test -z "$CC"; then - ac_verc_fail=yes -else - # Found it, now check the version. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $CC" >&5 -$as_echo_n "checking version of $CC... " >&6; } - ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 4.[4-9].* | 4.[1-9][0-9].* | [5-9].* ) - ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; - *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; - - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 -$as_echo "$ac_prog_version" >&6; } -fi -if test $ac_verc_fail = yes; then - critic_missing="$critic_missing gcc" -fi - for ac_prog in gnumake gmake make do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -4979,6 +4916,39 @@ if test $ac_verc_fail = yes; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC is sufficient to build libc" >&5 +$as_echo_n "checking if $CC is sufficient to build libc... " >&6; } +if ${libc_cv_compiler_ok+:} false; then : + $as_echo_n "(cached) " >&6 +else + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + +#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) +#error insufficient compiler +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_cv_compiler_ok=yes +else + libc_cv_compiler_ok=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_compiler_ok" >&5 +$as_echo "$libc_cv_compiler_ok" >&6; } +if test $libc_cv_compiler_ok != yes; then : + critic_missing="$critic_missing compiler" +fi + if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 diff --git a/configure.ac b/configure.ac index 82d0896c31..9dd2c686a7 100644 --- a/configure.ac +++ b/configure.ac @@ -910,9 +910,6 @@ AC_CHECK_PROG_VER(LD, $LD, --version, # These programs are version sensitive. AC_CHECK_TOOL_PREFIX -AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v, - [version \([egcygnustpi-]*[0-9.]*\)], [4.[4-9].* | 4.[1-9][0-9].* | [5-9].* ], - critic_missing="$critic_missing gcc") AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version, [GNU Make[^0-9]*\([0-9][0-9.]*\)], [3.79* | 3.[89]* | [4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make") @@ -933,6 +930,16 @@ AC_CHECK_PROG_VER(AWK, gawk, --version, [GNU Awk[^0-9]*\([0-9][0-9.]*\)], [3.1.[2-9]*|3.[2-9]*|[4-9]*], critic_missing="$critic_missing gawk") +AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [ +AC_TRY_COMPILE([], [ +#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) +#error insufficient compiler +#endif], + [libc_cv_compiler_ok=yes], + [libc_cv_compiler_ok=no])]) +AS_IF([test $libc_cv_compiler_ok != yes], + [critic_missing="$critic_missing compiler"]) + AC_CHECK_TOOL(NM, nm, false) if test "x$maintainer" = "xyes"; then -- cgit v1.2.3 From bd80507166253107ce84245c8c93d95368abc982 Mon Sep 17 00:00:00 2001 From: Andrew Senkevich Date: Mon, 10 Nov 2014 11:16:46 -0800 Subject: Update minimal required bunutils version to 2.22 --- ChangeLog | 9 +++++++++ INSTALL | 2 +- configure | 6 +++--- configure.ac | 8 +++++--- manual/install.texi | 2 +- 5 files changed, 19 insertions(+), 8 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 3acd7ba02d..3f65700a1a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2014-11-10 Andrew Senkevich + + * configure.ac: Updated check of minimal required version to + 2.22. + * manual/install.texi (Tools for Compilation): Updated version + number. + * configure: Regenerated. + * INSTALL: Likewise. + 2014-11-07 Andreas Schwab * sysdeps/unix/sysv/linux/m68k/localplt.data (ld.so): Remove diff --git a/INSTALL b/INSTALL index f85e461e77..3130c2a27c 100644 --- a/INSTALL +++ b/INSTALL @@ -340,7 +340,7 @@ build the GNU C Library: Check the FAQ for any special compiler issues on particular platforms. - * GNU `binutils' 2.20 or later + * GNU `binutils' 2.22 or later You must use GNU `binutils' (as and ld) to build the GNU C Library. No other assembler or linker has the necessary functionality at the diff --git a/configure b/configure index 24888d990b..3c161be38b 100755 --- a/configure +++ b/configure @@ -4469,7 +4469,7 @@ $as_echo "$libc_cv_prog_ld_gnu" >&6; } gnu_ld=$libc_cv_prog_ld_gnu -# Accept binutils 2.20 or newer. +# Accept binutils 2.22 or newer. for ac_prog in $AS do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -4521,7 +4521,7 @@ $as_echo_n "checking version of $AS... " >&6; } ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*) + 2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; @@ -4584,7 +4584,7 @@ $as_echo_n "checking version of $LD... " >&6; } ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*) + 2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; diff --git a/configure.ac b/configure.ac index 9dd2c686a7..a982407d48 100644 --- a/configure.ac +++ b/configure.ac @@ -900,13 +900,15 @@ AC_PROG_LN_S LIBC_PROG_BINUTILS -# Accept binutils 2.20 or newer. +# Accept binutils 2.22 or newer. AC_CHECK_PROG_VER(AS, $AS, --version, [GNU assembler.* \([0-9]*\.[0-9.]*\)], - [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], AS=: critic_missing="$critic_missing as") + [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], + AS=: critic_missing="$critic_missing as") AC_CHECK_PROG_VER(LD, $LD, --version, [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)], - [2.1[0-9][0-9]*|2.[2-9][0-9]*|[3-9].*|[1-9][0-9]*], LD=: critic_missing="$critic_missing ld") + [2.1[0-9][0-9]*|2.2[2-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*], + LD=: critic_missing="$critic_missing ld") # These programs are version sensitive. AC_CHECK_TOOL_PREFIX diff --git a/manual/install.texi b/manual/install.texi index 57e4d22b4b..e1c2b9a2a4 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -383,7 +383,7 @@ You can use whatever compiler you like to compile programs that use Check the FAQ for any special compiler issues on particular platforms. @item -GNU @code{binutils} 2.20 or later +GNU @code{binutils} 2.22 or later You must use GNU @code{binutils} (as and ld) to build @theglibc{}. No other assembler or linker has the necessary functionality at the -- cgit v1.2.3 From 4863355ad52b71fecd7529928999074afdc4d51f Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 14 Nov 2014 18:00:34 +0000 Subject: Require GCC 4.6 or later to build glibc. As discussed in the thread starting at , and continuing into November, this patch increases the minimum GCC version for building glibc to 4.6 (there seemed to be no clear consensus for 4.7). In particular, this allows us to use #pragma GCC diagnostic for fine-grained warning control with -Werror (subject to establishing a suitable policy for that use). The documentation has a statement, as requested, about the most recent GCC version tested for building glibc, and I've updated to refer to updating that statement. A NEWS entry is added for this change, although previous such changes didn't get them. Tested for x86_64 (testsuite, and that installed shared libraries are unchanged by this patch). * configure.ac (libc_cv_compiler_ok): Require GCC 4.6 or later. * configure: Regenerated. * manual/install.texi (Tools for Compilation): Document a requirement of GCC 4.6 or later and that GCC 4.9 is the newest compiler verified to work. * INSTALL: Regenerated. --- ChangeLog | 7 +++++++ INSTALL | 9 ++++++--- NEWS | 4 ++++ configure | 2 +- configure.ac | 2 +- manual/install.texi | 9 ++++++--- 6 files changed, 25 insertions(+), 8 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 8448f28f23..496467e1c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2014-11-14 Joseph Myers + * configure.ac (libc_cv_compiler_ok): Require GCC 4.6 or later. + * configure: Regenerated. + * manual/install.texi (Tools for Compilation): Document a + requirement of GCC 4.6 or later and that GCC 4.9 is the newest + compiler verified to work. + * INSTALL: Regenerated. + * include/string.h [NO_MEMPCPY_STPCPY_REDIRECT] (mempcpy): Do not redeclare with asm name. [NO_MEMPCPY_STPCPY_REDIRECT] (stpcpy): Likewise. diff --git a/INSTALL b/INSTALL index 3130c2a27c..dac6178bac 100644 --- a/INSTALL +++ b/INSTALL @@ -329,10 +329,13 @@ build the GNU C Library: recommend GNU `make' version 3.79. All earlier versions have severe bugs or lack features. - * GCC 4.4 or newer, GCC 4.6 recommended + * GCC 4.6 or newer - GCC 4.4 or higher is required; as of this writing, GCC 4.6 is the - compiler we advise to use to build the GNU C Library. + GCC 4.6 or higher is required. In general it is recommended to use + the newest version of the compiler that is known to work for + building the GNU C Library, as newer compilers usually produce + better code. As of release time, GCC 4.9 is the newest compiler + verified to work to build the GNU C Library. You can use whatever compiler you like to compile programs that use the GNU C Library. diff --git a/NEWS b/NEWS index c582c8e559..867d659afb 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ Version 2.21 17555, 17570, 17571, 17572, 17573, 17574, 17582, 17583, 17584, 17585, 17589, 17594. +* The minimum GCC version that can be used to build this version of the GNU + C Library is GCC 4.6. Older GCC versions, and non-GNU compilers, can + still be used to compile programs using the GNU C Library. + * New locales: tu_IN, bh_IN. Version 2.20 diff --git a/configure b/configure index 3c161be38b..0cb54ec363 100755 --- a/configure +++ b/configure @@ -4929,7 +4929,7 @@ int main () { -#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) +#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) #error insufficient compiler #endif ; diff --git a/configure.ac b/configure.ac index a982407d48..b2c4b1fab8 100644 --- a/configure.ac +++ b/configure.ac @@ -934,7 +934,7 @@ AC_CHECK_PROG_VER(AWK, gawk, --version, AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [ AC_TRY_COMPILE([], [ -#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) +#if !defined __GNUC__ || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) #error insufficient compiler #endif], [libc_cv_compiler_ok=yes], diff --git a/manual/install.texi b/manual/install.texi index e1c2b9a2a4..1eafb6ec32 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -372,10 +372,13 @@ recommend GNU @code{make} version 3.79. All earlier versions have severe bugs or lack features. @item -GCC 4.4 or newer, GCC 4.6 recommended +GCC 4.6 or newer -GCC 4.4 or higher is required; as of this writing, GCC 4.6 is the -compiler we advise to use to build @theglibc{}. +GCC 4.6 or higher is required. In general it is recommended to use +the newest version of the compiler that is known to work for building +@theglibc{}, as newer compilers usually produce better code. As of +release time, GCC 4.9 is the newest compiler verified to work to build +@theglibc{}. You can use whatever compiler you like to compile programs that use @theglibc{}. -- cgit v1.2.3 From a4ecc9eb9b15bc51a1dc4726c06d35eaea74e162 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 10 Dec 2014 01:14:48 +0000 Subject: Use -Werror by default, add --disable-werror. As discussed starting at , this patch makes the glibc build use -Werror by default to avoid accidentally adding new warnings to the build. The configure option --disable-werror can be used to disable this. -Wno-error=undef is temporarily used because the build isn't clean regarding -Wundef warnings. The idea is that once the remaining -Wundef warnings have been cleaned up (in at least one configuration), -Wno-error=undef will be removed. I get a clean build and test on x86_64 (GCC 4.9 branch) with this patch. The expectation is that this may well break the build for some other configurations, and people seeing such breakage should make appropriate fixes to fix or suppress the warnings for their configurations. In some cases that may involve using pragmas as the right fix (I think that will be right for the -Wno-inline issue for MIPS I referred to in , for example), in some cases -Wno-error in sysdeps makefiles (__restore_rt in MIPS sigaction, for example), in some cases substantive fixes for the warnings. Note that if, with a view to listing all the warnings then fixing them all, you just look for "warning:" in output from building and testing with --disable-werror, you'll see lots of warnings from the linker about functions such as tmpnam. Those warnings can be ignored - only compiler warnings are relevant to -Werror, not linker warnings. * configure.ac (--disable-werror): New configure option. (enable_werror): New AC_SUBST. * configure: Regenerated. * config.make.in (enable-werror): New variable. * Makeconfig [$(enable-werror) = yes] (+gccwarn): Add -Werror -Wno-error=undef. (+gccwarn-c): Do not use -Werror=implicit-function-declaration. * manual/install.texi (Configuring and compiling): Document --disable-werror. * INSTALL: Regenerated. * debug/Makefile (CFLAGS-tst-chk1.c): Add -Wno-error. (CFLAGS-tst-chk2.c): Likewise. (CFLAGS-tst-chk3.c): Likewise. (CFLAGS-tst-chk4.cc): Likewise. (CFLAGS-tst-chk5.cc): Likewise. (CFLAGS-tst-chk6.cc): Likewise. (CFLAGS-tst-lfschk1.c): Likewise. (CFLAGS-tst-lfschk2.c): Likewise. (CFLAGS-tst-lfschk3.c): Likewise. (CFLAGS-tst-lfschk4.cc): Likewise. (CFLAGS-tst-lfschk5.cc): Likewise. (CFLAGS-tst-lfschk6.cc): Likewise. --- ChangeLog | 23 +++++++++++++++++++++++ INSTALL | 7 +++++++ Makeconfig | 5 ++++- NEWS | 3 +++ config.make.in | 1 + configure | 12 ++++++++++++ configure.ac | 7 +++++++ debug/Makefile | 28 +++++++++++++++------------- manual/install.texi | 7 +++++++ 9 files changed, 79 insertions(+), 14 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 1014ba3dff..f8652231de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,28 @@ 2014-12-10 Joseph Myers + * configure.ac (--disable-werror): New configure option. + (enable_werror): New AC_SUBST. + * configure: Regenerated. + * config.make.in (enable-werror): New variable. + * Makeconfig [$(enable-werror) = yes] (+gccwarn): Add -Werror + -Wno-error=undef. + (+gccwarn-c): Do not use -Werror=implicit-function-declaration. + * manual/install.texi (Configuring and compiling): Document + --disable-werror. + * INSTALL: Regenerated. + * debug/Makefile (CFLAGS-tst-chk1.c): Add -Wno-error. + (CFLAGS-tst-chk2.c): Likewise. + (CFLAGS-tst-chk3.c): Likewise. + (CFLAGS-tst-chk4.cc): Likewise. + (CFLAGS-tst-chk5.cc): Likewise. + (CFLAGS-tst-chk6.cc): Likewise. + (CFLAGS-tst-lfschk1.c): Likewise. + (CFLAGS-tst-lfschk2.c): Likewise. + (CFLAGS-tst-lfschk3.c): Likewise. + (CFLAGS-tst-lfschk4.cc): Likewise. + (CFLAGS-tst-lfschk5.cc): Likewise. + (CFLAGS-tst-lfschk6.cc): Likewise. + * stdio-common/tst-printfsz.c: Include . (main): Disable -Wdeprecated-declarations around calls to register_printf_function. diff --git a/INSTALL b/INSTALL index dac6178bac..dd5c34aadb 100644 --- a/INSTALL +++ b/INSTALL @@ -143,6 +143,13 @@ will be used, and CFLAGS sets optimization options for the compiler. additional security risks to the system and you should enable it only if you understand and accept those risks. +`--disable-werror' + By default, the GNU C Library is built with `-Werror'. If you wish + to build without this option (for example, if building with a newer + version of GCC than this version of the GNU C Library was tested + with, so new warnings cause the build with `-Werror' to fail), you + can configure with `--disable-werror'. + `--build=BUILD-SYSTEM' `--host=HOST-SYSTEM' These options are for cross-compiling. If you specify both diff --git a/Makeconfig b/Makeconfig index bbf546072c..15553681a0 100644 --- a/Makeconfig +++ b/Makeconfig @@ -717,7 +717,10 @@ else +gccwarn := -Wall -Wwrite-strings -Winline endif +gccwarn += -Wundef -+gccwarn-c = -Wstrict-prototypes -Werror=implicit-function-declaration +ifeq ($(enable-werror),yes) ++gccwarn += -Werror -Wno-error=undef +endif ++gccwarn-c = -Wstrict-prototypes # We do not depend on the address of constants in different files to be # actually different, so allow the compiler to merge them all. diff --git a/NEWS b/NEWS index 1b08d40a68..2cc4a611dc 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,9 @@ Version 2.21 C Library is GCC 4.6. Older GCC versions, and non-GNU compilers, can still be used to compile programs using the GNU C Library. +* The GNU C Library is now built with -Werror by default. This can be + disabled by configuring with --disable-werror. + * New locales: tu_IN, bh_IN, raj_IN, ce_RU. * The obsolete sigvec function has been removed. This was the original diff --git a/config.make.in b/config.make.in index 4a781fdc4a..ad4dd30607 100644 --- a/config.make.in +++ b/config.make.in @@ -45,6 +45,7 @@ sysheaders = @sysheaders@ sysincludes = @SYSINCLUDES@ c++-sysincludes = @CXX_SYSINCLUDES@ all-warnings = @all_warnings@ +enable-werror = @enable_werror@ have-z-combreloc = @libc_cv_z_combreloc@ have-z-execstack = @libc_cv_z_execstack@ diff --git a/configure b/configure index 0cb54ec363..b1fda3867a 100755 --- a/configure +++ b/configure @@ -668,6 +668,7 @@ build_pt_chown build_nscd link_obsolete_rpc libc_cv_nss_crypt +enable_werror all_warnings force_install bindnow @@ -767,6 +768,7 @@ enable_force_install enable_maintainer_mode enable_kernel enable_all_warnings +enable_werror enable_multi_arch enable_nss_crypt enable_obsolete_rpc @@ -1428,6 +1430,7 @@ Optional Features: --enable-kernel=VERSION compile for compatibility with kernel not older than VERSION --enable-all-warnings enable all useful warnings gcc can issue + --disable-werror do not build with -Werror --enable-multi-arch enable single DSO with optimizations for multiple architectures --enable-nss-crypt enable libcrypt to use nss @@ -3565,6 +3568,15 @@ fi +# Check whether --enable-werror was given. +if test "${enable_werror+set}" = set; then : + enableval=$enable_werror; enable_werror=$enableval +else + enable_werror=yes +fi + + + # Check whether --enable-multi-arch was given. if test "${enable_multi_arch+set}" = set; then : enableval=$enable_multi_arch; multi_arch=$enableval diff --git a/configure.ac b/configure.ac index b2c4b1fab8..784e360382 100644 --- a/configure.ac +++ b/configure.ac @@ -253,6 +253,13 @@ AC_ARG_ENABLE([all-warnings], []) AC_SUBST(all_warnings) +AC_ARG_ENABLE([werror], + AC_HELP_STRING([--disable-werror], + [do not build with -Werror]), + [enable_werror=$enableval], + [enable_werror=yes]) +AC_SUBST(enable_werror) + AC_ARG_ENABLE([multi-arch], AC_HELP_STRING([--enable-multi-arch], [enable single DSO with optimizations for multiple architectures]), diff --git a/debug/Makefile b/debug/Makefile index 3ddcd1e1c3..96c21d5d40 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -96,19 +96,21 @@ CFLAGS-tst-longjmp_chk3.c = -fexceptions -fasynchronous-unwind-tables CPPFLAGS-tst-longjmp_chk3.c = -D_FORTIFY_SOURCE=1 # We know these tests have problems with format strings, this is what -# we are testing. Disable that warning. -CFLAGS-tst-chk1.c = -Wno-format -CFLAGS-tst-chk2.c = -Wno-format -CFLAGS-tst-chk3.c = -Wno-format -CFLAGS-tst-chk4.cc = -Wno-format -CFLAGS-tst-chk5.cc = -Wno-format -CFLAGS-tst-chk6.cc = -Wno-format -CFLAGS-tst-lfschk1.c = -Wno-format -CFLAGS-tst-lfschk2.c = -Wno-format -CFLAGS-tst-lfschk3.c = -Wno-format -CFLAGS-tst-lfschk4.cc = -Wno-format -CFLAGS-tst-lfschk5.cc = -Wno-format -CFLAGS-tst-lfschk6.cc = -Wno-format +# we are testing. Disable that warning. They also generate warnings +# from warning attributes, which cannot be disabled via pragmas, so +# require -Wno-error to be used. +CFLAGS-tst-chk1.c = -Wno-format -Wno-error +CFLAGS-tst-chk2.c = -Wno-format -Wno-error +CFLAGS-tst-chk3.c = -Wno-format -Wno-error +CFLAGS-tst-chk4.cc = -Wno-format -Wno-error +CFLAGS-tst-chk5.cc = -Wno-format -Wno-error +CFLAGS-tst-chk6.cc = -Wno-format -Wno-error +CFLAGS-tst-lfschk1.c = -Wno-format -Wno-error +CFLAGS-tst-lfschk2.c = -Wno-format -Wno-error +CFLAGS-tst-lfschk3.c = -Wno-format -Wno-error +CFLAGS-tst-lfschk4.cc = -Wno-format -Wno-error +CFLAGS-tst-lfschk5.cc = -Wno-format -Wno-error +CFLAGS-tst-lfschk6.cc = -Wno-format -Wno-error LDLIBS-tst-chk4 = -lstdc++ LDLIBS-tst-chk5 = -lstdc++ LDLIBS-tst-chk6 = -lstdc++ diff --git a/manual/install.texi b/manual/install.texi index 1eafb6ec32..35467b1b16 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -174,6 +174,13 @@ setuid and owned by @code{root}. The use of @file{pt_chown} introduces additional security risks to the system and you should enable it only if you understand and accept those risks. +@item --disable-werror +By default, @theglibc{} is built with @option{-Werror}. If you wish +to build without this option (for example, if building with a newer +version of GCC than this version of @theglibc{} was tested with, so +new warnings cause the build with @option{-Werror} to fail), you can +configure with @option{--disable-werror}. + @item --build=@var{build-system} @itemx --host=@var{host-system} These options are for cross-compiling. If you specify both options and -- cgit v1.2.3 From 3a12c70f137707074209241e6c6172ea25f9ab4a Mon Sep 17 00:00:00 2001 From: Will Newton Date: Thu, 11 Dec 2014 17:59:45 +0000 Subject: Bump required version of texinfo to 4.7 It seems we require texinfo 4.7 for the --plaintext option, so document that and check for the correct version in configure. ChangeLog: 2014-12-15 Will Newton * manual/install.texi: Bump required version of texinfo to 4.7 from 4.5. * INSTALL: Regenerated. * configure.ac: Check for makeinfo version 4.7 and above. * configure: Regenerated. --- ChangeLog | 8 ++++++++ INSTALL | 2 +- configure | 2 +- configure.ac | 2 +- manual/install.texi | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index e973b556e3..b40f6f8953 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-12-15 Will Newton + + * manual/install.texi: Bump required version of texinfo + to 4.7 from 4.5. + * INSTALL: Regenerated. + * configure.ac: Check for makeinfo version 4.7 and above. + * configure: Regenerated. + 2014-12-12 Roland McGrath * sysdeps/posix/shm-directory.h (SHM_GET_NAME): Take new argument diff --git a/INSTALL b/INSTALL index dd5c34aadb..35f70e0f5e 100644 --- a/INSTALL +++ b/INSTALL @@ -356,7 +356,7 @@ build the GNU C Library: No other assembler or linker has the necessary functionality at the moment. - * GNU `texinfo' 4.5 or later + * GNU `texinfo' 4.7 or later To correctly translate and install the Texinfo documentation you need this version of the `texinfo' package. Earlier versions do diff --git a/configure b/configure index b1fda3867a..cde55de15f 100755 --- a/configure +++ b/configure @@ -4789,7 +4789,7 @@ $as_echo_n "checking version of $MAKEINFO... " >&6; } ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'` case $ac_prog_version in '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 4.[5-9]*|4.[1-9][0-9]*|[5-9].*) + 4.[7-9]*|4.[1-9][0-9]*|[5-9].*) ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; diff --git a/configure.ac b/configure.ac index 784e360382..f1e6394e7e 100644 --- a/configure.ac +++ b/configure.ac @@ -929,7 +929,7 @@ AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version, MSGFMT=: aux_missing="$aux_missing msgfmt") AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, [GNU texinfo.* \([0-9][0-9.]*\)], - [4.[5-9]*|4.[1-9][0-9]*|[5-9].*], + [4.[7-9]*|4.[1-9][0-9]*|[5-9].*], MAKEINFO=: aux_missing="$aux_missing makeinfo") AC_CHECK_PROG_VER(SED, sed, --version, [GNU sed[^0-9]* \([0-9]*\.[0-9.]*\)], diff --git a/manual/install.texi b/manual/install.texi index 35467b1b16..2b9b57ca32 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -400,7 +400,7 @@ No other assembler or linker has the necessary functionality at the moment. @item -GNU @code{texinfo} 4.5 or later +GNU @code{texinfo} 4.7 or later To correctly translate and install the Texinfo documentation you need this version of the @code{texinfo} package. Earlier versions do not -- cgit v1.2.3 From cc8623f196cd5d1c82573b34cb3a6a56f712790a Mon Sep 17 00:00:00 2001 From: Will Newton Date: Thu, 11 Dec 2014 17:27:34 +0000 Subject: Require bison 2.7 or newer for regenerating intl/plural.y The merge of the latest gettext code introduced changes to the yacc parser source that are incompatible with versions of bison older than 2.7. Add a configure check for the appropriate versions and document the requirement in INSTALL. ChangeLog: 2014-12-22 Will Newton * manual/install.texi: Document that we require bison 2.7 or above. * INSTALL: Regenerate. * configure.ac: Use AC_CHECK_PROG_VER instead of AC_PATH_PROG when checking for bison and check for version 2.7 or above. * configure: Regenerate. --- ChangeLog | 10 ++++++++++ INSTALL | 5 +++++ configure | 53 +++++++++++++++++++++++++++++++++++++---------------- configure.ac | 5 ++++- manual/install.texi | 9 +++++++++ 5 files changed, 65 insertions(+), 17 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index d488679832..99c248c575 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2014-12-22 Will Newton + + * manual/install.texi: Document that we require bison 2.7 + or above. + * INSTALL: Regenerate. + * configure.ac: Use AC_CHECK_PROG_VER instead of + AC_PATH_PROG when checking for bison and check for + version 2.7 or above. + * configure: Regenerate. + 2014-12-21 Chris Metcalf * sysdeps/tile/ffs.c (__ffs): Moved ffsll definition... diff --git a/INSTALL b/INSTALL index 35f70e0f5e..8e5a4a191b 100644 --- a/INSTALL +++ b/INSTALL @@ -393,6 +393,11 @@ and if you change any of the message translation files you will need * GNU `gettext' 0.10.36 or later +If you wish to regenerate the `yacc' parser code in the `intl' +subdirectory you will need + + * GNU `bison' 2.7 or later + You may also need these packages if you upgrade your source tree using patches, although we try to avoid this. diff --git a/configure b/configure index cde55de15f..ce0c6a01f1 100755 --- a/configure +++ b/configure @@ -5330,27 +5330,26 @@ $as_echo "no" >&6; } fi -# Extract the first word of "bison", so it can be a program name with args. -set dummy bison; ac_word=$2 +for ac_prog in bison +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_BISON+:} false; then : +if ${ac_cv_prog_BISON+:} false; then : $as_echo_n "(cached) " >&6 else - case $BISON in - [\\/]* | ?:[\\/]*) - ac_cv_path_BISON="$BISON" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_dummy="$PATH:/usr/local/bin:/usr/bin:/bin" -for as_dir in $as_dummy + if test -n "$BISON"; then + ac_cv_prog_BISON="$BISON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_BISON="$as_dir/$ac_word$ac_exec_ext" + ac_cv_prog_BISON="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5358,11 +5357,9 @@ done done IFS=$as_save_IFS - test -z "$ac_cv_path_BISON" && ac_cv_path_BISON="no" - ;; -esac fi -BISON=$ac_cv_path_BISON +fi +BISON=$ac_cv_prog_BISON if test -n "$BISON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5 $as_echo "$BISON" >&6; } @@ -5372,6 +5369,30 @@ $as_echo "no" >&6; } fi + test -n "$BISON" && break +done + +if test -z "$BISON"; then + ac_verc_fail=yes +else + # Found it, now check the version. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking version of $BISON" >&5 +$as_echo_n "checking version of $BISON... " >&6; } + ac_prog_version=`$BISON --version 2>&1 | sed -n 's/^.*bison (GNU Bison) \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.7*|[3-9].*|[1-9][0-9]*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5 +$as_echo "$ac_prog_version" >&6; } +fi +if test $ac_verc_fail = yes; then + BISON=no +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libc-friendly stddef.h" >&5 $as_echo_n "checking for libc-friendly stddef.h... " >&6; } diff --git a/configure.ac b/configure.ac index f1e6394e7e..d89aaf0cdf 100644 --- a/configure.ac +++ b/configure.ac @@ -1048,7 +1048,10 @@ if test "$PERL" != no && fi AC_PATH_PROG(INSTALL_INFO, install-info, no, $PATH:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin) -AC_PATH_PROG(BISON, bison, no, $PATH:/usr/local/bin:/usr/bin:/bin) +AC_CHECK_PROG_VER(BISON, bison, --version, + [bison (GNU Bison) \([0-9]*\.[0-9.]*\)], + [2.7*|[3-9].*|[1-9][0-9]*], + BISON=no) AC_CACHE_CHECK(for libc-friendly stddef.h, libc_cv_friendly_stddef, [dnl AC_TRY_COMPILE(dnl diff --git a/manual/install.texi b/manual/install.texi index 2b9b57ca32..d8dc3d58c9 100644 --- a/manual/install.texi +++ b/manual/install.texi @@ -448,6 +448,15 @@ and if you change any of the message translation files you will need GNU @code{gettext} 0.10.36 or later @end itemize +@noindent +If you wish to regenerate the @code{yacc} parser code in the @file{intl} +subdirectory you will need + +@itemize @bullet +@item +GNU @code{bison} 2.7 or later +@end itemize + @noindent You may also need these packages if you upgrade your source tree using patches, although we try to avoid this. -- cgit v1.2.3 From ebf27d12e602b428a316c105ed10371ed84d2d3d Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 11 Feb 2015 23:27:50 +0000 Subject: Revert "hurd: Fix abi-tag, following ba90e05" and revert the corresponding part of ba90e05 which was making the fix necessary. * abi-tags: Revert ae20c9a: rename back gnu into gnu-gnu. * configure.ac, configure: Revert ba90e05: modify gnu-* host_os back into gnu-gnu, and update comment to refer to abi-tags. --- ChangeLog | 6 ++++++ abi-tags | 2 +- configure | 12 ++++++++++++ configure.ac | 12 ++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index c61a392255..bf4ddd07e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2015-02-11 Samuel Thibault + + * abi-tags: Revert ae20c9a: rename back gnu into gnu-gnu. + * configure.ac, configure: Revert ba90e05: modify gnu-* host_os back + into gnu-gnu, and update comment to refer to abi-tags. + 2015-02-11 Joseph Myers [BZ #15467] diff --git a/abi-tags b/abi-tags index b2ed6f3e96..87cd6816a9 100644 --- a/abi-tags +++ b/abi-tags @@ -18,7 +18,7 @@ .*-.*-linux.* 0 2.0.0 # earliest compatible kernel version -.*-.*-gnu.* 1 0.0.0 +.*-.*-gnu-gnu.* 1 0.0.0 .*-sun-solaris2.* 2 2.0.0 # just an arbitrary value diff --git a/configure b/configure index ce0c6a01f1..7337823652 100755 --- a/configure +++ b/configure @@ -3742,6 +3742,18 @@ if test "$build_pt_chown" = yes; then fi +# The abi-tags file uses a fairly simplistic model for name recognition that +# can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a +# $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell. +# This doesn't get used much beyond that, so it's fairly safe. +case "$host_os" in +linux*) + ;; +gnu*) + host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'` + ;; +esac + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. diff --git a/configure.ac b/configure.ac index d89aaf0cdf..8043a27c3f 100644 --- a/configure.ac +++ b/configure.ac @@ -360,6 +360,18 @@ if test "$build_pt_chown" = yes; then AC_DEFINE(HAVE_PT_CHOWN) fi +# The abi-tags file uses a fairly simplistic model for name recognition that +# can't distinguish i486-pc-linux-gnu fully from i486-pc-gnu. So we mutate a +# $host_os of `gnu*' here to be `gnu-gnu*' just so that it can tell. +# This doesn't get used much beyond that, so it's fairly safe. +case "$host_os" in +linux*) + ;; +gnu*) + host_os=`echo $host_os | sed -e 's/gnu/gnu-gnu/'` + ;; +esac + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. -- cgit v1.2.3 From e4693aa7c1777e6849b7bbb5fc9061e883bd58fd Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 4 Mar 2015 13:52:45 -0800 Subject: Avoid C++ tests when the C++ cannot be linked. --- ChangeLog | 12 +++ configure | 258 ++++++++++++++++++++++++++++++++++++++------------------- configure.ac | 11 ++- debug/Makefile | 5 +- dlfcn/Makefile | 9 +- nptl/Makefile | 13 ++- 6 files changed, 216 insertions(+), 92 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index a5b8fb7a3b..d9a53b43bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2015-03-04 Roland McGrath + + * configure.ac (libc_cv_cxx_link_ok): New check. + Reset CXX to empty if it fails to link. + * configure: Regenerated. + * dlfcn/Makefile (tests, modules-names): Add bug-atexit3 and + bug-atexit3-lib only if $(CXX) is nonempty. + * nptl/Makefile (tests): Likewise for tst-cancel24. + (tests, tests-static): Likewise for tst-cancel24-static. + * debug/Makefile (tests): Likewise for tst-chk4, tst-chk5, tst-chk6, + tst-lfschk4, tst-lfschk5, and tst-lfschk6. + 2015-03-04 Andreas Schwab [BZ #17631] diff --git a/configure b/configure index 7337823652..71cc6bb0b2 100755 --- a/configure +++ b/configure @@ -677,10 +677,10 @@ hardcoded_path_in_tests use_default_link sysheaders with_fp -READELF ac_ct_CXX CXXFLAGS CXX +READELF CPP cross_compiling BUILD_CC @@ -1627,6 +1627,52 @@ fi } # ac_fn_cxx_try_compile +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -2985,6 +3031,99 @@ if test -z "$CPP"; then CPP="$CC -E" fi +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. +set dummy ${ac_tool_prefix}readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$READELF"; then + ac_cv_prog_READELF="$READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_READELF="${ac_tool_prefix}readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +READELF=$ac_cv_prog_READELF +if test -n "$READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +$as_echo "$READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_READELF"; then + ac_ct_READELF=$READELF + # Extract the first word of "readelf", so it can be a program name with args. +set dummy readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_READELF"; then + ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_READELF="readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_READELF=$ac_cv_prog_ac_ct_READELF +if test -n "$ac_ct_READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +$as_echo "$ac_ct_READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_READELF" = x; then + READELF="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + READELF=$ac_ct_READELF + fi +else + READELF="$ac_cv_prog_READELF" +fi + + # We need the C++ compiler only for testing. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' @@ -3243,98 +3382,49 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. -set dummy ${ac_tool_prefix}readelf; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$READELF"; then - ac_cv_prog_READELF="$READELF" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_READELF="${ac_tool_prefix}readelf" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +# It's useless to us if it can't link programs (e.g. missing -lstdc++). -fi -fi -READELF=$ac_cv_prog_READELF -if test -n "$READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 -$as_echo "$READELF" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX can link programs" >&5 +$as_echo_n "checking whether $CXX can link programs... " >&6; } +if ${libc_cv_cxx_link_ok+:} false; then : + $as_echo_n "(cached) " >&6 else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi -if test -z "$ac_cv_prog_READELF"; then - ac_ct_READELF=$READELF - # Extract the first word of "readelf", so it can be a program name with args. -set dummy readelf; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_READELF+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_READELF"; then - ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_READELF="readelf" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +int +main () +{ -fi -fi -ac_ct_READELF=$ac_cv_prog_ac_ct_READELF -if test -n "$ac_ct_READELF"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 -$as_echo "$ac_ct_READELF" >&6; } + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + libc_cv_cxx_link_ok=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + libc_cv_cxx_link_ok=no fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "x$ac_ct_READELF" = x; then - READELF="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - READELF=$ac_ct_READELF - fi -else - READELF="$ac_cv_prog_READELF" fi - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_cxx_link_ok" >&5 +$as_echo "$libc_cv_cxx_link_ok" >&6; } +if test $libc_cv_cxx_link_ok != yes; then : + CXX= +fi if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then as_fn_error $? "you must configure in a separate build directory" "$LINENO" 5 diff --git a/configure.ac b/configure.ac index 8043a27c3f..678c7399ad 100644 --- a/configure.ac +++ b/configure.ac @@ -50,9 +50,18 @@ if test $host != $build; then fi AC_SUBST(cross_compiling) AC_PROG_CPP +AC_CHECK_TOOL(READELF, readelf, false) + # We need the C++ compiler only for testing. AC_PROG_CXX -AC_CHECK_TOOL(READELF, readelf, false) +# It's useless to us if it can't link programs (e.g. missing -lstdc++). +AC_CACHE_CHECK([whether $CXX can link programs], libc_cv_cxx_link_ok, [dnl +AC_LANG_PUSH([C++]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [libc_cv_cxx_link_ok=yes], + [libc_cv_cxx_link_ok=no]) +AC_LANG_POP([C++])]) +AS_IF([test $libc_cv_cxx_link_ok != yes], [CXX=]) if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then AC_MSG_ERROR([you must configure in a separate build directory]) diff --git a/debug/Makefile b/debug/Makefile index 2db5e202ae..c775223ef2 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -133,10 +133,13 @@ LDFLAGS-tst-backtrace6 = -rdynamic tests = backtrace-tst tst-longjmp_chk tst-chk1 tst-chk2 tst-chk3 \ tst-lfschk1 tst-lfschk2 tst-lfschk3 test-strcpy_chk test-stpcpy_chk \ - tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 \ tst-longjmp_chk2 tst-backtrace2 tst-backtrace3 tst-backtrace4 \ tst-backtrace5 tst-backtrace6 +ifneq (,$(CXX)) +tests += tst-chk4 tst-chk5 tst-chk6 tst-lfschk4 tst-lfschk5 tst-lfschk6 +endif + extra-libs = libSegFault libpcprofile extra-libs-others = $(extra-libs) diff --git a/dlfcn/Makefile b/dlfcn/Makefile index 363278aced..34b1b5d450 100644 --- a/dlfcn/Makefile +++ b/dlfcn/Makefile @@ -36,12 +36,12 @@ endif ifeq (yes,$(build-shared)) tests = glrefmain failtest tst-dladdr default errmsg1 tstcxaatexit \ bug-dlopen1 bug-dlsym1 tst-dlinfo bug-atexit1 bug-atexit2 \ - bug-atexit3 tstatexit bug-dl-leaf tst-rec-dlopen + tstatexit bug-dl-leaf tst-rec-dlopen endif modules-names = glreflib1 glreflib2 glreflib3 failtestmod defaultmod1 \ defaultmod2 errmsg1mod modatexit modcxaatexit \ bug-dlsym1-lib1 bug-dlsym1-lib2 bug-atexit1-lib \ - bug-atexit2-lib bug-atexit3-lib bug-dl-leaf-lib \ + bug-atexit2-lib bug-dl-leaf-lib \ bug-dl-leaf-lib-cb moddummy1 moddummy2 failtestmod.so-no-z-defs = yes @@ -57,6 +57,11 @@ tststatic2-ENV = $(tststatic-ENV) tststatic3-ENV = $(tststatic-ENV) tststatic4-ENV = $(tststatic-ENV) tststatic5-ENV = $(tststatic-ENV) + +ifneq (,$(CXX)) +tests += bug-atexit3 +modules-names += bug-atexit3-lib +endif endif extra-test-objs += $(modules-names:=.os) diff --git a/nptl/Makefile b/nptl/Makefile index 89fdc8b9b4..00d13cf859 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -245,8 +245,8 @@ tests = tst-typesizes \ tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \ tst-cancel11 tst-cancel12 tst-cancel13 tst-cancel14 tst-cancel15 \ tst-cancel16 tst-cancel17 tst-cancel18 tst-cancel19 tst-cancel20 \ - tst-cancel21 tst-cancel22 tst-cancel23 tst-cancel24 tst-cancel25 \ - tst-cancel-self tst-cancel-self-cancelstate \ + tst-cancel21 tst-cancel22 tst-cancel23 $(if $(CXX),tst-cancel24) \ + tst-cancel25 tst-cancel-self tst-cancel-self-cancelstate \ tst-cancel-self-canceltype tst-cancel-self-testcancel \ tst-cleanup0 tst-cleanup1 tst-cleanup2 tst-cleanup3 tst-cleanup4 \ tst-flock1 tst-flock2 \ @@ -364,14 +364,19 @@ link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \ $(common-objpfx)libc.a tests-static += tst-locale1 tst-locale2 tst-stackguard1-static \ - tst-cancel21-static tst-cancel24-static tst-cond8-static \ + tst-cancel21-static tst-cond8-static \ tst-mutex8-static tst-mutexpi8-static tst-sem11-static \ tst-sem12-static -tests += tst-stackguard1-static tst-cancel21-static tst-cancel24-static \ +tests += tst-stackguard1-static tst-cancel21-static \ tst-cond8-static tst-mutex8-static tst-mutexpi8-static \ tst-sem11-static tst-sem12-static xtests-static += tst-setuid1-static +ifneq (,$(CXX)) +tests += tst-cancel24-static +tests-static += tst-cancel24-static +endif + # These tests are linked with libc before libpthread tests-reverse += tst-cancel5 tst-cancel23 tst-vfork1x tst-vfork2x -- cgit v1.2.3 From 83569fb894050db7430047da2219ca50c68f882a Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 31 Mar 2015 05:20:55 -0700 Subject: Add a testcase for copy reloc against protected data Linkers in some versions of binutils 2.25 and 2.26 don't support protected data symbol with error messsage like: /usr/bin/ld: copy reloc against protected `bar' is invalid /usr/bin/ld: failed to set dynamic section sizes: Bad value We check if linker supports copy reloc against protected data symbol to avoid running the test if linker is broken. [BZ #17711] * config.make.in (have-protected-data): New. * configure.ac: Check linker support for protected data symbol. * configure: Regenerated. * elf/Makefile (modules-names): Add tst-protected1moda and tst-protected1modb if $(have-protected-data) is yes. (tests): Add tst-protected1a and tst-protected1b if $(have-protected-data) is yes. ($(objpfx)tst-protected1a): New. ($(objpfx)tst-protected1b): Likewise. (tst-protected1modb.so-no-z-defs): Likewise. * elf/tst-protected1a.c: New file. * elf/tst-protected1b.c: Likewise. * elf/tst-protected1mod.h: Likewise. * elf/tst-protected1moda.c: Likewise. * elf/tst-protected1modb.c: Likewise. --- ChangeLog | 19 ++++ config.make.in | 1 + configure | 40 ++++++++ configure.ac | 23 +++++ elf/Makefile | 7 ++ elf/tst-protected1a.c | 236 +++++++++++++++++++++++++++++++++++++++++++++ elf/tst-protected1b.c | 242 +++++++++++++++++++++++++++++++++++++++++++++++ elf/tst-protected1mod.h | 41 ++++++++ elf/tst-protected1moda.c | 92 ++++++++++++++++++ elf/tst-protected1modb.c | 62 ++++++++++++ 10 files changed, 763 insertions(+) create mode 100644 elf/tst-protected1a.c create mode 100644 elf/tst-protected1b.c create mode 100644 elf/tst-protected1mod.h create mode 100644 elf/tst-protected1moda.c create mode 100644 elf/tst-protected1modb.c (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 1381ef7ada..dd40484e70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2015-03-31 H.J. Lu + + [BZ #17711] + * config.make.in (have-protected-data): New. + * configure.ac: Check linker support for protected data symbol. + * configure: Regenerated. + * elf/Makefile (modules-names): Add tst-protected1moda and + tst-protected1modb if $(have-protected-data) is yes. + (tests): Add tst-protected1a and tst-protected1b if + $(have-protected-data) is yes. + ($(objpfx)tst-protected1a): New. + ($(objpfx)tst-protected1b): Likewise. + (tst-protected1modb.so-no-z-defs): Likewise. + * elf/tst-protected1a.c: New file. + * elf/tst-protected1b.c: Likewise. + * elf/tst-protected1mod.h: Likewise. + * elf/tst-protected1moda.c: Likewise. + * elf/tst-protected1modb.c: Likewise. + 2015-03-31 H.J. Lu [BZ #17711] diff --git a/config.make.in b/config.make.in index ad4dd30607..5a18daed24 100644 --- a/config.make.in +++ b/config.make.in @@ -50,6 +50,7 @@ enable-werror = @enable_werror@ have-z-combreloc = @libc_cv_z_combreloc@ have-z-execstack = @libc_cv_z_execstack@ have-Bgroup = @libc_cv_Bgroup@ +have-protected-data = @libc_cv_protected_data@ with-fp = @with_fp@ old-glibc-headers = @old_glibc_headers@ unwind-find-fde = @libc_cv_gcc_unwind_find_fde@ diff --git a/configure b/configure index 71cc6bb0b2..79864b7166 100755 --- a/configure +++ b/configure @@ -634,6 +634,7 @@ libc_cv_z_combreloc ASFLAGS_config libc_cv_Bgroup libc_cv_cc_with_libunwind +libc_cv_protected_data BISON INSTALL_INFO PERL @@ -5733,6 +5734,45 @@ $as_echo "$libc_cv_visibility_attribute" >&6; } fi fi +if test $libc_cv_visibility_attribute = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking linker support for protected data symbol" >&5 +$as_echo_n "checking linker support for protected data symbol... " >&6; } +if ${libc_cv_protected_data+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cat > conftest.c <&5 + (eval $ac_try) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + libc_cv_protected_data=yes + fi + fi + rm -f conftest.* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_protected_data" >&5 +$as_echo "$libc_cv_protected_data" >&6; } +else + libc_cv_protected_data=no +fi + + if test $libc_cv_visibility_attribute = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for broken __attribute__((visibility()))" >&5 $as_echo_n "checking for broken __attribute__((visibility()))... " >&6; } diff --git a/configure.ac b/configure.ac index 678c7399ad..39f3e86151 100644 --- a/configure.ac +++ b/configure.ac @@ -1219,6 +1219,29 @@ EOF fi fi +if test $libc_cv_visibility_attribute = yes; then + AC_CACHE_CHECK(linker support for protected data symbol, + libc_cv_protected_data, + [cat > conftest.c < conftest.c <. */ + +/* This file must be compiled as PIE to avoid copy relocation when + accessing protected symbols defined in shared libaries since copy + relocation doesn't work with protected symbols and linker in + binutils 2.26 enforces this rule. */ + +#include +#include +#include + +#include "tst-protected1mod.h" + +/* Prototype for our test function. */ +extern int do_test (void); + +int protected2 = -1; + +#define TEST_FUNCTION do_test () + +/* This defines the `main' function and some more. */ +#include + +int +do_test (void) +{ + int res = 0; + + /* Check if we get the same address for the protected data symbol. */ + if (&protected1 != protected1a_p ()) + { + puts ("`protected1' in main and moda doesn't have same address"); + res = 1; + } + if (&protected1 != protected1b_p ()) + { + puts ("`protected1' in main and modb doesn't have same address"); + res = 1; + } + + /* Check if we get the right value for the protected data symbol. */ + if (protected1 != 3) + { + puts ("`protected1' in main and moda doesn't have same value"); + res = 1; + } + + /* Check if we get the right value for data defined in executable. */ + if (protected2 != -1) + { + puts ("`protected2' in main has the wrong value"); + res = 1; + } + + /* Check `protected1' in moda. */ + if (!check_protected1 ()) + { + puts ("`protected1' in moda has the wrong value"); + res = 1; + } + + /* Check `protected2' in moda. */ + if (!check_protected2 ()) + { + puts ("`protected2' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the same address for the protected data symbol. */ + if (&protected3 != protected3a_p ()) + { + puts ("`protected3' in main and moda doesn't have same address"); + res = 1; + } + if (&protected3 == protected3b_p ()) + { + puts ("`protected3' in main and modb has same address"); + res = 1; + } + + /* Check if we get the right value for the protected data symbol. */ + if (protected3 != 5) + { + puts ("`protected3' in main and moda doesn't have same value"); + res = 1; + } + + /* Check `protected3' in moda. */ + if (!check_protected3a ()) + { + puts ("`protected3' in moda has the wrong value"); + res = 1; + } + + /* Check `protected3' in modb. */ + if (!check_protected3b ()) + { + puts ("`protected3' in modb has the wrong value"); + res = 1; + } + + /* Set `protected2' in moda to 30. */ + set_protected2 (300); + + /* Check `protected2' in moda. */ + if (!check_protected2 ()) + { + puts ("`protected2' in moda has the wrong value"); + res = 1; + } + + /* Set `protected1' in moda to 30. */ + set_protected1a (30); + + /* Check `protected1' in moda. */ + if (!check_protected1 ()) + { + puts ("`protected1' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected1 != 30) + { + puts ("`protected1' in main doesn't have the updated value"); + res = 1; + } + + protected2 = -300; + + /* Check `protected2' in moda. */ + if (!check_protected2 ()) + { + puts ("`protected2' in moda has the wrong value"); + res = 1; + } + + /* Check if data defined in executable is changed. */ + if (protected2 != -300) + { + puts ("`protected2' in main is changed"); + res = 1; + } + + /* Set `protected1' in modb to 40. */ + set_protected1b (40); + set_expected_protected1 (40); + + /* Check `protected1' in moda. */ + if (!check_protected1 ()) + { + puts ("`protected1' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected1 != 40) + { + puts ("`protected1' in main doesn't have the updated value"); + res = 1; + } + + /* Set `protected3' in moda to 80. */ + set_protected3a (80); + + /* Check `protected3' in moda. */ + if (!check_protected3a ()) + { + puts ("`protected3' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected3 != 80) + { + puts ("`protected3' in main doesn't have the updated value"); + res = 1; + } + + /* Check `protected3' in modb. */ + if (!check_protected3b ()) + { + puts ("`protected3' in modb has the wrong value"); + res = 1; + } + + /* Set `protected3' in modb to 100. */ + set_protected3b (100); + + /* Check `protected3' in moda. */ + if (!check_protected3a ()) + { + puts ("`protected3' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected3 != 80) + { + puts ("`protected3' in main doesn't have the updated value"); + res = 1; + } + + /* Check `protected3' in modb. */ + if (!check_protected3b ()) + { + puts ("`protected3' in modb has the wrong value"); + res = 1; + } + + return res; +} diff --git a/elf/tst-protected1b.c b/elf/tst-protected1b.c new file mode 100644 index 0000000000..56352c406f --- /dev/null +++ b/elf/tst-protected1b.c @@ -0,0 +1,242 @@ +/* Test the protected visibility when main is linked with modb and moda + in that order: + 1. Protected symbols, protected1, protected2 and protected3, defined + in moda, are used in moda. + 2. Protected symbol, protected3, defined in modb, are used in modb + 3. Symbol, protected1, defined in modb, is used in main and modb. + 4. Symbol, protected2, defined in main, is used in main. + 5. Symbol, protected3, defined in modb, is also used in main. + + Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* This file must be compiled as PIE to avoid copy relocation when + accessing protected symbols defined in shared libaries since copy + relocation doesn't work with protected symbols and linker in + binutils 2.26 enforces this rule. */ + +#include +#include +#include + +#include "tst-protected1mod.h" + +/* Prototype for our test function. */ +extern int do_test (void); + +int protected2 = -1; + +#define TEST_FUNCTION do_test () + +/* This defines the `main' function and some more. */ +#include + +int +do_test (void) +{ + int res = 0; + + /* Check if we get the same address for the protected data symbol. */ + if (&protected1 == protected1a_p ()) + { + puts ("`protected1' in main and moda has same address"); + res = 1; + } + if (&protected1 != protected1b_p ()) + { + puts ("`protected1' in main and modb doesn't have same address"); + res = 1; + } + + /* Check if we get the right value for the protected data symbol. */ + if (protected1 != -3) + { + puts ("`protected1' in main and modb doesn't have same value"); + res = 1; + } + + /* Check if we get the right value for data defined in executable. */ + if (protected2 != -1) + { + puts ("`protected2' in main has the wrong value"); + res = 1; + } + + /* Check `protected1' in moda. */ + if (!check_protected1 ()) + { + puts ("`protected1' in moda has the wrong value"); + res = 1; + } + + /* Check `protected2' in moda. */ + if (!check_protected2 ()) + { + puts ("`protected2' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the same address for the protected data symbol. */ + if (&protected3 == protected3a_p ()) + { + puts ("`protected3' in main and moda has same address"); + res = 1; + } + if (&protected3 != protected3b_p ()) + { + puts ("`protected3' in main and modb doesn't have same address"); + res = 1; + } + + /* Check if we get the right value for the protected data symbol. */ + if (protected3 != -5) + { + puts ("`protected3' in main and modb doesn't have same value"); + res = 1; + } + + /* Check `protected3' in moda. */ + if (!check_protected3a ()) + { + puts ("`protected3' in moda has the wrong value"); + res = 1; + } + + /* Check `protected3' in modb. */ + if (!check_protected3b ()) + { + puts ("`protected3' in modb has the wrong value"); + res = 1; + } + + /* Set `protected2' in moda to 30. */ + set_protected2 (300); + + /* Check `protected2' in moda. */ + if (!check_protected2 ()) + { + puts ("`protected2' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the right value for data defined in executable. */ + if (protected2 != -1) + { + puts ("`protected2' in main has the wrong value"); + res = 1; + } + + /* Set `protected1' in moda to 30. */ + set_protected1a (30); + + /* Check `protected1' in moda. */ + if (!check_protected1 ()) + { + puts ("`protected1' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the same value for the protected data symbol. */ + if (protected1 != -3) + { + puts ("`protected1' in main has the wrong value"); + res = 1; + } + + protected2 = -300; + + /* Check `protected2' in moda. */ + if (!check_protected2 ()) + { + puts ("`protected2' in moda has the wrong value"); + res = 1; + } + + /* Check if data defined in executable is changed. */ + if (protected2 != -300) + { + puts ("`protected2' in main is changed"); + res = 1; + } + + /* Set `protected1' in modb to 40. */ + set_protected1b (40); + + /* Check `protected1' in moda. */ + if (!check_protected1 ()) + { + puts ("`protected1' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected1 != 40) + { + puts ("`protected1' in main doesn't have the updated value"); + res = 1; + } + + /* Set `protected3' in moda to 80. */ + set_protected3a (80); + + /* Check `protected3' in moda. */ + if (!check_protected3a ()) + { + puts ("`protected3' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected3 != -5) + { + puts ("`protected3' in main doesn't have the updated value"); + res = 1; + } + + /* Check `protected3' in modb. */ + if (!check_protected3b ()) + { + puts ("`protected3' in modb has the wrong value"); + res = 1; + } + + /* Set `protected3' in modb to 100. */ + set_protected3b (100); + + /* Check `protected3' in moda. */ + if (!check_protected3a ()) + { + puts ("`protected3' in moda has the wrong value"); + res = 1; + } + + /* Check if we get the updated value for the protected data symbol. */ + if (protected3 != 100) + { + puts ("`protected3' in main doesn't have the updated value"); + res = 1; + } + + /* Check `protected3' in modb. */ + if (!check_protected3b ()) + { + puts ("`protected3' in modb has the wrong value"); + res = 1; + } + + return res; +} diff --git a/elf/tst-protected1mod.h b/elf/tst-protected1mod.h new file mode 100644 index 0000000000..301e019dd8 --- /dev/null +++ b/elf/tst-protected1mod.h @@ -0,0 +1,41 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +/* Prototypes for the functions in the DSOs. */ +extern int protected1; +extern int protected2; +extern int protected3; + +extern void set_protected1a (int); +extern void set_protected1b (int); +extern int *protected1a_p (void); +extern int *protected1b_p (void); + +extern void set_expected_protected1 (int); +extern int check_protected1 (void); + +extern void set_protected2 (int); +extern int check_protected2 (void); + +extern void set_expected_protected3a (int); +extern void set_protected3a (int); +extern int check_protected3a (void); +extern int *protected3a_p (void); +extern void set_expected_protected3b (int); +extern void set_protected3b (int); +extern int check_protected3b (void); +extern int *protected3b_p (void); diff --git a/elf/tst-protected1moda.c b/elf/tst-protected1moda.c new file mode 100644 index 0000000000..720f474281 --- /dev/null +++ b/elf/tst-protected1moda.c @@ -0,0 +1,92 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include "tst-protected1mod.h" + +int protected1 = 3; +static int expected_protected1 = 3; +int protected2 = 4; +static int expected_protected2 = 4; +int protected3 = 5; +static int expected_protected3 = 5; + +asm (".protected protected1"); +asm (".protected protected2"); +asm (".protected protected3"); + +void +set_protected1a (int i) +{ + protected1 = i; + set_expected_protected1 (i); +} + +void +set_expected_protected1 (int i) +{ + expected_protected1 = i; +} + +int * +protected1a_p (void) +{ + return &protected1; +} + +int +check_protected1 (void) +{ + return protected1 == expected_protected1; +} + +void +set_protected2 (int i) +{ + protected2 = i; + expected_protected2 = i; +} + +int +check_protected2 (void) +{ + return protected2 == expected_protected2; +} + +void +set_expected_protected3a (int i) +{ + expected_protected3 = i; +} + +void +set_protected3a (int i) +{ + protected3 = i; + set_expected_protected3a (i); +} + +int +check_protected3a (void) +{ + return protected3 == expected_protected3; +} + +int * +protected3a_p (void) +{ + return &protected3; +} diff --git a/elf/tst-protected1modb.c b/elf/tst-protected1modb.c new file mode 100644 index 0000000000..ddfa646ec3 --- /dev/null +++ b/elf/tst-protected1modb.c @@ -0,0 +1,62 @@ +/* Copyright (C) 2015 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include "tst-protected1mod.h" + +int protected1 = -3; +int protected3 = -5; +static int expected_protected3 = -5; + +asm (".protected protected3"); + +void +set_protected1b (int i) +{ + protected1 = i; +} + +int * +protected1b_p (void) +{ + return &protected1; +} + +void +set_expected_protected3b (int i) +{ + expected_protected3 = i; +} + +void +set_protected3b (int i) +{ + protected3 = i; + set_expected_protected3b (i); +} + +int +check_protected3b (void) +{ + return protected3 == expected_protected3; +} + +int * +protected3b_p (void) +{ + return &protected3; +} -- cgit v1.2.3 From 054392910be496adb8c4e611084827082135c404 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Thu, 9 Apr 2015 13:55:11 -0700 Subject: Let non-add-on preconfigure scripts set libc_config_ok. --- ChangeLog | 4 ++++ configure | 7 ++++--- configure.ac | 7 ++++--- 3 files changed, 12 insertions(+), 6 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index 03fbb7e311..193ea30083 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-04-09 Roland McGrath + * configure.ac (libc_config_ok): Initialize before reading + preconfigure scripts, not after. + * configure: Regenerated. + * test-skeleton.c (TIMEOUT): Move #define to top level. (main): Grok environment variable TEST_DIRECT. If set, print test expectation details into that file and then behave as if diff --git a/configure b/configure index 79864b7166..97e549eef5 100755 --- a/configure +++ b/configure @@ -3878,6 +3878,10 @@ if test "${with_cpu+set}" = set; then : fi +# An preconfigure script can set this when it wants to disable the sanity +# check below. +libc_config_ok=no + if frags=`ls -d $srcdir/sysdeps/*/preconfigure 2> /dev/null` then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysdeps preconfigure fragments" >&5 @@ -3891,9 +3895,6 @@ $as_echo_n "checking for sysdeps preconfigure fragments... " >&6; } $as_echo "" >&6; } fi -# An add-on can set this when it wants to disable the sanity check below. -libc_config_ok=no - subdirs="$subdirs " diff --git a/configure.ac b/configure.ac index 39f3e86151..def655ab8b 100644 --- a/configure.ac +++ b/configure.ac @@ -412,12 +412,13 @@ AC_ARG_WITH([cpu], esac ]) +# An preconfigure script can set this when it wants to disable the sanity +# check below. +libc_config_ok=no + dnl Let sysdeps/*/preconfigure act here, like they can in add-ons. LIBC_PRECONFIGURE([$srcdir], [for sysdeps]) -# An add-on can set this when it wants to disable the sanity check below. -libc_config_ok=no - dnl Having this here, though empty, makes sure that if add-ons' fragments dnl do AC_CONFIG_SUBDIRS([some-dir]), which just sets $subdirs, then dnl our AC_OUTPUT will actually use it. -- cgit v1.2.3 From 5695d46f5dc0ff2ffbcb0c52b1f6c2ada09c39dc Mon Sep 17 00:00:00 2001 From: Andrew Senkevich Date: Thu, 14 May 2015 17:28:06 +0300 Subject: This is update for configure, build and install of vector math library. Installation of libm.so as linker script only in case of libmvec.so build. 2015-05-14 Andrew Senkevich * Makeconfig (rpath-dirs, all-subdirs): Added mathvec folder. (libmvec): New variable. * configure.ac: Added option for mathvec build. * configure: Regenerated. * mathvec/Depend: New file. * mathvec/Makefile: New file. * shlib-versions: Added libmvec. * math/Makefile: Added rule for libm.so installation. --- ChangeLog | 9 +++++++++ Makeconfig | 6 ++++-- configure | 17 +++++++++++++++++ configure.ac | 11 +++++++++++ math/Makefile | 16 ++++++++++++++++ mathvec/Depend | 1 + mathvec/Makefile | 35 +++++++++++++++++++++++++++++++++++ shlib-versions | 3 +++ 8 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 mathvec/Depend create mode 100644 mathvec/Makefile (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index d32e8daa7f..e89c14e634 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2015-05-14 Andrew Senkevich + * Makeconfig (rpath-dirs, all-subdirs): Added mathvec folder. + (libmvec): New variable. + * configure.ac: Added option for mathvec build. + * configure: Regenerated. + * mathvec/Depend: New file. + * mathvec/Makefile: New file. + * shlib-versions: Added libmvec. + * math/Makefile: Added rule for libm.so installation. + * bits/math-vector.h: New file. * bits/libm-simd-decl-stubs.h: New header. * math/Makefile (headers): Added new header diff --git a/Makeconfig b/Makeconfig index 77752c0bb4..d32a0fdc65 100644 --- a/Makeconfig +++ b/Makeconfig @@ -498,7 +498,7 @@ link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib) link-libc-tests = $(link-libc-tests-rpath-link) \ $(link-libc-before-gnulib) $(gnulib-tests) # This is how to find at build-time things that will be installed there. -rpath-dirs = math elf dlfcn nss nis rt resolv crypt +rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec rpath-link = \ $(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%))) else @@ -1074,8 +1074,10 @@ endif ifeq ($(build-shared),yes) libm = $(common-objpfx)math/libm.so$(libm.so-version) +libmvec = $(common-objpfx)mathvec/libmvec.so$(libmvec.so-version) else libm = $(common-objpfx)math/libm.a +libmvec = $(common-objpfx)mathvec/libmvec.a endif # These are the subdirectories containing the library source. The order @@ -1085,7 +1087,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \ stdlib stdio-common libio malloc string wcsmbs time dirent \ grp pwd posix io termios resource misc socket sysvipc gmon \ gnulib iconv iconvdata wctype manual shadow gshadow po argp \ - crypt localedata timezone rt conform debug \ + crypt localedata timezone rt conform debug mathvec \ $(add-on-subdirs) dlfcn elf ifndef avoid-generated diff --git a/configure b/configure index 97e549eef5..1e4138b524 100755 --- a/configure +++ b/configure @@ -777,6 +777,7 @@ enable_systemtap enable_build_nscd enable_nscd enable_pt_chown +enable_mathvec with_cpu ' ac_precious_vars='build_alias @@ -1441,6 +1442,8 @@ Optional Features: --disable-build-nscd disable building and installing the nscd daemon --disable-nscd library functions will not contact the nscd daemon --enable-pt_chown Enable building and installing pt_chown + --enable-mathvec Enable building and installing mathvec [default + depends on architecture] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3845,6 +3848,14 @@ gnu*) ;; esac +# Check whether --enable-mathvec was given. +if test "${enable_mathvec+set}" = set; then : + enableval=$enable_mathvec; build_mathvec=$enableval +else + build_mathvec=notset +fi + + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. @@ -7215,6 +7226,12 @@ $as_echo "running configure fragment for $dir" >&6; } fi done +if test x"$build_mathvec" = xnotset; then + build_mathvec=no +fi +config_vars="$config_vars +build-mathvec = $build_mathvec" + diff --git a/configure.ac b/configure.ac index def655ab8b..ff66b875e3 100644 --- a/configure.ac +++ b/configure.ac @@ -381,6 +381,12 @@ gnu*) ;; esac +AC_ARG_ENABLE([mathvec], + [AS_HELP_STRING([--enable-mathvec], + [Enable building and installing mathvec @<:@default depends on architecture@:>@])], + [build_mathvec=$enableval], + [build_mathvec=notset]) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. @@ -1994,6 +2000,11 @@ for dir in $sysnames; do fi done +if test x"$build_mathvec" = xnotset; then + build_mathvec=no +fi +LIBC_CONFIG_VAR([build-mathvec], [$build_mathvec]) + AC_SUBST(libc_extra_cflags) AC_SUBST(libc_extra_cppflags) diff --git a/math/Makefile b/math/Makefile index 4f66162a09..9a3cf3228b 100644 --- a/math/Makefile +++ b/math/Makefile @@ -86,6 +86,22 @@ generated += $(foreach s,.c .S l.c l.S f.c f.S,$(calls:s_%=m_%$s)) routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts)) long-c-yes = $(calls:=l) +ifeq ($(build-mathvec),yes) +# We need to install libm.so as linker script +# for more comfortable use of vector math library. +install-lib-ldscripts := libm.so +install_subdir: $(inst_libdir)/libm.so +$(inst_libdir)/libm.so: $(common-objpfx)format.lds \ + $(libm) \ + $(libmvec) \ + $(+force) + (echo '/* GNU ld script'; echo '*/';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \ + 'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \ + ) > $@ +endif + # Rules for the test suite. tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \ test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \ diff --git a/mathvec/Depend b/mathvec/Depend new file mode 100644 index 0000000000..ede10ab61b --- /dev/null +++ b/mathvec/Depend @@ -0,0 +1 @@ +math diff --git a/mathvec/Makefile b/mathvec/Makefile new file mode 100644 index 0000000000..37e0864f64 --- /dev/null +++ b/mathvec/Makefile @@ -0,0 +1,35 @@ +# Copyright (C) 2014-2015 Free Software Foundation, Inc. +# This file is part of the GNU C Library. + +# The GNU C Library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. + +# The GNU C Library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public +# License along with the GNU C Library; if not, see +# . + +# Makefile for the vector math library. + +subdir := mathvec + +include ../Makeconfig + +ifeq ($(build-mathvec),yes) +extra-libs := libmvec +extra-libs-others = $(extra-libs) + +libmvec-routines = $(strip $(libmvec-support)) + +$(objpfx)libmvec.so: $(libm) +endif + +# Rules for the test suite are in math directory. + +include ../Rules diff --git a/shlib-versions b/shlib-versions index e05b248e8d..fa3cf1da44 100644 --- a/shlib-versions +++ b/shlib-versions @@ -71,3 +71,6 @@ libanl=1 # This defines the libgcc soname version this glibc is to load for # asynchronous cancellation to work correctly. libgcc_s=1 + +# The vector math library +libmvec=1 -- cgit v1.2.3 From cc08749b2d1c68284b25b157fbbe1ff219495cae Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 25 Jun 2015 02:37:04 -0700 Subject: Support compilers defaulting to PIE To support building glibc with GCC 6 configured with --enable-default-pie, which generates PIE by default, we need to build programs as PIE. But elf/tst-dlopen-aout must not be built as PIE since it tests dlopen on ET_EXEC file and PIE is ET_DYN. [BZ #17841] * Makeconfig (no-pie-ldflag): New. (+link): Set to $(+link-pie) if default to PIE. (+link-tests): Set to $(+link-pie-tests) if default to PIE. * config.make.in (build-pie-default): New. * configure.ac (libc_cv_pie_default): New. Set to yes if -fPIE is default. AC_SUBST. * configure: Regenerated. * elf/Makefile (LDFLAGS-tst-dlopen-aout): New. --- ChangeLog | 12 ++++++++++++ Makeconfig | 6 ++++++ NEWS | 22 +++++++++++----------- config.make.in | 1 + configure | 21 +++++++++++++++++++++ configure.ac | 13 +++++++++++++ elf/Makefile | 1 + 7 files changed, 65 insertions(+), 11 deletions(-) (limited to 'configure') diff --git a/ChangeLog b/ChangeLog index f9cf634a44..7fe8b82196 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2015-06-25 H.J. Lu + + [BZ #17841] + * Makeconfig (no-pie-ldflag): New. + (+link): Set to $(+link-pie) if default to PIE. + (+link-tests): Set to $(+link-pie-tests) if default to PIE. + * config.make.in (build-pie-default): New. + * configure.ac (libc_cv_pie_default): New. Set to yes if -fPIE + is default. AC_SUBST. + * configure: Regenerated. + * elf/Makefile (LDFLAGS-tst-dlopen-aout): New. + 2015-06-24 Roland McGrath * nptl/descr.h (struct pthread): Change type of field setxid_futex diff --git a/Makeconfig b/Makeconfig index 0f4b5497c1..7b46323bd2 100644 --- a/Makeconfig +++ b/Makeconfig @@ -442,6 +442,11 @@ endif # Commands for linking programs with the C library. ifndef +link ifeq (yes,$(build-shared)) +ifeq (yes,$(build-pie-default)) +no-pie-ldflag = -no-pie ++link = $(+link-pie) ++link-tests = $(+link-pie-tests) +else +link-before-libc = $(CC) -nostdlib -nostartfiles -o $@ \ $(sysdep-LDFLAGS) $(LDFLAGS) $(LDFLAGS-$(@F)) \ $(combreloc-LDFLAGS) $(relro-LDFLAGS) $(hashstyle-LDFLAGS) \ @@ -462,6 +467,7 @@ $(+link-before-libc) $(rtld-tests-LDFLAGS) $(link-libc-tests) \ $(+link-after-libc) $(call after-link,$@) endef +endif else +link = $(+link-static) +link-tests = $(+link-static-tests) diff --git a/NEWS b/NEWS index 727e21f770..58f85e79bb 100644 --- a/NEWS +++ b/NEWS @@ -14,17 +14,17 @@ Version 2.22 16526, 16538, 16560, 16704, 16783, 16850, 17053, 17090, 17195, 17269, 17293, 17322, 17403, 17523, 17542, 17569, 17581, 17588, 17596, 17620, 17621, 17628, 17631, 17692, 17711, 17715, 17776, 17779, 17792, 17836, - 17912, 17916, 17930, 17932, 17944, 17949, 17964, 17965, 17967, 17969, - 17977, 17978, 17987, 17991, 17996, 17998, 17999, 18007, 18019, 18020, - 18029, 18030, 18032, 18034, 18036, 18038, 18039, 18042, 18043, 18046, - 18047, 18049, 18068, 18080, 18093, 18100, 18104, 18110, 18111, 18116, - 18125, 18128, 18138, 18185, 18196, 18197, 18206, 18210, 18211, 18217, - 18219, 18220, 18221, 18234, 18244, 18245, 18247, 18287, 18319, 18324, - 18333, 18346, 18371, 18397, 18409, 18410, 18412, 18418, 18422, 18434, - 18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497, 18498, - 18507, 18512, 18513, 18519, 18520, 18522, 18527, 18528, 18529, 18530, - 18532, 18533, 18534, 18536, 18539, 18540, 18542, 18544, 18545, 18546, - 18547, 18553, 18558, 18569, 18583, 18585, 18586, 18593, 18594. + 17841, 17912, 17916, 17930, 17932, 17944, 17949, 17964, 17965, 17967, + 17969, 17977, 17978, 17987, 17991, 17996, 17998, 17999, 18007, 18019, + 18020, 18029, 18030, 18032, 18034, 18036, 18038, 18039, 18042, 18043, + 18046, 18047, 18049, 18068, 18080, 18093, 18100, 18104, 18110, 18111, + 18116, 18125, 18128, 18138, 18185, 18196, 18197, 18206, 18210, 18211, + 18217, 18219, 18220, 18221, 18234, 18244, 18245, 18247, 18287, 18319, + 18324, 18333, 18346, 18371, 18397, 18409, 18410, 18412, 18418, 18422, + 18434, 18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497, + 18498, 18507, 18512, 18513, 18519, 18520, 18522, 18527, 18528, 18529, + 18530, 18532, 18533, 18534, 18536, 18539, 18540, 18542, 18544, 18545, + 18546, 18547, 18553, 18558, 18569, 18583, 18585, 18586, 18593, 18594. * Cache information can be queried via sysconf() function on s390 e.g. with _SC_LEVEL1_ICACHE_SIZE as argument. diff --git a/config.make.in b/config.make.in index 5a18daed24..a9f5696077 100644 --- a/config.make.in +++ b/config.make.in @@ -82,6 +82,7 @@ nss-crypt = @libc_cv_nss_crypt@ # Configuration options. build-shared = @shared@ build-pic-default= @libc_cv_pic_default@ +build-pie-default= @libc_cv_pie_default@ build-profile = @profile@ build-static-nss = @static_nss@ add-ons = @add_ons@ diff --git a/configure b/configure index 1e4138b524..45cc7cba2b 100755 --- a/configure +++ b/configure @@ -596,6 +596,7 @@ mach_interface_list DEFINES static_nss profile +libc_cv_pie_default libc_cv_pic_default shared static @@ -7317,6 +7318,26 @@ fi $as_echo "$libc_cv_pic_default" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fPIE is default" >&5 +$as_echo_n "checking whether -fPIE is default... " >&6; } +if ${libc_cv_pie_default+:} false; then : + $as_echo_n "(cached) " >&6 +else + libc_cv_pie_default=yes +cat > conftest.c <&5 1>&5"; then + libc_cv_pie_default=no +fi +rm -f conftest.* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_pie_default" >&5 +$as_echo "$libc_cv_pie_default" >&6; } + + diff --git a/configure.ac b/configure.ac index ff66b875e3..7e9383a7f0 100644 --- a/configure.ac +++ b/configure.ac @@ -2075,6 +2075,19 @@ fi rm -f conftest.*]) AC_SUBST(libc_cv_pic_default) +AC_CACHE_CHECK([whether -fPIE is default], libc_cv_pie_default, +[libc_cv_pie_default=yes +cat > conftest.c <&AS_MESSAGE_LOG_FD 1>&AS_MESSAGE_LOG_FD"; then + libc_cv_pie_default=no +fi +rm -f conftest.*]) +AC_SUBST(libc_cv_pie_default) + AC_SUBST(profile) AC_SUBST(static_nss) diff --git a/elf/Makefile b/elf/Makefile index 4ea3ccf441..f21276c006 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -151,6 +151,7 @@ tests += loadtest restest1 preloadtest loadfail multiload origtest resolvfail \ # reldep9 ifeq ($(build-hardcoded-path-in-tests),yes) tests += tst-dlopen-aout +LDFLAGS-tst-dlopen-aout = $(no-pie-ldflag) endif test-srcs = tst-pathopt selinux-enabled := $(shell cat /selinux/enforce 2> /dev/null) -- cgit v1.2.3