summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-09 20:55:17 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-09 20:55:17 +0000
commit2724b74a2ef5e1cf796056d08fb3ddd5c0d74831 (patch)
tree5f77c0aad21a181bc4dd127d5d54c1be36b67b9f
parent1663b58aff2683fd98f876f45d67e29279fa2caf (diff)
downloadgcc-2724b74a2ef5e1cf796056d08fb3ddd5c0d74831.tar.gz
* configure, config.h.in: Rebuild.
* configure.ac: Use GLIBCXX_CHECK_SDT_H. Don't check for sys/sdt.h. * acinclude.m4 (GLIBCXX_CHECK_SDT_H): New defun. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197649 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/acinclude.m430
-rw-r--r--libstdc++-v3/config.h.in2
-rwxr-xr-xlibstdc++-v3/configure64
-rw-r--r--libstdc++-v3/configure.ac3
5 files changed, 99 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a8eade95573..3ccf5f442df 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,10 @@
+2013-04-09 Tom Tromey <tromey@redhat.com>
+
+ * configure, config.h.in: Rebuild.
+ * configure.ac: Use GLIBCXX_CHECK_SDT_H. Don't check for
+ sys/sdt.h.
+ * acinclude.m4 (GLIBCXX_CHECK_SDT_H): New defun.
+
2013-04-09 Uros Bizjak <ubizjak@gmail.com>
* config/abi/post/alpha-linux-gnu/baseline_symbols.txt: Update.
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 4d06b207af1..619fff02bf7 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -3660,6 +3660,36 @@ AC_DEFUN([GLIBCXX_ENABLE_WERROR], [
])
+dnl
+dnl Check to see if sys/sdt.h exists and that it is suitable for use.
+dnl Some versions of sdt.h were not compatible with C++11.
+dnl
+AC_DEFUN([GLIBCXX_CHECK_SDT_H], [
+ AC_MSG_RESULT([for suitable sys/sdt.h])
+ # Note that this test has to be run with the C language.
+ # Otherwise, sdt.h will try to include some headers from
+ # libstdc++ itself.
+ AC_LANG_SAVE
+ AC_LANG_C
+ AC_CACHE_VAL(glibcxx_cv_sys_sdt_h, [
+ # Because we have to run the test in C, we use grep rather
+ # than the compiler to check for the bug. The bug is that
+ # were strings without trailing whitespace, causing g++
+ # to look for operator"". The pattern searches for the fixed
+ # output.
+ AC_EGREP_CPP([ \",\" ], [
+ #include <sys/sdt.h>
+ int f() { STAP_PROBE(hi, bob); }
+ ], [glibcxx_cv_sys_sdt_h=yes], [glibcxx_cv_sys_sdt_h=no])
+ ])
+ AC_LANG_RESTORE
+ if test $glibcxx_cv_sys_sdt_h = yes; then
+ AC_DEFINE(HAVE_SYS_SDT_H, 1,
+ [Define to 1 if you have a suitable <sys/sdt.h> header file])
+ fi
+ AC_MSG_RESULT($glibcxx_cv_sys_sdt_h)
+])
+
# Macros from the top-level gcc directory.
m4_include([../config/gc++filt.m4])
m4_include([../config/tls.m4])
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 9937a1ed155..90d0479347e 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -400,7 +400,7 @@
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
-/* Define to 1 if you have the <sys/sdt.h> header file. */
+/* Define to 1 if you have a suitable <sys/sdt.h> header file */
#undef HAVE_SYS_SDT_H
/* Define to 1 if you have the <sys/sem.h> header file. */
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 17b6a266c73..44374746c2b 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -3530,11 +3530,11 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
-# Always define AMTAR for backward compatibility. Yes, it's still used
-# in the wild :-( We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
+# Always define AMTAR for backward compatibility.
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
@@ -20413,11 +20413,65 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: for suitable sys/sdt.h" >&5
+$as_echo "for suitable sys/sdt.h" >&6; }
+ # Note that this test has to be run with the C language.
+ # Otherwise, sdt.h will try to include some headers from
+ # libstdc++ itself.
+
+ 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 "${glibcxx_cv_sys_sdt_h+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+
+ # Because we have to run the test in C, we use grep rather
+ # than the compiler to check for the bug. The bug is that
+ # were strings without trailing whitespace, causing g++
+ # to look for operator"". The pattern searches for the fixed
+ # output.
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+ #include <sys/sdt.h>
+ int f() { STAP_PROBE(hi, bob); }
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP " \",\" " >/dev/null 2>&1; then :
+ glibcxx_cv_sys_sdt_h=yes
+else
+ glibcxx_cv_sys_sdt_h=no
+fi
+rm -f conftest*
+
+
+fi
+
+ 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 $glibcxx_cv_sys_sdt_h = yes; then
+
+$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_sys_sdt_h" >&5
+$as_echo "$glibcxx_cv_sys_sdt_h" >&6; }
+
+
# Check for available headers.
for ac_header in endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
-sys/resource.h sys/sdt.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
+sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
wchar.h wctype.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index de664064491..73d430ac105 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -211,12 +211,13 @@ GLIBCXX_CHECK_SC_NPROCESSORS_ONLN
GLIBCXX_CHECK_SC_NPROC_ONLN
GLIBCXX_CHECK_PTHREADS_NUM_PROCESSORS_NP
GLIBCXX_CHECK_SYSCTL_HW_NCPU
+GLIBCXX_CHECK_SDT_H
# Check for available headers.
AC_CHECK_HEADERS([endian.h execinfo.h float.h fp.h ieeefp.h inttypes.h \
locale.h machine/endian.h machine/param.h nan.h stdint.h stdlib.h string.h \
strings.h sys/ipc.h sys/isa_defs.h sys/machine.h sys/param.h \
-sys/resource.h sys/sdt.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
+sys/resource.h sys/sem.h sys/stat.h sys/time.h sys/types.h unistd.h \
wchar.h wctype.h])
# Only do link tests if native. Else, hardcode.