public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-5172] libstdc++: enable <stacktrace> on windows
@ 2023-01-14 22:00 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-01-14 22:00 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:523e8716a452978a7972478d8cdbbe0d1a794a74

commit r13-5172-g523e8716a452978a7972478d8cdbbe0d1a794a74
Author: Björn Schäpers <bjoern@hazardy.de>
Date:   Mon Dec 12 18:27:49 2022 +0100

    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>

Diff:
---
 libstdc++-v3/acinclude.m4                 |  2 ++
 libstdc++-v3/config.h.in                  |  3 +++
 libstdc++-v3/configure                    | 13 +++++++++++++
 libstdc++-v3/src/libbacktrace/Makefile.am |  1 +
 libstdc++-v3/src/libbacktrace/Makefile.in |  4 ++++
 5 files changed, 23 insertions(+)

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 3840a9d761a..b1608ae9237 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 75eddfd016d..a336daf2303 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 ab12a2d5b27..9c0f3a3e7c9 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 52d8f81b97b..b34a429a21d 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 4bc055649ea..7c112722938 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-14 22:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-14 22:00 [gcc r13-5172] libstdc++: enable <stacktrace> on windows Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).