From patchwork Sat Oct 22 11:54:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: LIU Hao X-Patchwork-Id: 7880 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1169886wrr; Sat, 22 Oct 2022 04:55:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4b4PpBtbLRVuPai21EIOj/0DQsjFfJEZ1kc7nviaKM7v4BcXF3nCp1C+axZpm+CCwBpwds X-Received: by 2002:a17:906:5daa:b0:791:8933:f9f0 with SMTP id n10-20020a1709065daa00b007918933f9f0mr19468578ejv.335.1666439711275; Sat, 22 Oct 2022 04:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666439711; cv=none; d=google.com; s=arc-20160816; b=YQ+2Vyy0HScQ75TVFAVSWC994MlFYkLCdTyWjEyzX3Cd1dGlMhOIgcOR6iYcvofwQH Y7INzvSgV+BZDTDSSYGArm8rYgOKlA0szeom3+QtBZphbReR8MUXW/LdWmbFlKzRZf3J afKtQEj/4QHWqTjU5Sb6vYQBBJWSFm6ACoA3hXk5ydmR9Q30fbx50XyASMuzkDeseCdj M+AlSk6eRHCWsxB2zYFTZ/h2bvwdpzySqB2JOTsxFhCpDH06db0BMVjSGXwnmnkT5gL5 ECMgZwsY3O2QZZMaPi7MrHaD/gdfKnJmzNGfKNSgHxk+CefsRlU90u6i1V1gHvURwAxo OP7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :content-language:user-agent:mime-version:date:message-id :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=ciLNTHSibYY/w3y1QQ/bhuwpwSkRmU5WHz0dQj+We+s=; b=yWiiVqN6AlyCNFi0iQAnVF96PZkhHQO9OQUu4XczuPeIroLSbU0LwyACgp4RMjCSCl OjPk/e8wG43w93tfJnMe1tfuiaAD/F0+4Y4ih0cUO+nGAHV/9l7Ug4FjBaLzm09hnpj9 Bko+5xr+preXoOfFh0+//wxtw70U2bkh18hoWptxh3dSwjzl7yR3OZn454dvwYi3HGJB wiz+Op895xMG119vk1CDjn6xjyt3zfPVJwhZ28zb7EuuWE7EyMBt8BEeK6iJYwcmNUXb c4X/Dnf5LVlntxVn3NcWGHcNZUdkqfkrj/FbGRS8+VTmVcdn9mB7Ftvr//aalnVot2dv 1FVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DVl0UjDI; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id di8-20020a170906730800b00783de095de7si23844332ejc.847.2022.10.22.04.55.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Oct 2022 04:55:11 -0700 (PDT) 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; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=DVl0UjDI; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 16D4F3858015 for ; Sat, 22 Oct 2022 11:55:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 16D4F3858015 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1666439710; bh=ciLNTHSibYY/w3y1QQ/bhuwpwSkRmU5WHz0dQj+We+s=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DVl0UjDIDh844DmPLh3/eXSuKYpwjWuTG73R0pK6rklrL1b+LFYmI2FX42iVbJp+x QFZEs9CXikyBQJpehcIrh9LZx3FYhj5vp2vnyJu+p8g+A8UlaXlOL+JUTsBFVuwmLw +3oIlxRHcxBMFyzZhfPClp3Owu2Ut1kGscfxz9f8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from m15114.mail.126.com (m15114.mail.126.com [220.181.15.114]) by sourceware.org (Postfix) with ESMTP id 936073858C53 for ; Sat, 22 Oct 2022 11:54:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 936073858C53 Received: from [192.168.1.2] (unknown [101.93.199.8]) by smtp7 (Coremail) with SMTP id DsmowADHzXnq2VNjOj81DQ--.47290S2; Sat, 22 Oct 2022 19:54:19 +0800 (CST) Message-ID: <9d2923cb-90cb-a0da-3b80-ac9e543af880@126.com> Date: Sat, 22 Oct 2022 19:54:20 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.4.0 Content-Language: en-US To: gcc-patches@gcc.gnu.org Subject: [PATCH] libgcc: Update 'gthr-mcf.h' to include a dedicated header for libobjc X-CM-TRANSID: DsmowADHzXnq2VNjOj81DQ--.47290S2 X-Coremail-Antispam: 1Uf129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7v73 VFW2AGmfu7bjvjm3AaLaJ3UbIYCTnIWIevJa73UjIFyTuYvjxUVrb1DUUUU X-Originating-IP: [101.93.199.8] X-CM-SenderInfo: 5okbz0xxvhqiyswou0bp/1tbi5ByiRlpEEqsOrwABsb X-Spam-Status: No, score=-3133.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: LIU Hao via Gcc-patches From: LIU Hao Reply-To: LIU Hao Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747388686922837810?= X-GMAIL-MSGID: =?utf-8?q?1747388686922837810?= This allows building libobjc and enabling Objective-C. Tested against GCC 12 branch on i686-w64-mingw32. --- Best regards, LIU Hao From c05cceb2f3baa96c9381be38717bdf6f1f3adb76 Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Sat, 22 Oct 2022 17:31:46 +0800 Subject: [PATCH] libgcc: Update 'gthr-mcf.h' to include a dedicated header for libobjc 'libobjc/thr.c' includes 'gthr.h'. While all the other gthread headers have `#ifdef _LIBOBJC` checks, and provide a different set of inline functions, I think having one header provide two completely unrelated set of APIs is unsatisfactory, complicates maintenance, and hinders further development. This commit references a new header for libobjc, and adds a copyright notice, as in other headers. libgcc/ChangeLog: * config/i386/gthr-mcf.h: Include 'gthr_libobjc.h' when building libobjc, instead of 'gthr.h' --- libgcc/config/i386/gthr-mcf.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/libgcc/config/i386/gthr-mcf.h b/libgcc/config/i386/gthr-mcf.h index 58131bb7ca9..40da86802b6 100644 --- a/libgcc/config/i386/gthr-mcf.h +++ b/libgcc/config/i386/gthr-mcf.h @@ -1 +1,36 @@ +/* Threads compatibility routines for libgcc and libobjc. */ +/* Copyright (C) 2022 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 3, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +Under Section 7 of GPL version 3, you are granted additional +permissions described in the GCC Runtime Library Exception, version +3.1, as published by the Free Software Foundation. + +You should have received a copy of the GNU General Public License and +a copy of the GCC Runtime Library Exception along with this program; +see the files COPYING3 and COPYING.RUNTIME respectively. If not, see +. */ + +#ifdef _LIBOBJC + +/* libobjc references some internal structures and requires a + * dedicated set of functions. */ +#include + +#else /* _LIBOBJC */ + +/* This is for libgcc and libstdc++. */ #include + +#endif /* _LIBOBJC */