[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r14584 - in /fsf/trunk/libc: ChangeLog Makerules config.make.in configure configure.in sysdeps/i386/Makefile



Author: eglibc
Date: Sun Jul 17 00:13:15 2011
New Revision: 14584

Log:
Import glibc-mainline for 2011-07-17

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/Makerules
    fsf/trunk/libc/config.make.in
    fsf/trunk/libc/configure
    fsf/trunk/libc/configure.in
    fsf/trunk/libc/sysdeps/i386/Makefile

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Jul 17 00:13:15 2011
@@ -1,3 +1,19 @@
+2011-07-16  Roland McGrath  <roland@xxxxxxxxxxxxx>
+
+	* sysdeps/i386/Makefile: Never use -mpreferred-stack-boundary=2,
+	now disallowed by GCC.
+
+	* configure.in (use-default-link): Default to yes if a test -shared
+	link meets our qualifications.
+	* configure: Regenerated.
+
+	* config.make.in (output-format): New variable.
+	* configure.in: Check for ld --print-output-format support.
+	* configure: Regenerated.
+	* Makerules ($(common-objpfx)format.lds)
+	[$(output-format) != unknown]: Just use $(output-format),
+	instead of the linker-script munging.
+
 2011-07-14  Roland McGrath  <roland@xxxxxxxxxxxxx>
 
 	* Makefile ($(common-objpfx)linkobj/libc.so): Use $(shlib-lds) instead

Modified: fsf/trunk/libc/Makerules
==============================================================================
--- fsf/trunk/libc/Makerules (original)
+++ fsf/trunk/libc/Makerules Sun Jul 17 00:13:15 2011
@@ -990,11 +990,15 @@
 $(common-objpfx)format.lds: $(..)scripts/output-format.sed \
 			    $(common-objpfx)config.make \
 			    $(common-objpfx)config.h $(..)Makerules
+ifneq (unknown,$(output-format))
+	echo > $@.new 'OUTPUT_FORMAT($(output-format))'
+else
 	$(LINK.o) -shared $(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS.so) \
 		  -x c /dev/null -o $@.so -Wl,--verbose -v 2>&1 \
 	| sed -n -f $< > $@.new
 	test -s $@.new
 	rm -f $@.so
+endif
 	mv -f $@.new $@
 common-generated += format.lds
 

Modified: fsf/trunk/libc/config.make.in
==============================================================================
--- fsf/trunk/libc/config.make.in (original)
+++ fsf/trunk/libc/config.make.in Sun Jul 17 00:13:15 2011
@@ -70,6 +70,7 @@
 bind-now = @bindnow@
 have-hash-style = @libc_cv_hashstyle@
 use-default-link = @use_default_link@
+output-format = @libc_cv_output_format@
 
 static-libgcc = @libc_cv_gcc_static_libgcc@
 

Modified: fsf/trunk/libc/configure
==============================================================================
--- fsf/trunk/libc/configure (original)
+++ fsf/trunk/libc/configure Sun Jul 17 00:13:15 2011
@@ -647,6 +647,7 @@
 gnu89_inline
 libc_cv_ssp
 fno_unit_at_a_time
+libc_cv_output_format
 libc_cv_hashstyle
 libc_cv_fpie
 libc_cv_z_execstack
@@ -1468,7 +1469,7 @@
   --without-cvs           if CVS should not be used
   --with-headers=PATH     location of system headers to use (for example
                           /usr/src/linux/include) [default=compiler default]
-  --with-default-link     do not use explicit linker scripts [default=no]
+  --with-default-link     do not use explicit linker scripts
   --with-tls              enable support for TLS
   --without-__thread      do not use TLS features even when supporting them
   --with-cpu=CPU          select code for CPU variant
@@ -3592,7 +3593,7 @@
 if test "${with_default_link+set}" = set; then :
   withval=$with_default_link; use_default_link=$withval
 else
-  use_default_link=no
+  use_default_link=default
 fi
 
 
@@ -6701,7 +6702,88 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hashstyle" >&5
 $as_echo "$libc_cv_hashstyle" >&6; }
 
-fi
+
+  # The linker's default -shared behavior is good enough if it
+  # does these things that our custom linker scripts ensure that
+  # all allocated NOTE sections come first.
+  if test "$use_default_link" = default; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sufficient default -shared layout" >&5
+$as_echo_n "checking for sufficient default -shared layout... " >&6; }
+if ${libc_cv_use_default_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      libc_cv_use_default_link=no
+    cat > conftest.s <<\EOF
+	  .section .note.a,"a",%note
+	  .balign 4
+	  .long 4,4,9
+	  .string "GNU"
+	  .string "foo"
+	  .section .note.b,"a",%note
+	  .balign 4
+	  .long 4,4,9
+	  .string "GNU"
+	  .string "bar"
+EOF
+    if { ac_try='  ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 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 -S conftest.so | sed -n \
+	 '${x;p;}
+	  s/^ *\[ *[1-9][0-9]*\]  *\([^ ][^ ]*\)  *\([^ ][^ ]*\) .*$/\2 \1/
+	  t a
+	  b
+	  : a
+	  H'`
+    then
+      libc_seen_a=no libc_seen_b=no
+      set -- $ac_try
+      while test $# -ge 2 -a "$1" = NOTE; do
+	case "$2" in
+	.note.a) libc_seen_a=yes ;;
+	.note.b) libc_seen_b=yes ;;
+	esac
+	shift 2
+      done
+      case "$libc_seen_a$libc_seen_b" in
+      yesyes)
+	libc_cv_use_default_link=yes
+	;;
+      *)
+	echo >&5 "\
+$libc_seen_a$libc_seen_b from:
+$ac_try"
+	;;
+      esac
+    fi
+    rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_use_default_link" >&5
+$as_echo "$libc_cv_use_default_link" >&6; }
+    use_default_link=$libc_cv_use_default_link
+  fi
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking linker output format" >&5
+$as_echo_n "checking linker output format... " >&6; }
+if ${libc_cv_output_format+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if libc_cv_output_format=`
+${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&5`
+then
+  :
+else
+  libc_cv_output_format=
+fi
+test -n "$libc_cv_output_format" || libc_cv_output_format=unknown
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_output_format" >&5
+$as_echo "$libc_cv_output_format" >&6; }
+
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -fno-toplevel-reorder -fno-section-anchors" >&5
 $as_echo_n "checking for -fno-toplevel-reorder -fno-section-anchors... " >&6; }

