* [PATCH] libstdc++: detect DLLs on windows with <stacktrace>
@ 2024-05-16 18:51 Björn Schäpers
2024-05-17 10:43 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Björn Schäpers @ 2024-05-16 18:51 UTC (permalink / raw)
To: gcc-patches, libstdc++; +Cc: Björn Schäpers
From: Björn Schäpers <bjoern@hazardy.de>
libstdc++-v3/Changelog
* acinclude.m4 (GLIBCXX_ENABLE_BACKTACE): Add check for
tlhelp32.h, matching libbacktrace.
* configure: Regenerate.
* config.h.in: Regenerate.
Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
---
libstdc++-v3/acinclude.m4 | 4 ++++
libstdc++-v3/config.h.in | 3 +++
libstdc++-v3/configure | 15 +++++++++++++++
3 files changed, 22 insertions(+)
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index 51a08bcc8b1..506ce98ae43 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -5481,6 +5481,10 @@ AC_DEFUN([GLIBCXX_ENABLE_BACKTRACE], [
BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1"
fi
AC_CHECK_HEADERS(windows.h)
+ AC_CHECK_HEADERS(tlhelp32.h, [], [],
+ [#ifdef HAVE_WINDOWS_H
+ # include <windows.h>
+ #endif])
# Check for the fcntl function.
if test -n "${with_target_subdir}"; then
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 906e0143099..486ba450749 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -490,6 +490,9 @@
/* Define to 1 if you have the `timespec_get' function. */
#undef HAVE_TIMESPEC_GET
+/* Define to 1 if you have the <tlhelp32.h> header file. */
+#undef HAVE_TLHELP32_H
+
/* Define to 1 if the target supports thread-local storage. */
#undef HAVE_TLS
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 21abaeb0778..a2d59520146 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -53865,6 +53865,21 @@ _ACEOF
fi
+done
+
+ for ac_header in tlhelp32.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "tlhelp32.h" "ac_cv_header_tlhelp32_h" "#ifdef HAVE_WINDOWS_H
+ # include <windows.h>
+ #endif
+"
+if test "x$ac_cv_header_tlhelp32_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_TLHELP32_H 1
+_ACEOF
+
+fi
+
done
--
2.44.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libstdc++: detect DLLs on windows with <stacktrace>
2024-05-16 18:51 [PATCH] libstdc++: detect DLLs on windows with <stacktrace> Björn Schäpers
@ 2024-05-17 10:43 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2024-05-17 10:43 UTC (permalink / raw)
To: Björn Schäpers; +Cc: gcc-patches, libstdc++, Björn Schäpers
On Thu, 16 May 2024 at 19:52, Björn Schäpers <gcc@hazardy.de> wrote:
>
> From: Björn Schäpers <bjoern@hazardy.de>
>
> libstdc++-v3/Changelog
>
> * acinclude.m4 (GLIBCXX_ENABLE_BACKTACE): Add check for
> tlhelp32.h, matching libbacktrace.
> * configure: Regenerate.
> * config.h.in: Regenerate.
This looks good, thanks. I'll apply to trunk and probably backport it too.
>
> Signed-off-by: Björn Schäpers <bjoern@hazardy.de>
> ---
> libstdc++-v3/acinclude.m4 | 4 ++++
> libstdc++-v3/config.h.in | 3 +++
> libstdc++-v3/configure | 15 +++++++++++++++
> 3 files changed, 22 insertions(+)
>
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index 51a08bcc8b1..506ce98ae43 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -5481,6 +5481,10 @@ AC_DEFUN([GLIBCXX_ENABLE_BACKTRACE], [
> BACKTRACE_CPPFLAGS="$BACKTRACE_CPPFLAGS -DHAVE_DL_ITERATE_PHDR=1"
> fi
> AC_CHECK_HEADERS(windows.h)
> + AC_CHECK_HEADERS(tlhelp32.h, [], [],
> + [#ifdef HAVE_WINDOWS_H
> + # include <windows.h>
> + #endif])
>
> # Check for the fcntl function.
> if test -n "${with_target_subdir}"; then
> diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
> index 906e0143099..486ba450749 100644
> --- a/libstdc++-v3/config.h.in
> +++ b/libstdc++-v3/config.h.in
> @@ -490,6 +490,9 @@
> /* Define to 1 if you have the `timespec_get' function. */
> #undef HAVE_TIMESPEC_GET
>
> +/* Define to 1 if you have the <tlhelp32.h> header file. */
> +#undef HAVE_TLHELP32_H
> +
> /* Define to 1 if the target supports thread-local storage. */
> #undef HAVE_TLS
>
> diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
> index 21abaeb0778..a2d59520146 100755
> --- a/libstdc++-v3/configure
> +++ b/libstdc++-v3/configure
> @@ -53865,6 +53865,21 @@ _ACEOF
>
> fi
>
> +done
> +
> + for ac_header in tlhelp32.h
> +do :
> + ac_fn_c_check_header_compile "$LINENO" "tlhelp32.h" "ac_cv_header_tlhelp32_h" "#ifdef HAVE_WINDOWS_H
> + # include <windows.h>
> + #endif
> +"
> +if test "x$ac_cv_header_tlhelp32_h" = xyes; then :
> + cat >>confdefs.h <<_ACEOF
> +#define HAVE_TLHELP32_H 1
> +_ACEOF
> +
> +fi
> +
> done
>
>
> --
> 2.44.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-17 10:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-16 18:51 [PATCH] libstdc++: detect DLLs on windows with <stacktrace> Björn Schäpers
2024-05-17 10:43 ` 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).