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.133.124]) by sourceware.org (Postfix) with ESMTPS id 3FDA0385841B for ; Fri, 4 Nov 2022 17:47:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3FDA0385841B 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=1667584033; 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=ReS2CGJS2B4G6jqteu6DMgmxBmO1qfLCe5xbnXQu/xa7agHMxYnH+xwy7OwbazrpHCY4XN udCZ7GZbdvyhwfopCDGMcMU8CtLknOAJs1GQGgJxuAMePyFoI4NiBpj3ABUYFUqk7Nt6Ci o2zzm4nyAqGmhNQ6iw2T0Ivs4KS+8hM= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-530-IMoKDhI3OAibtkNc5y0KSA-1; Fri, 04 Nov 2022 13:47:12 -0400 X-MC-Unique: IMoKDhI3OAibtkNc5y0KSA-1 Received: by mail-qk1-f200.google.com with SMTP id u6-20020a05620a430600b006e47fa02576so4938740qko.22 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=f01BskEJKbgqzy1vfuiwra8aKgZzmA1Jsd2Ogql8aVsW+8uiYElv8HcxdghByjOxNS fe19UeGgcSu4685kczREGU4ciPfIjHR7b3dMuW9P5zvbZcZjQv4JnCPEIPBwjaUaVH5I uFet9kn8PGp0UCSIOUAbmOAq8lTmkqTIXOzcthyspA6UE95TxtSfubksCxt7rlQqcSvb e+z/PgE9OPngEBLpY493y/1zvUD5JBZiX444cIm9e0nkSGwi3JLtULv99KcDyg4+Bo1c Plb7yh2XVuP9GoAdok3+dgrvRJECztGXYRonE3RXUkYd56VNymT+XN7JX3zhjHLtxTLX UBtg== X-Gm-Message-State: ACrzQf1TK6lCxN//Kh/xCD88YbYuU5g0vOQKPoGDVknRvgV07IiTJPTd 4rk1miVMjgcoEeBbaeHD5l9HkNp/CVBANiWmPuI76X7F/sQ5tojqgIf7smMPP9lCnZXgl1lhMuZ jlKDjl2wZYOOr6PJOwg== X-Received: by 2002:a05:620a:1256:b0:6fa:4c67:4d9c with SMTP id a22-20020a05620a125600b006fa4c674d9cmr15114672qkl.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=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: 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 > >