aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Schäpers <bjoern@hazardy.de>2022-12-12 18:27:49 +0100
committerJonathan Wakely <jwakely@redhat.com>2023-01-14 20:49:45 +0000
commit523e8716a452978a7972478d8cdbbe0d1a794a74 (patch)
treeed3f57c4617096fe9f4c90fe2dcb58c0d3ad11dc
parentb1c839be8353edfb1951454be3c5a8150f771385 (diff)
downloadgcc-523e8716a452978a7972478d8cdbbe0d1a794a74.zip
gcc-523e8716a452978a7972478d8cdbbe0d1a794a74.tar.gz
gcc-523e8716a452978a7972478d8cdbbe0d1a794a74.tar.bz2
libstdc++: enable <stacktrace> on windows
libstdc++-v3/Changelog * acinclude.m4 (GLIBCXX_ENABLE_BACKTRACE): Add check for windows.h. Add pecoff as FORMAT_FILE. * config.h.in: Regenerate. * configure: Regenerate. * src/libbacktrace/Makefile.am: Regenerate. * src/libbacktrace/Makefile.in: Add pecoff.c as FORMAT_FILE. Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
-rw-r--r--libstdc++-v3/acinclude.m42
-rw-r--r--libstdc++-v3/config.h.in3
-rwxr-xr-xlibstdc++-v3/configure13
-rw-r--r--libstdc++-v3/src/libbacktrace/Makefile.am1
-rw-r--r--libstdc++-v3/src/libbacktrace/Makefile.in4
5 files changed, 23 insertions, 0 deletions
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 3840a9d..b1608ae 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -4995,6 +4995,7 @@ AC_DEFUN([GLIBCXX_ENABLE_BACKTRACE], [
if test "$have_dl_iterate_phdr" = "yes"; then
BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1"
fi
+ AC_CHECK_HEADERS(windows.h)
# Check for the fcntl function.
if test -n "${with_target_subdir}"; then
@@ -5040,6 +5041,7 @@ glibcxx_cv_sys_filetype=$filetype])
FORMAT_FILE=
case "$glibcxx_cv_sys_filetype" in
elf*) FORMAT_FILE="elf.lo" ;;
+pecoff*) FORMAT_FILE="pecoff.lo" ;;
*) AC_MSG_WARN([could not determine output file type])
FORMAT_FILE="unknown.lo"
enable_libstdcxx_backtrace=no
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 75eddfd..a336daf 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -525,6 +525,9 @@
/* Define to 1 if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H
+/* Define to 1 if you have the <windows.h> header file. */
+#undef HAVE_WINDOWS_H
+
/* Define if writev is available in <sys/uio.h>. */
#undef HAVE_WRITEV
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index ab12a2d..9c0f3a3 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -71101,6 +71101,18 @@ rm -f conftest*
if test "$have_dl_iterate_phdr" = "yes"; then
BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1"
fi
+ for ac_header in windows.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
+if test "x$ac_cv_header_windows_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_WINDOWS_H 1
+_ACEOF
+
+fi
+
+done
+
# Check for the fcntl function.
if test -n "${with_target_subdir}"; then
@@ -71190,6 +71202,7 @@ $as_echo "$glibcxx_cv_sys_filetype" >&6; }
FORMAT_FILE=
case "$glibcxx_cv_sys_filetype" in
elf*) FORMAT_FILE="elf.lo" ;;
+pecoff*) FORMAT_FILE="pecoff.lo" ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not determine output file type" >&5
$as_echo "$as_me: WARNING: could not determine output file type" >&2;}
FORMAT_FILE="unknown.lo"
diff --git a/libstdc++-v3/src/libbacktrace/Makefile.am b/libstdc++-v3/src/libbacktrace/Makefile.am
index 52d8f81..b34a429 100644
--- a/libstdc++-v3/src/libbacktrace/Makefile.am
+++ b/libstdc++-v3/src/libbacktrace/Makefile.am
@@ -71,6 +71,7 @@ libstdc___libbacktrace_la_SOURCES = \
FORMAT_FILES = \
elf.c \
+ pecoff.c \
unknown.c
VIEW_FILES = \
diff --git a/libstdc++-v3/src/libbacktrace/Makefile.in b/libstdc++-v3/src/libbacktrace/Makefile.in
index 4bc0556..7c11272 100644
--- a/libstdc++-v3/src/libbacktrace/Makefile.in
+++ b/libstdc++-v3/src/libbacktrace/Makefile.in
@@ -518,6 +518,7 @@ libstdc___libbacktrace_la_SOURCES = \
FORMAT_FILES = \
elf.c \
+ pecoff.c \
unknown.c
VIEW_FILES = \
@@ -675,6 +676,9 @@ $(obj_prefix)-cp-demangle.lo: cp-demangle.c
$(obj_prefix)-elf.lo: elf.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstdc___libbacktrace_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(obj_prefix)-elf.lo `test -f 'elf.c' || echo '$(srcdir)/'`elf.c
+$(obj_prefix)-pecoff.lo: pecoff.c
+ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstdc___libbacktrace_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(obj_prefix)-pecoff.lo `test -f 'pecoff.c' || echo '$(srcdir)/'`pecoff.c
+
$(obj_prefix)-unknown.lo: unknown.c
$(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstdc___libbacktrace_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o $(obj_prefix)-unknown.lo `test -f 'unknown.c' || echo '$(srcdir)/'`unknown.c