From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by sourceware.org (Postfix) with ESMTPS id 177193858010 for ; Fri, 3 Dec 2021 03:04:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 177193858010 Received: by mail-pf1-x431.google.com with SMTP id 8so1543218pfo.4 for ; Thu, 02 Dec 2021 19:04:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=AtQCFKVkyF0ggsUooxqnW22/E3Nu4nV+e537MFBL2Wg=; b=1OBX2PVxzNjZ5mJJz2RiANt6iga1sG85FC95LwOJMqQ7VMvkLjahWBDS7OH5hhA9y8 sVuQtzd7JFh8Mc3GauAgHToi0ESb6ZN+N6zgOhG1OD/kVSi7smdlCEdzCARRpPwlpTRr GAyDiiU3ttSjzNZJspktiUDGF9v0pvU67U3ZaLmy7TZtvIgnNNsiFgfV6VlXAeNx959U jsjV7sDs5u0feOWxpFb+nynmfmsbKBWb2FWyUhDuE6/WHZwCMn9iGeLzKahaQeFh3BTm 8NAFlYbFd8bd+1pVSkc+ANgUraefV47iKN6Q82JeM7gt2ogafig8HLb03QDzTqVBA2wC OP1Q== X-Gm-Message-State: AOAM532vT4q2s8LBDwpEoVIPAZ6sxR/DVz9wBPedONtvfhgfJN0lGAdi tnfyyiPgcsOxKO0XBzw6GT8I6rdXxqA= X-Google-Smtp-Source: ABdhPJzo1K/xRa0lLvjSoNRdLX5RHg0qODoBzuMqtEFKf6EQkWYgm550sQwgs7yv+XqGFaT28u+SBQ== X-Received: by 2002:aa7:9ddb:0:b0:4a4:f597:a4ca with SMTP id g27-20020aa79ddb000000b004a4f597a4camr16556746pfq.57.1638500675145; Thu, 02 Dec 2021 19:04:35 -0800 (PST) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id mm22sm740717pjb.28.2021.12.02.19.04.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Dec 2021 19:04:34 -0800 (PST) Message-ID: Date: Thu, 2 Dec 2021 20:04:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH 3/5] gcc: Add --nostdlib++ option Content-Language: en-US To: Richard Purdie , gcc-patches@gcc.gnu.org References: <20211027200505.3340725-1-richard.purdie@linuxfoundation.org> <20211027200505.3340725-4-richard.purdie@linuxfoundation.org> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 03 Dec 2021 03:04:37 -0000 On 10/28/2021 10:39 AM, Richard Purdie wrote: > On Thu, 2021-10-28 at 08:51 -0600, Jeff Law wrote: >> On 10/27/2021 2:05 PM, Richard Purdie via Gcc-patches wrote: >>> OpenEmbedded/Yocto Project builds libgcc and the other gcc runtime libraries >>> separately from the compiler and slightly differently to the standard gcc build. >>> >>> In general this works well but in trying to build them separately we run into >>> an issue since we're using our gcc, not xgcc and there is no way to tell configure >>> to use libgcc but not look for libstdc++. >>> >>> This adds such an option allowing such configurations to work. >>> >>> 2021-10-26 Richard Purdie >>> >>> gcc/c-family/ChangeLog: >>> >>> * c.opt: Add --nostdlib++ option >>> >>> gcc/cp/ChangeLog: >>> >>> * g++spec.c (lang_specific_driver): Add --nostdlib++ option >>> >>> gcc/ChangeLog: >>> >>> * doc/invoke.texi: Document --nostdlib++ option >>> * gcc.c: Add --nostdlib++ option >> Couldn't you use -nostdlib then explicitly add -lgcc? >> >> If that works, that would seem better to me compared to adding an option >> to specs processing that is really only useful to one build >> system/procedure. > It sounds great in principle but I've never been able to get it to work. With > "-nostdinc++ -nostdlib" I miss the startup files so I also tried "-nostdinc++ - > nodefaultlibs -lgcc". The latter gets further and I can build libstdc++ but the > resulting library doesn't link into applications correctly. Can you be more specific about "doesn't link into applications correctly".  I'm still hesitant to add another option if we can reasonably avoid it. jeff