From patchwork Thu May 16 18:51:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= X-Patchwork-Id: 1936214 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VgK2Z3gwqz1yfq for ; Fri, 17 May 2024 04:52:06 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C3919384AB6C for ; Thu, 16 May 2024 18:52:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.hazardy.de (mail.hazardy.de [78.94.181.132]) by sourceware.org (Postfix) with ESMTPS id A00D33858D20; Thu, 16 May 2024 18:51:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A00D33858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=hazardy.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hazardy.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A00D33858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=78.94.181.132 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715885502; cv=none; b=pEuLRRRDChjaL9/72PoeVXjQ5T/XJZzbj/KgcLiTwtqXZyXOX/eHs0CEVOxsi1mgrKisRs1RQG2qk+lUDytfCaOpGitx7F1molAJnBWEiun3sr4wzXfoAEMCJnZOgeT8BbhX5N3LJPzX3PbSMOe2urTwInVYCv3gIVJ1CK+1wOI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715885502; c=relaxed/simple; bh=TttZWMDj7Lq+IM4kl+jmnBwbHgylI2gKlQy6gMy9kic=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=jygcSBZZ6ikos4802iRCSUtI0herwTnYgZcLOJkQFR3WHJRDjn/SQ40EhRCbknhRngfWVANXiCHPNGaCm/PqTwlEYoH/qlQXbMBWZ9kXjzypOUvMnp3ekWzzNyGSJwBgCG3MRl8l/xxC65ZoZk5QT+c7XQ6zEOsHqvW50gWqIBo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from DE-23012.kuennecke.com (unknown [78.94.181.132]) by mail.hazardy.de (Postfix) with ESMTPSA id 9D46770092D; Thu, 16 May 2024 20:51:39 +0200 (CEST) From: =?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= To: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org Cc: =?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?= Subject: [PATCH] libstdc++: detect DLLs on windows with Date: Thu, 16 May 2024 20:51:01 +0200 Message-ID: <20240516185101.19358-1-gcc@hazardy.de> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org From: Björn Schäpers 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 --- 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 + #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 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 + #endif +" +if test "x$ac_cv_header_tlhelp32_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_TLHELP32_H 1 +_ACEOF + +fi + done