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>
This commit is contained in:
Björn Schäpers 2022-12-12 18:27:49 +01:00 committed by Jonathan Wakely
parent b1c839be83
commit 523e8716a4
5 changed files with 23 additions and 0 deletions

View file

@ -4995,6 +4995,7 @@ AC_DEFUN([GLIBCXX_ENABLE_BACKTRACE], [
if test "$have_dl_iterate_phdr" = "yes"; then if test "$have_dl_iterate_phdr" = "yes"; then
BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1" BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1"
fi fi
AC_CHECK_HEADERS(windows.h)
# Check for the fcntl function. # Check for the fcntl function.
if test -n "${with_target_subdir}"; then if test -n "${with_target_subdir}"; then
@ -5040,6 +5041,7 @@ glibcxx_cv_sys_filetype=$filetype])
FORMAT_FILE= FORMAT_FILE=
case "$glibcxx_cv_sys_filetype" in case "$glibcxx_cv_sys_filetype" in
elf*) FORMAT_FILE="elf.lo" ;; elf*) FORMAT_FILE="elf.lo" ;;
pecoff*) FORMAT_FILE="pecoff.lo" ;;
*) AC_MSG_WARN([could not determine output file type]) *) AC_MSG_WARN([could not determine output file type])
FORMAT_FILE="unknown.lo" FORMAT_FILE="unknown.lo"
enable_libstdcxx_backtrace=no enable_libstdcxx_backtrace=no

View file

@ -525,6 +525,9 @@
/* Define to 1 if you have the <wctype.h> header file. */ /* Define to 1 if you have the <wctype.h> header file. */
#undef HAVE_WCTYPE_H #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>. */ /* Define if writev is available in <sys/uio.h>. */
#undef HAVE_WRITEV #undef HAVE_WRITEV

View file

@ -71101,6 +71101,18 @@ rm -f conftest*
if test "$have_dl_iterate_phdr" = "yes"; then if test "$have_dl_iterate_phdr" = "yes"; then
BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1" BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1"
fi 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. # Check for the fcntl function.
if test -n "${with_target_subdir}"; then if test -n "${with_target_subdir}"; then
@ -71190,6 +71202,7 @@ $as_echo "$glibcxx_cv_sys_filetype" >&6; }
FORMAT_FILE= FORMAT_FILE=
case "$glibcxx_cv_sys_filetype" in case "$glibcxx_cv_sys_filetype" in
elf*) FORMAT_FILE="elf.lo" ;; 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:${as_lineno-$LINENO}: WARNING: could not determine output file type" >&5
$as_echo "$as_me: WARNING: could not determine output file type" >&2;} $as_echo "$as_me: WARNING: could not determine output file type" >&2;}
FORMAT_FILE="unknown.lo" FORMAT_FILE="unknown.lo"

View file

@ -71,6 +71,7 @@ libstdc___libbacktrace_la_SOURCES = \
FORMAT_FILES = \ FORMAT_FILES = \
elf.c \ elf.c \
pecoff.c \
unknown.c unknown.c
VIEW_FILES = \ VIEW_FILES = \

View file

@ -518,6 +518,7 @@ libstdc___libbacktrace_la_SOURCES = \
FORMAT_FILES = \ FORMAT_FILES = \
elf.c \ elf.c \
pecoff.c \
unknown.c unknown.c
VIEW_FILES = \ VIEW_FILES = \
@ -675,6 +676,9 @@ $(obj_prefix)-cp-demangle.lo: cp-demangle.c
$(obj_prefix)-elf.lo: elf.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 $(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 $(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 $(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