From patchwork Thu Nov 30 16:20:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Huber X-Patchwork-Id: 171990 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp507663vqy; Thu, 30 Nov 2023 08:21:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQBjWL9OXJ7Sltxbsiqfe3AA0beJgQwPgP+LBJNZTB2nsTh9JlJoYn26tSiiEKC3liCvL+ X-Received: by 2002:a67:c404:0:b0:464:4897:f5ec with SMTP id c4-20020a67c404000000b004644897f5ecmr4410400vsk.14.1701361283798; Thu, 30 Nov 2023 08:21:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701361283; cv=pass; d=google.com; s=arc-20160816; b=fL+noZv0Hwsck8uJqEpYah8r0m8dmnFmEMipHOdCWfn7Wvd6ay3gyOg1MDx31QbjWW kRYbT/vq3jZBI+k3zTqRN1hbe3ilM9UjhEgM3+irljSsvH6gAEED7wrQ7kKrdMJG6X1n gvGBc0tMhKAMRai6xTxKf0AuMLeJD/jNKquJ06VECmQmBWaqKk2IQ8jZI97tGq4ycZu8 0V9mAn6LrkdbXZ6OaonvmHq6nFNTyXs0KtPO+LoiQc4i34Qyfv9Fy6izemEtmdR9H+P6 VsPpTCYxIC1DVwKGLl4TJF8jVYTZnUdn1lZ//11gcjaeib7SHTggl8AHPyEWRtqzwNGB Ea6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:arc-filter :dmarc-filter:delivered-to; bh=HCCRMw+WYuv7cbAS7isYpES/Czbn+GBxh5XXLRO5eRI=; fh=2g9vuPVOO2eKFE5NaYxRVUAMVRSnImDlHr91fujHc/8=; b=CjVRtndIGSC8Y7yHCxD6Zg/IcmbC/YhAREBOGRVhJhvGfe884Fck1W1ZscRHcgWNJe hDzuPQKHLrMLf6a9bm55orKcNgFuQ+e2OGFGDgYywoevbp9u//T2tTl0q8ij6yNuJUHS WfN63NbyEYRTq5uax7OdpRGfmBU65Hbnj/rHmgoRKQ7pnFz8dg2BwYDVsPOhc0oadd0I 3TIDBfh5j71rTMbzKilebcgDW07M7bx4wUVu7WjaDqvsswBlTOU/AfEf8LLAPy0Lq8aD m7oXZAENiCHfMzu1MrDaK6J1GwBUbVuNon1mkEFAatZ55Q8cAvylPInLmoiNRVtlLIGK roJQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id v2-20020ab06582000000b007c55d2c63a7si211073uam.224.2023.11.30.08.21.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:21:23 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8990E38754A5 for ; Thu, 30 Nov 2023 16:21:23 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from dedi548.your-server.de (dedi548.your-server.de [85.10.215.148]) by sourceware.org (Postfix) with ESMTPS id EED27385AC19 for ; Thu, 30 Nov 2023 16:20:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EED27385AC19 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embedded-brains.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embedded-brains.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org EED27385AC19 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=85.10.215.148 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701361261; cv=none; b=YalRZTdyqLJfJhqxh86BVNs0P8RgXCdoDiJdEQiODvNRIeBpLgEGxA44DuWbF6qehOrPJrrZnNJoqdxO+PK1io1JUNG1xHyYZme3quTffYnb2e7YcSdK4gXmryY4sf6kfdMEcyhzKCKlhnV+dBv+x5Zbhs8O66/eJXebdNAsbtg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701361261; c=relaxed/simple; bh=JrHdgwMrp0akiYh7DwPZnRzAkJs8FM5yibYjnCkAfOQ=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=XpXl1J/L4hCTLHQwZMmt5sJk3ABaqQ46XwWj1EPPLAxzg2s1K26QK/s9rJ1cZg7unS7qqDl1/nxy9VQVY91RjOCvk48+pcoe6HbqXulqUwZmFYlxAhs+4atA5OrbXwg6t9RcRMgcJxobmdoTqDZBTHYcJFCkiCWA3H4C/9xL7kw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from sslproxy01.your-server.de ([78.46.139.224]) by dedi548.your-server.de with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r8jmc-000Pnu-Bm; Thu, 30 Nov 2023 17:20:58 +0100 Received: from [82.100.198.138] (helo=mail.embedded-brains.de) by sslproxy01.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r8jmc-000Voo-7T; Thu, 30 Nov 2023 17:20:58 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 96B004801CC; Thu, 30 Nov 2023 17:20:57 +0100 (CET) Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10032) with ESMTP id VFmTLDtEz4Xb; Thu, 30 Nov 2023 17:20:57 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded-brains.de (Postfix) with ESMTP id 3C21748018D; Thu, 30 Nov 2023 17:20:57 +0100 (CET) X-Virus-Scanned: amavis at zimbra.eb.localhost Received: from mail.embedded-brains.de ([127.0.0.1]) by localhost (zimbra.eb.localhost [127.0.0.1]) (amavis, port 10026) with ESMTP id pb2Rpeshr4zF; Thu, 30 Nov 2023 17:20:57 +0100 (CET) Received: from zimbra.eb.localhost (unknown [192.168.96.242]) by mail.embedded-brains.de (Postfix) with ESMTPSA id 1C27648017F; Thu, 30 Nov 2023 17:20:57 +0100 (CET) From: Sebastian Huber To: gcc-patches@gcc.gnu.org Cc: Matthias Klose Subject: [PATCH] gcov: Fix __LIBGCC_HAVE_LIBATOMIC definition Date: Thu, 30 Nov 2023 17:20:54 +0100 Message-Id: <20231130162054.89738-1-sebastian.huber@embedded-brains.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 X-Authenticated-Sender: smtp-embedded@poldi-networks.de X-Virus-Scanned: Clear (ClamAV 0.103.10/27109/Thu Nov 30 09:44:04 2023) X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784006609766417966 X-GMAIL-MSGID: 1784006609766417966 In libgcov we use defined (__LIBGCC_HAVE_LIBATOMIC), so we must define it only if needed (vs. #if __LIBGCC_HAVE_LIBATOMIC). gcc/c-family/ChangeLog: PR target/112777 * c-cppbuiltin.cc (c_cpp_builtins): Define __LIBGCC_HAVE_LIBATOMIC only if targetm.have_libatomic is true. --- gcc/c-family/c-cppbuiltin.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/c-family/c-cppbuiltin.cc b/gcc/c-family/c-cppbuiltin.cc index e536429fa4c..f8ec6f1747c 100644 --- a/gcc/c-family/c-cppbuiltin.cc +++ b/gcc/c-family/c-cppbuiltin.cc @@ -1570,8 +1570,8 @@ c_cpp_builtins (cpp_reader *pfile) /* For libgcov. */ builtin_define_with_int_value ("__LIBGCC_VTABLE_USES_DESCRIPTORS__", TARGET_VTABLE_USES_DESCRIPTORS); - builtin_define_with_int_value ("__LIBGCC_HAVE_LIBATOMIC", - targetm.have_libatomic); + if (targetm.have_libatomic) + cpp_define (pfile, "__LIBGCC_HAVE_LIBATOMIC"); } /* For use in assembly language. */