From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by sourceware.org (Postfix) with ESMTPS id 011623857404 for ; Wed, 22 Jun 2022 23:43:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 011623857404 Received: by mail-yw1-x1129.google.com with SMTP id 00721157ae682-3176d94c236so178567197b3.3 for ; Wed, 22 Jun 2022 16:43:07 -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:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fjThV3QOYps3Lh8lyvVdoS+xsnh+L44dKoAvUfw1RF4=; b=zVDx6VsomYzB4MMHsgw/Cqkbfm/pqa45sFcFwCdluvXMQzI0Hl3GYvDPp8XCIrORBU J03jj0PjE1sur45fgHaTW+1jTeXS7XeDyaM+YFbIbPE6cClny5UsL8+47lXuHZnlYkvV 6PcN07lQ2m3Azs3YWXoB6n9iHu3CznMiuwIwz6XsIpOB4aB654l7PaY5tQ7Ck8r33WKl 1EazK2K+MPM40phi8bEUFFWgcDcuzGvKr76DCRIMdZ7xs9ndubiPhufopvgX0aW/gyH/ 4ejHX4L7dJOVwdm81uvmVSet/5yQoFAP9pb0sTgMPjajrkouS6ea+CIEv+WmkO3oNwlS N3dg== X-Gm-Message-State: AJIora9PHQJjw9IBOpV4ryoCj1UMEdr3c9Iev/xiSDnAflmzYSszocg2 CseCO/ZZ83dX5H7hiqXWCZUzA2XmOvBazdlB+pQmvQ== X-Google-Smtp-Source: AGRyM1si67PCe2ic7/qoFK39fCQ1DBEMP9d/zpU8hKlIHlQhWbJk9NKYLFwxzqxM0I6wf2k3K9fS7GzdiCPJeuxktR0= X-Received: by 2002:a81:238e:0:b0:300:642f:fdb2 with SMTP id j136-20020a81238e000000b00300642ffdb2mr7378668ywj.373.1655941387256; Wed, 22 Jun 2022 16:43:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Fangrui Song Date: Wed, 22 Jun 2022 16:42:56 -0700 Message-ID: Subject: Re: [PATCH] Introduce -nolibstdc++ option To: Alexandre Oliva Cc: Iain Sandoe , GCC Patches , Nathan Sidwell , Joseph Myers Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-18.7 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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 23:43:10 -0000 On Wed, Jun 22, 2022 at 4:29 PM Alexandre Oliva wrote: > > On Jun 22, 2022, Iain Sandoe wrote: > > > 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++. > > if it was nostdlibc++, I'd agree. lib++ is not something that brings > C++ to (my) mind. Agree that clang --stdlib= and -nostdlib++ probably should be better named. There are many standard libraries and "stdlib" as a name isn't tied to C++ much. That said, --stdlib= has a very long history and seems not so necessary to change now. For new Clang driver options (I subscribe to clang/lib/Driver files to try catching up the change), I try to keep an eye on and for something useful which may be matched by GCC, I'll notify some GCC folks I know (e.g. Nathan, Martin). > > (so, fo example, if libstdc++ were separate from libsupc++ I would > > expect your use-case to wish to exclude both, not just libstdc++)? > > That's what the testcase requires, yes. IIRC there's another that would > benefit from the ability to link with libsupc++, but not with libstdc++. > > > if GCC already has an option spelling, usually clang would follow that > > - it does not seem unreasonable to reciprocate. Thanks. > Yeah, I suppose that makes sense, it's beneficial for users to avoid the > cognitive overload of dealing with equivalent options with different > spellings. I'll swallow my dislike for the spelling and change the > patch to use -nostdlib++. Thanks:) BTW: even if -static-libstdc++ is a bit of misnomer when a clang user uses libc++, since -static-libc++ or -static-stdlib does not exist, they are still using -static-libstdc++. > -- > 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