[sr #111184] libtool breaks -static-libstdc++ by adding it to .la files
Pierre Ossman <[email protected]> Tue, 4 Feb 2025 05:42:36 -0500 (EST)
| Newsgroups | gmane.comp.gnu.libtool.general |
|---|---|
| Message-ID | <[email protected]> |
URL:
<https://savannah.gnu.org/support/?111184>
Summary: libtool breaks -static-libstdc++ by adding it to .la
files
Group: GNU Libtool
Submitter: cendossm
Submitted: Tue 04 Feb 2025 10:42:32 AM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Operating System: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Tue 04 Feb 2025 10:42:32 AM UTC By: Pierre Ossman <cendossm>
We want to link libstdc++ statically to avoid dependency problems on deployed
systems. To do this, we do:
./configure CXX="g++ -static-libstdc++"
This works well for most cases. But libtool breaks it when a convenience
library is used.
During ./configure, libtool probes g++ and figures out the implicit libraries
added by the compiler. It stores those in "postdeps".
When generating a convenience library, it goes through those "postdeps" and
adds libstdc++.la to "dependency_libs" for the convenience library.
When the final executable gets linked, libtool follows "dependency_libs" for
the convenience library, examins "libstdc++.la", and adds "libstdc++.so" to
the link line, negating -static-libstdc++.
Fix and/or configure flag to resolve this would be appreciated. Also, a
recommended workaround until then.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/support/?111184>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
(application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCZ6HvHAAKCRCqLAuaBUf3 TjAWAP9DVs89OVNI1xMd1aeT9Sr6tZtDKcrJT9VTLZcSBpERMQD/XousuWJ4ObXN xpnKvqzhpLowlz2+mTPlu/6d+z6dqgk= =POU5 -----END PGP SIGNATURE-----