This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.19-844-g9fe7e78


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  9fe7e787adc4f41201c441014fbad318eaae6f80 (commit)
      from  23fe486bebc9ce58405853eb70cd87352156c91d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9fe7e787adc4f41201c441014fbad318eaae6f80

commit 9fe7e787adc4f41201c441014fbad318eaae6f80
Author: Roland McGrath <roland@hack.frob.com>
Date:   Thu Jul 31 13:07:19 2014 -0700

    Use __builtin_trap for ABORT_INSTRUCTION.

diff --git a/ChangeLog b/ChangeLog
index d50535c..e359c13 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2014-07-31  Roland McGrath  <roland@hack.frob.com>
 
+	* 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 d612a04..7da1a9f 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 c8d2967..646e0bc 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 566ecb2..e89faa0 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 106a330..4ac11d2 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
+   <http://www.gnu.org/licenses/>.  */
+
+#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 */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                     |    6 ++++++
 config.h.in                   |    4 ++++
 configure                     |   38 ++++++++++++++++++++++++++++++++++++++
 configure.ac                  |   17 +++++++++++++++++
 sysdeps/generic/abort-instr.h |   31 ++++++++++++++++++++++++++++++-
 5 files changed, 95 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]