From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3F855385841B for ; Fri, 4 Nov 2022 17:47:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3F855385841B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667584035; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fS0mnGxk8D8FW1Q+xUQ6wxcfmpRGMVH1n7D7BjqXFyM=; b=Itv3+/P+6q2RfB633ZtkAkvJFMBIaHsZOkoMYFvt82mTGBftl4x2ma8+jf4EmqhQTSgC1x 1uQ0W+v9rhkc5QiBM2x/sxF3IjWbib/ZNdFCQNE5W7+Jex0TK8zXm8++HpV/rnqZzIvXiE eFLPr1a+2WuL04fs2WYhlTF2Q+ZCbx0= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-157-GOnNfAAqO-Wc05pLFzfHIw-1; Fri, 04 Nov 2022 13:47:12 -0400 X-MC-Unique: GOnNfAAqO-Wc05pLFzfHIw-1 Received: by mail-qk1-f197.google.com with SMTP id bq13-20020a05620a468d00b006fa5a75759aso4946930qkb.13 for ; Fri, 04 Nov 2022 10:47:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:references:message-id:in-reply-to:subject:cc:to:date :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fS0mnGxk8D8FW1Q+xUQ6wxcfmpRGMVH1n7D7BjqXFyM=; b=Td9MnoGGWxnmD1LOcrfj9kIiTv4lv40cZC71zZnNZqaofS7fCnDcVeX6ceUuu7YIQD jnkp8EEK7befL1nlEwwhSrnuXcU5O52bhZTgvWsEhQyeQpvbfP43r7Va/SfjEmnlyN84 YHqcbXRg+PQbFJSAgn6ZAUYbAZfYsNBMWbLI8pxGdYKSUV0O4nICjUTPY0hDnu3lVZe4 LEP4ZEogPqEEGo3G2omUqkehJ/ZRTLxarMMDDtB1SvK2ddSQDgyeZ9X5boJ+BNLsuujq NSb+7cS6JbOweIhs/NNs1vhGZcITfyWSWmi1vbJg8UN3Kk0FBsf7Ag/TQ27PxNZEPTDP n5Uw== X-Gm-Message-State: ACrzQf03wtnGWB2SwWVSuvSBdf0r+eVbz/Ao2R8wKs31dpNDZhkzNua+ az9+TMtTU4b0xkg3eaH/OvZWpKmGnrvXA6C4R5D8uBcRmkSBIAXqFvVdBEA73bMaaHzxPxmZFgc W3XirVsLRvNfKhZ0= X-Received: by 2002:a05:620a:1256:b0:6fa:4c67:4d9c with SMTP id a22-20020a05620a125600b006fa4c674d9cmr15114673qkl.713.1667584032241; Fri, 04 Nov 2022 10:47:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7lrVuTj7uau0e+gvHok4Z6XRJlNMs7Pm1YzrLLVCFJcz6ZHTTqVEBunFEPirOWoO2pcfemOA== X-Received: by 2002:a05:620a:1256:b0:6fa:4c67:4d9c with SMTP id a22-20020a05620a125600b006fa4c674d9cmr15114660qkl.713.1667584031999; Fri, 04 Nov 2022 10:47:11 -0700 (PDT) Received: from [192.168.1.130] (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id cg13-20020a05622a408d00b003a51e8ef03dsm2832113qtb.62.2022.11.04.10.47.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 10:47:11 -0700 (PDT) From: Patrick Palka X-Google-Original-From: Patrick Palka Date: Fri, 4 Nov 2022 13:47:10 -0400 (EDT) To: Florian Weimer cc: Patrick Palka via Gcc-patches , Patrick Palka , libstdc++@gcc.gnu.org Subject: Re: [PATCH 2/2] libstdc++: Move stream initialization into compiled library [PR44952] In-Reply-To: <87eduizmhj.fsf@oldenburg.str.redhat.com> Message-ID: References: <20221104150525.2968778-1-ppalka@redhat.com> <20221104150525.2968778-2-ppalka@redhat.com> <87eduizmhj.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 4 Nov 2022, Florian Weimer wrote: > * Patrick Palka via Gcc-patches: > > > This patch moves the global object for constructing the standard streams > > out from and into the compiled library on targets that support > > the init_priority attribute. This means that no longer > > introduces a separate global constructor in each TU that includes it. > > > > We can do this only if the init_priority attribute is supported because > > we need to force that the stream initialization runs first before any > > user-defined global initializer in programs that that use a static > > libstdc++.a. > > I think this breaks initialization of iostreams of shared objects that > are preloaded with LD_PRELOAD. With the constructor, they initialize > iostreams once they are loaded via their own ELF constructors (even > before libstdc++'s ELF constructors run). Without the constructor in > , that no longer happens. IIUC wouldn't that shared object depend on libstdc++.so and hence libstdc++'s constructors would still run before the shared object's? > > Thanks, > Florian > >