Modified: fsf/trunk/libc/configure.in
==============================================================================
--- fsf/trunk/libc/configure.in (original)
+++ fsf/trunk/libc/configure.in Sun Jul 17 00:13:15 2011
@@ -117,10 +117,9 @@
 AC_SUBST(use_default_link)
 AC_ARG_WITH([default-link],
 	    AC_HELP_STRING([--with-default-link],
-			   [do not use explicit linker scripts
-			    @<:@default=no@:>@]),
+			   [do not use explicit linker scripts]),
 	    [use_default_link=$withval],
-	    [use_default_link=no])
+	    [use_default_link=default])
 
 AC_ARG_ENABLE([sanity-checks],
 	      AC_HELP_STRING([--disable-sanity-checks],
@@ -1801,7 +1800,71 @@
   fi
   rm -f conftest*])
   AC_SUBST(libc_cv_hashstyle)
-fi
+
+  # The linker's default -shared behavior is good enough if it
+  # does these things that our custom linker scripts ensure that
+  # all allocated NOTE sections come first.
+  if test "$use_default_link" = default; then
+    AC_CACHE_CHECK([for sufficient default -shared layout],
+		   libc_cv_use_default_link, [dnl
+    libc_cv_use_default_link=no
+    cat > conftest.s <<\EOF
+	  .section .note.a,"a",%note
+	  .balign 4
+	  .long 4,4,9
+	  .string "GNU"
+	  .string "foo"
+	  .section .note.b,"a",%note
+	  .balign 4
+	  .long 4,4,9
+	  .string "GNU"
+	  .string "bar"
+EOF
+    if AC_TRY_COMMAND([dnl
+  ${CC-cc} $ASFLAGS -shared -o conftest.so conftest.s 1>&AS_MESSAGE_LOG_FD]) &&
+       ac_try=`$READELF -S conftest.so | sed -n \
+	 ['${x;p;}
+	  s/^ *\[ *[1-9][0-9]*\]  *\([^ ][^ ]*\)  *\([^ ][^ ]*\) .*$/\2 \1/
+	  t a
+	  b
+	  : a
+	  H']`
+    then
+      libc_seen_a=no libc_seen_b=no
+      set -- $ac_try
+      while test $# -ge 2 -a "$1" = NOTE; do
+	case "$2" in
+	.note.a) libc_seen_a=yes ;;
+	.note.b) libc_seen_b=yes ;;
+	esac
+	shift 2
+      done
+      case "$libc_seen_a$libc_seen_b" in
+      yesyes)
+	libc_cv_use_default_link=yes
+	;;
+      *)
+	echo >&AS_MESSAGE_LOG_FD "\
+$libc_seen_a$libc_seen_b from:
+$ac_try"
+	;;
+      esac
+    fi
+    rm -f conftest*])
+    use_default_link=$libc_cv_use_default_link
+  fi
+fi
+
+AC_CACHE_CHECK(linker output format, libc_cv_output_format, [dnl
+if libc_cv_output_format=`
+${CC-cc} -nostartfiles -nostdlib -Wl,--print-output-format 2>&AS_MESSAGE_LOG_FD`
+then
+  :
+else
+  libc_cv_output_format=
+fi
+test -n "$libc_cv_output_format" || libc_cv_output_format=unknown])
+AC_SUBST(libc_cv_output_format)
 
 AC_CACHE_CHECK(for -fno-toplevel-reorder -fno-section-anchors, libc_cv_fno_toplevel_reorder, [dnl
 cat > conftest.c <<EOF

Modified: fsf/trunk/libc/sysdeps/i386/Makefile
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/Makefile (original)
+++ fsf/trunk/libc/sysdeps/i386/Makefile Sun Jul 17 00:13:15 2011
@@ -30,13 +30,16 @@
 # than 4 bytes.
 # Lots of routines in math will use FPU, so make math subdir an exception
 # here.
+# In gcc 4.6 (and maybe earlier?) giving -mpreferred-stack-boundary=2 is
+# an error, so don't try to reduce it here like we used to.  We still
+# explicit set -mpreferred-stack-boundary=4 the places where it matters,
+# in case an older compiler defaulted to 2.
 ifeq ($(subdir),math)
 sysdep-CFLAGS += -mpreferred-stack-boundary=4
 else
 ifeq ($(subdir),csu)
 sysdep-CFLAGS += -mpreferred-stack-boundary=4
 else
-sysdep-CFLAGS += -mpreferred-stack-boundary=2
 # Likewise, any function which calls user callbacks
 uses-callbacks += -mpreferred-stack-boundary=4
 # Likewise, any stack alignment tests