From patchwork Wed Aug 28 20:43:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1978093 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=hyp+9m0/; dkim-atps=neutral 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 4WvGbZ412wz1yhJ for ; Thu, 29 Aug 2024 06:43:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 56B983858402 for ; Wed, 28 Aug 2024 20:43:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 42CD63858289 for ; Wed, 28 Aug 2024 20:43:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 42CD63858289 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 42CD63858289 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724877803; cv=none; b=Fj0wCpCZHLe3DNeC2DD+e3QLClq2Fl4ECqWDuzV3Eq5TDxKa+6m+jesdJzGVwjSZM9EVXytMKS/7NJAS4s6LzKPGLfuxht4Bz8GU8MD7eSTI6tGo/0/b6tlFJuju9D7lrVjrQvyCQD9CMSsCbY4QxnCoBKUQ4vWXAkdP/110ou0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724877803; c=relaxed/simple; bh=a4+nSOSDFYLD670ePhecNbLWCrdpfxA8GA9Pcr8iJdI=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=XB8X42ZyHYP/BOHrddwtYsUcLqGOj79DfpUGSy4Iyvi7UVdUpbgIBrOf/JIkEd3KDQHRXG6HtG4bK0lWTBeR6/rk7D4ScknNYBn8qa53eAm1h1xoVX7UuWfpe0v5UPRaDo2U0kxOnFkU/c4b7S1L1tYtUMqqUKSqAxmRjGTG5Og= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1724877798; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=fUSKc76E6i3CYvr3qPoLrvCx71UJ2NZSQL1jwadVte0=; b=hyp+9m0/jTrPyGGG32P/O4Qv/QdxwJphIMukNq9676L2j2/C0xq3aM/1ojYNdgPZfvY3KH vDpjT/8KV79HY8ScAb0q4pyRCu8b00HM8z3qSKbUzPakVXn2Bmwtr9SbwRZfPp1W2k0ZVX GQMyeIECttaz4bKga1lpcEO5I4LGgTA= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-OOj2VGn8P26DZIEbxlJ2sQ-1; Wed, 28 Aug 2024 16:43:14 -0400 X-MC-Unique: OOj2VGn8P26DZIEbxlJ2sQ-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F3EB81956080; Wed, 28 Aug 2024 20:43:13 +0000 (UTC) Received: from localhost (unknown [10.42.28.101]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7F0AE1955DD8; Wed, 28 Aug 2024 20:43:13 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Fix autoconf check for O_NONBLOCK in Date: Wed, 28 Aug 2024 21:43:06 +0100 Message-ID: <20240828204312.1862245-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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 Tested x86_64-linux. Pushed to trunk. -- >8 -- I misused the AC_CHECK_DECL macro, assuming that it behaved like AC_CHECK_DECLS and always defined a HAVE_xxx macro if the decl was found. Instead, the [action-if-found] shell commands are needed to defined HAVE_O_NONBLOCK explicitly. libstdc++-v3/ChangeLog: * configure.ac: Fix check for O_NONBLOCK. * config.h.in: Regenerate. * configure: Regenerate. --- libstdc++-v3/config.h.in | 3 +++ libstdc++-v3/configure | 2 ++ libstdc++-v3/configure.ac | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in index 486ba450749..91e920044ee 100644 --- a/libstdc++-v3/config.h.in +++ b/libstdc++-v3/config.h.in @@ -302,6 +302,9 @@ /* Define if openat is available in . */ #undef HAVE_OPENAT +/* Define if O_NONBLOCK is defined in */ +#undef HAVE_O_NONBLOCK + /* Define if poll is available in . */ #undef HAVE_POLL diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 305675eaa1e..005c4a29fd0 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -54132,6 +54132,8 @@ if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then " if test "x$ac_cv_have_decl_O_NONBLOCK" = xyes; then : +$as_echo "#define HAVE_O_NONBLOCK 1" >>confdefs.h + fi fi diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 4049f54bd5a..a3b257fe652 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -554,7 +554,10 @@ AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/socket.h sys/uio.h poll.h netdb.h arpa AC_CHECK_DECL(F_GETFL,,,[#include ]) AC_CHECK_DECL(F_SETFL,,,[#include ]) if test "$ac_cv_have_decl_F_GETFL$ac_cv_have_decl_F_SETFL" = yesyes ; then - AC_CHECK_DECL(O_NONBLOCK,,,[#include ]) + AC_CHECK_DECL(O_NONBLOCK, + AC_DEFINE(HAVE_O_NONBLOCK,1,[Define if O_NONBLOCK is defined in ]), + [], + [#include ]) fi # For Transactional Memory TS