From 523e8716a452978a7972478d8cdbbe0d1a794a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Mon, 12 Dec 2022 18:27:49 +0100 Subject: libstdc++: enable on windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- 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 3840a9d7..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 header file. */ #undef HAVE_WCTYPE_H +/* Define to 1 if you have the header file. */ +#undef HAVE_WINDOWS_H + /* Define if writev is available in . */ #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 -- cgit v1.1