From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fout8-smtp.messagingengine.com (fout8-smtp.messagingengine.com [103.168.172.151]) by sourceware.org (Postfix) with ESMTPS id 2ADF03847718 for ; Wed, 3 Apr 2024 11:35:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2ADF03847718 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=tower89.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tower89.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2ADF03847718 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=103.168.172.151 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712144123; cv=none; b=Wwv1p/zNbWHc/ZT1QU2TQq3rpa59xN6pVWfHq3sRxSgAWWuyjthx2/cwG0jvoTC3TFTCrHE0FD2ca5fjhz0ZcOk9W4WkCLfUr5egGfxcLVrdVSAfP9XnTSXB+rBlN3FCQgF2wv1u8nR6Qure+DXGUn+ZVx/U93ELN/h9lEpm8EA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712144123; c=relaxed/simple; bh=k5qfPhTAMH9+nsVfCeevqj5DpLZ0F2jj7GhjzdLH4dw=; h=DKIM-Signature:DKIM-Signature:MIME-Version:Message-Id:Date:From: To:Subject; b=Ey9yYCP6w1w2NbGIem5A0CnJIRKJd9CSyNHT5dwyctbRZnwUDpXVESpiXUDpwzJQpnSy51vmW2kjVDNoyXAthYdP5D5S99WnEuye9OBc4K3MBaDvFK3EiLiz+xltXihCvQARtCyRuh86I5Etwb9x4AunF6TipGQXy2FhjML1tbY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id A75B013800CA for ; Wed, 3 Apr 2024 07:35:20 -0400 (EDT) Received: from imap48 ([10.202.2.98]) by compute5.internal (MEProxy); Wed, 03 Apr 2024 07:35:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tower89.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:subject:subject:to:to; s=fm3; t=1712144120; x=1712230520; bh=JJNMkHBfsjHgoGYPMo1kb5Y9PuG3U/sX ck9z9YUZ5Fc=; b=ZIyQUepu37Hx5f4EJ+gVAb2ZobXZ7h5p86zC45ClEuK7FEH/ 38KNp3TnDxeZzlBiSg6wwW513kpXwMLG2X8HWeZscD0bUW1cyHoLqIb2WZNCWdxW M9l+NCVlqHJTnfk7OlCUhAXkoYkePU+09p0IyetyP9V8PTpvbDNSADpBTooIaboA Jl155fcvsAXt9ah6sehirjMgr8aj16Zy8C1hYS1M3w631LTit2/hVg6Bci4CWFyI PwBV2+Cjj+1DsT6/LSU3FnZQS4yeTb5ujJtoPuz81X/KD3S0bRw3+RFsXDkolJ/k QHB+yZXJvbjt+zdbJ2dFJ9YDyADYlwpVJtjYxA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1712144120; x=1712230520; bh=JJNMkHBfsjHgoGYPMo1kb5Y9PuG3U/sXck9 z9YUZ5Fc=; b=MXHR2v/Vl2B1fMhXRLpaGmEM916yK70HwLg4Jlcg5t+ZTpL9XfD 49jAOeP9TWLdy/Lms+PJRavrd89dVazRPXBlmbWRndSlYGSHfu/rKlkAbiFJlwCi Kox3MgT4sn83HKJPa54BgvE/xnc6BYx3dnsO8mwtbFuuPV9nSq21oM1cS7WlLRn9 IKMWEuiPuTonFK77q6s0cFNzJL+4IKb71uFZaLpsbpjOGWhY/vnvY0aWXLAqvZAH 5yjWTeemxQvyHb47JGqHyQrt80BKgAFZv/RDpF37rDAyQd7AE8qleXe69FC1QUAT +kJ0+WIFb5BhWhCJjwzjKy2Z+IcVic/1NHA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudefhedgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsegrtderre erreejnecuhfhrohhmpedflfhohhhnucfhfdcuoehgtggthhgvlhhplhhishhtsehtohif vghrkeelrdgtohhmqeenucggtffrrghtthgvrhhnpeehieeukeffveehgeeuudelueevfe evteeivdfgjeejhfffgeffhefhvefhteduueenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpehgtggthhgvlhhplhhishhtsehtohifvghrkeelrd gtohhm X-ME-Proxy: Feedback-ID: ic9b946e8:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 373BC31A0065; Wed, 3 Apr 2024 07:35:20 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-333-gbfea15422e-fm-20240327.001-gbfea1542 MIME-Version: 1.0 Message-Id: <475e64e4-c6c4-4d12-9550-7193ce0d91c8@app.fastmail.com> Date: Wed, 03 Apr 2024 13:34:55 +0200 From: "John F" To: gcc-help@gcc.gnu.org Subject: Multiple libstdc++ builds Content-Type: multipart/alternative; boundary=530268007ed144978d856343e39ce1e0 X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_LOW,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 List-Id: --530268007ed144978d856343e39ce1e0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, I=E2=80=99m building GCC from a release branch (13.2.0). For the majority o= f things I=E2=80=99m trying to compile, I want to produce static + lto=E2= =80=99d binaries, linking the c++ lib in statically via the typical -static= -libstdc++. So I initially configured gcc with =E2=80=94disable-shared and = everything seemed to work just fine. There are a few things though that I need to build dynamically. In the past= , I configured with =E2=80=94with-pic, but I wanted to avoid paying the PIC= tax for my true static links. So I rebuilt gcc without =E2=80=94disable-sh= ared. And again, everything works fine and now I can produce shared c++ lib= raries where I need. But I noticed that now the libstdc++ components objects are again getting b= uilt with -fPIC -DPIC as far as I can tell. Not surprising but disappointin= g. Which brings me to the question: is there a good way to produce the libstdc= ++.a and .so from separate compilations s.t. the objects in the archive don= =E2=80=99t have -fPIC? Or, even better, produce both a libstdc++.a and a l= ibstdc++_pic.a (assuming I can then link the latter via -nostdlib++ libstd= c++_pic.a)? I tried to wrap my head around the build machinery, but couldn= =E2=80=99t really make any progress. Relatedly, can libstdc++.a practically be built with (fat) LTO support for = non-cross builds? Bug 59893 discusses some issues with Canadian crosses but= nothing for native and the discussion is largely from a decade ago. Appreciate your time! --530268007ed144978d856343e39ce1e0--