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: 81044 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 03A3F3838A07 for ; Thu, 30 Nov 2023 16:21:16 +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+patchwork=sourceware.org@gcc.gnu.org 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. */