From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 7B02E3831EE6 for ; Wed, 22 Jun 2022 18:39:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7B02E3831EE6 Received: by mail-wr1-x42a.google.com with SMTP id i10so20890578wrc.0 for ; Wed, 22 Jun 2022 11:39:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=zbBjfNeV7Bt75MPqdXNtxO/kDPHpuf37MZnfkeFeAx8=; b=Wevy8eQf7gSLVxRxVmfXdi+2U5aGpdM8+GlPPjoz7rxfGEyFCj4FTm37kxjfEQmnBz 6O5g6/bopfbcmRW4m2sr3A6Y8XCL3RWA1Gib2yZO6O+lB12r7WZc24xsUbQrVS5TtP1N HxJbe/X9+Uv9+RRSfjQqBqQUWm2nFtsK5rikP/j3QNi8kKblikywDtV6qcfEzfgR+zQV RDcmWVTwAwWC016vmfOl/lpKi4ermPaRU/RJ83y4awtlONeVFb3DJ05m1jhBW4K9caAL M0hqP4kW5G180v6sEli6fSsVba0iJlv3tGPpnwLMegRVtzqeU9IcsG+TLI81C+f5uyZ3 XHoA== X-Gm-Message-State: AJIora/VC5YPp91IssoJgBzzwMA1HURq1wKz7tsERPS0ZinWauragIsy 5gf8m8VwllB+9Jt4qItNuRk= X-Google-Smtp-Source: AGRyM1vn6hfQPssB54hgsX41EYBdbgSPUylvF/3ULfUf0Icbx8EWBYHQwLrA1KoWU0Q95xc/S9/XtQ== X-Received: by 2002:a05:6000:1849:b0:21b:95c7:bbca with SMTP id c9-20020a056000184900b0021b95c7bbcamr4609727wri.93.1655923159001; Wed, 22 Jun 2022 11:39:19 -0700 (PDT) Received: from [192.168.1.95] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id r13-20020a5d4e4d000000b0021b96cdf68fsm6019718wrt.97.2022.06.22.11.39.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2022 11:39:18 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [PATCH] Introduce -nolibstdc++ option From: Iain Sandoe In-Reply-To: Date: Wed, 22 Jun 2022 19:39:17 +0100 Cc: Fangrui Song , GCC Patches , Nathan Sidwell , Joseph Myers Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Alexandre Oliva X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, 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-List-Received-Date: Wed, 22 Jun 2022 18:39:22 -0000 > On 22 Jun 2022, at 01:36, Alexandre Oliva via Gcc-patches = wrote: >=20 > On Jun 21, 2022, Fangrui Song wrote: >=20 >> Is this similar to clang -nostdlib++ ? >> When libstdc++ is selected, clang -nostdlib++ removes -lstdc++. >=20 > Sounds like they're the same indeed, but the clang option you mention > makes little sense to me, so I'd rather to introduce the one that = does. > If someone feels offering this option with the same spelling as clang, > it's easy enough to add a synonym. Now, if others feel we'd be better > off following clang's practices, I don't mind adjusting the patch to = use > the same spelling. It's not like this option is going to have much = use > one way or another, aside from this testcase. we have nostdlib, nodefaultlibs (which also omit the C++ libs) It makes some sense to have the option named -nostdlib++ if a target might add multiple libs (and/or make other changes) for linking C++. (so, fo example, if libstdc++ were separate from libsupc++ I would expect your use-case to wish to exclude both, not just libstdc++)? =46rom the PoV of users and build systems, it=E2=80=99s also helpful to = avoid proliferating option names unless there=E2=80=99s some clear distinction = in function between compilers - if GCC already has an option spelling, usually clang would follow that - it does not seem unreasonable to reciprocate. 0.02GBP only, of course, Iain >=20 > --=20 > Alexandre Oliva, happy hacker = https://FSFLA.org/blogs/lxo/ > Free Software Activist GNU Toolchain Engineer > Disinformation flourishes because many people care deeply about = injustice > but very few check the facts. Ask me about =