From patchwork Sun Jul 2 14:26:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 115095 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp11591065vqr; Sun, 2 Jul 2023 07:27:31 -0700 (PDT) X-Google-Smtp-Source: APBJJlHP3n4QuNos8pSD+kbNmkz2YB0o14yTTaqiTTs4TlOi2sPc1qUvawaMv1Pp2F3z3CteC42o X-Received: by 2002:a5d:6647:0:b0:314:362d:6d7b with SMTP id f7-20020a5d6647000000b00314362d6d7bmr924137wrw.19.1688308050800; Sun, 02 Jul 2023 07:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688308050; cv=none; d=google.com; s=arc-20160816; b=GUPaPOZbSc1a+qoARZBClDhI5eFHyB6Cj96LvAsGcJWYpCh6E9NrVxgjxhreTvaKUK 9hepw4Kbv7oWw0OKNdLmWQ/tVkHkewZPm1fV90LosyFTLIwO+QkkGqiUZCuV86P+GP3r iIunC4kPzhjXNBcO+yU9HDVsrnUaysDO073B+0Z60msA/AFdK50yTL+mSNnka8tiNVUW bsSu12rAXm6UnUqIjbs9OrnexIGRO/Vh76Qk0JqkJzisODuNMYxcx2ApTNBeSmT2RTJr LSguMU2rPf4ZdKQCyN66EKikXTe5Su9o5JpvfAaG19zusOSl71YoqbldYtycLGXQ9j37 Q9LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=OjZDwQDuuqCj6kKm8jjMd3RY4XTC1JnpsZcvRWd3MKk=; fh=hKkF4Qm4zMpuuPSvBuLljwLCLYziV8/JqYgl0gS1cUA=; b=autJUkjbh4XJ5ghydcS0qMq/33rdvHGJP8S3lPz4/wNIV37G0IHCYdWq8hh6gTz5Iu VEeg7NqBiBK2Mj3W/C0qJgeBSnrrtvCQpedxkorbfK0cm0kXsBbYA+AnkjQbcBOtWKLU UTnzZno3v4vYt+/o4URvk8omPMDph1NaGirYlfRfk9vq4Hse58WiaUBNd9pq7SfUqwMA 1m/wVYkGeKky7t1utFbFcHnwLjEx29BJS8vE7X4XXX8jEHPg0HgruKAagIg23VzhQq+l 8l1d4PqWB2kPWZdns/Uqcwbliqv5unVFsIU2cusVu8bKWUw8ZDXFNDLicf5nQVQG4SeD ilhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=HSL7Mqjc; 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 (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id bw21-20020a170906c1d500b00992a096678fsi5173607ejb.813.2023.07.02.07.27.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jul 2023 07:27:30 -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=HSL7Mqjc; 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 1F6E43857BB2 for ; Sun, 2 Jul 2023 14:27:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F6E43857BB2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1688308048; bh=OjZDwQDuuqCj6kKm8jjMd3RY4XTC1JnpsZcvRWd3MKk=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=HSL7MqjcXWo9C+K6EeQcNIpE2xHKJV1nYs9owiCFYaPg0esoKKFbfz/X808f0YIQ0 wYWS1CtYRPDDmxojH9KlU2YNuL35dNpEzQyNzvcFYXg7xAKWicRbe+W1T9G6sZ25+7 U6R5vuAA6DvWSC1FxHKEmzRtzcOUERwQl2erMrQQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 7D24A3858412 for ; Sun, 2 Jul 2023 14:26:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D24A3858412 Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-314172bb818so4090646f8f.1 for ; Sun, 02 Jul 2023 07:26:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688308003; x=1690900003; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OjZDwQDuuqCj6kKm8jjMd3RY4XTC1JnpsZcvRWd3MKk=; b=d/nn2vkDRTRmoMmTMTN6Ye+r8T5SyLILs69B+1jPGVANygL+iWajMjZTwOIxbq/VVd c9TxDeFKM4Qi3/kRh5F6vmY0Z5X/mSG9GhSrSkMD6zietv+atCVcwJCCGJDcaR6gvfDz zCmcgthuYD6oLVA1fJVY9xeEHAXLo8u8UkWOb7BLyF/rNf2WwNk8qodwmPIKeZukq3Bc fJSbjWQZu1ZtM28xQebc1Pj1QohqBW+fbXJPonVJXC+FprKAWcJZNUVXyXW4l4Xa6qiM yEcBpk1pgnqAJsS3+kKBnqnBOB3zszLVEvXZyWEYkAmYxOtC6cuLeRN8cY+a28NEutF3 OQYA== X-Gm-Message-State: ABy/qLaBEXBiWmJfzqU8ucTQ8MQDNetCjGkXV2hZGUavIqgm40OvjCs+ rh7UNcn7MHBfw1FzIVxairo0NZNe2jtp5w== X-Received: by 2002:a5d:43c4:0:b0:30f:d218:584a with SMTP id v4-20020a5d43c4000000b0030fd218584amr6446619wrr.23.1688308002765; Sun, 02 Jul 2023 07:26:42 -0700 (PDT) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id s7-20020adfeb07000000b0030ae901bc54sm23116371wrn.62.2023.07.02.07.26.42 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 02 Jul 2023 07:26:42 -0700 (PDT) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] Darwin, Objective-C: Support -fconstant-cfstrings [PR108743]. Date: Sun, 2 Jul 2023 15:26:41 +0100 Message-Id: <20230702142641.21363-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-Spam-Status: No, score=-8.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe 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?1770319302566337010?= X-GMAIL-MSGID: =?utf-8?q?1770319302566337010?= Tested on x86_64-darwin and with make pdf and an examination of the revised output. Pushed to trunk, thanks Iain --- 8< --- This support the -fconstant-cfstrings option as used by clang (and expect by some build scripts) as an alias to the target-specific -mconstant-cfstrings. The documentation is also updated to reflect that the 'f' option is only available on Darwin, and to add the 'm' option to the Darwin section of the invocation text. Signed-off-by: Iain Sandoe PR target/108743 gcc/ChangeLog: * config/darwin.opt: Add fconstant-cfstrings alias to mconstant-cfstrings. * doc/invoke.texi: Amend invocation descriptions to reflect that the fconstant-cfstrings is a target-option alias and to add the missing mconstant-cfstrings option description to the Darwin section. --- gcc/config/darwin.opt | 4 ++++ gcc/doc/invoke.texi | 27 ++++++++++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/gcc/config/darwin.opt b/gcc/config/darwin.opt index feaa95867b5..d655aaef2fb 100644 --- a/gcc/config/darwin.opt +++ b/gcc/config/darwin.opt @@ -33,6 +33,10 @@ fapple-kext Target C++ Var(flag_apple_kext) Generate code for darwin loadable kernel extensions. +fconstant-cfstrings +ObjC ObjC++ Alias(mconstant-cfstrings) +Generate compile-time CFString objects. + iframework Target RejectNegative C ObjC C++ ObjC++ Joined Separate -iframework Add to the end of the system framework include path. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index efcf3bfb3d6..26bcbe26c6c 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -4830,10 +4830,12 @@ and Objective-C++ programs: Use @var{class-name} as the name of the class to instantiate for each literal string specified with the syntax @code{@@"@dots{}"}. The default class name is @code{NXConstantString} if the GNU runtime is being used, and -@code{NSConstantString} if the NeXT runtime is being used (see below). The -@option{-fconstant-cfstrings} option, if also present, overrides the -@option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals -to be laid out as constant CoreFoundation strings. +@code{NSConstantString} if the NeXT runtime is being used (see below). On +Darwin (macOS, MacOS X) platforms, the @option{-fconstant-cfstrings} option, if +also present, overrides the @option{-fconstant-string-class} setting and cause +@code{@@"@dots{}"} literals to be laid out as constant CoreFoundation strings. +Note that @option{-fconstant-cfstrings} is an alias for the target-specific +@option{-mconstant-cfstrings} equivalent. @opindex fgnu-runtime @item -fgnu-runtime @@ -24118,10 +24120,21 @@ This is by default ON@. @item -gfull Emit debugging information for all symbols and types. +@opindex fconstant-cfstrings +@item -fconstant-cfstrings +The @option{-fconstant-cfstrings} is an alias for @option{-mconstant-cfstrings}. + +@opindex mconstant-cfstrings +@item -mconstant-cfstrings +When the NeXT runtime is being used (the default on these systems), override +any @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} +literals to be laid out as constant CoreFoundation strings. + +@opindex mmacosx-version-min @item -mmacosx-version-min=@var{version} -The earliest version of MacOS X that this executable will run on -is @var{version}. Typical values of @var{version} include @code{10.1}, -@code{10.2}, and @code{10.3.9}. +The earliest version of MacOS X that this executable will run on is +@var{version}. Typical values supported for @var{version} include @code{12}, +@code{10.12}, and @code{10.5.8}. If the compiler was built to use the system's headers by default, then the default for this option is the system version on which the