Re: [PATCH] libstdc++: Fix stream initialization with static library [PR107701]

2022-11-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Nov 2022 at 10:55, Jonathan Wakely wrote: > > On Wed, 16 Nov 2022 at 02:46, Patrick Palka via Libstdc++ > wrote: > > > > When linking with a static library, the linker seems to exclude a > > constituent .o object (including its global initializers) if nothing > > from it is referenced

Re: [PATCH] libstdc++: Fix stream initialization with static library [PR107701]

2022-11-16 Thread Jonathan Wakely via Gcc-patches
On Wed, 16 Nov 2022 at 02:46, Patrick Palka via Libstdc++ wrote: > > When linking with a static library, the linker seems to exclude a > constituent .o object (including its global initializers) if nothing > from it is referenced by the program (unless e.g. --whole-archive is > used). This behavi

Re: [PATCH] libstdc++: Fix stream initialization with static library [PR107701]

2022-11-15 Thread Patrick Palka via Gcc-patches
trunk? v2 with more comment fixes/additions: -- >8 -- Subject: [PATCH] libstdc++: Fix stream initialization with static library [PR107701] When linking with a static library, the linker seems to discard a constituent .o object (including its global initializers) if nothing from it is referen

[PATCH] libstdc++: Fix stream initialization with static library [PR107701]

2022-11-15 Thread Patrick Palka via Gcc-patches
When linking with a static library, the linker seems to exclude a constituent .o object (including its global initializers) if nothing from it is referenced by the program (unless e.g. --whole-archive is used). This behavior breaks iostream when linking with static libstdc++.a (on systems that sup