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/

Attachment: signature.asc
Description: PGP signature

Reply via email to