Re: How can I keep -lstdc++ out of $postdeps?

Mike Frysinger <[email protected]>
Newsgroups gmane.comp.gnu.libtool.general
Message-ID <20170223193306.GW28432@vapier>
On 23 Feb 2017 12:22, Jack Bates wrote:
> On 23/02/17 12:04 PM, Mike Frysinger wrote:
> > On 23 Feb 2017 09:01, Jack Bates wrote:
> >> On 22/02/17 12:16 PM, Mike Frysinger wrote:
> >>> On 22 Feb 2017 10:32, Jack Bates wrote:
> >>>> How can I avoid dynamically linking with libstdc++?
> >>>> or, how can I keep -lstdc++ out of $postdeps?
> >>>
> >>> let's back up.  what is it you're actually trying to do ?
> >>> you want to create a statically linked C++ program ?
> >>> you want to link a C program ?
> >>> something else ?
> >>
> >> Well, I'm asking for a friend [1]. It sounds like he's got one version
> >> of libstdc++ in his build infrastructure and another (older) version on
> >> his production machines. He wants to avoid using the older version (I
> >> think because of an issue with the STL) which is why he's trying to keep
> >> -lstdc++ out of the linker arguments.
> >
> > unfortunately, trying to hack the link lines won't help with this.  the
> > headers and libraries are kept in sync.  you can't use newer headers and
> > try to run against older libraries.
> >
> > your best bet is probably to just get an older toolchain and use that to
> > compile.  or get a copy of the distro that's used in production and use
> > that to compile the code you care about.  distros often can be used in
> > chroots so it's not like you need to reinstall the entire system.
> 
> As far as I know, the headers and libraries in the build infrastructure 
> are in sync with each other. -static-libstdc++ should use that version, 
> no? Whereas -lstdc++ runs the risk of dynamically linking with the older 
> version on the production machines -- which is what he wants to avoid. 
> Or do I misunderstand? Thanks for your help!

correct, if you use -static-libstdc++, then you should get a C++ prog
that should run fine on older distros even if they have older libstdc++
runtimes.
-mike

_______________________________________________
https://lists.gnu.org/mailman/listinfo/libtool
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEuQK1JxMl+JKsJRrUQWM7n+g39YEFAlivOPIACgkQQWM7n+g3
9YHwEBAApX6UCnHNiVmgwIGePeYjcLzhnYlseWMe8N1hab/6qAhVZjSXjavGQNA5
rr1TrUo8+YySHuUDhOAHFVYh45VLQcDRFa3hOr7g1BRFECOpc5Ir1gCMCQP20hND
z0MjioQyiyqQHbNgTk5ZX+YLDwgixMCBjeNuFC6kggaI8rGRP1V1cefSTAFIEF02
tB6cfuzYSMsrfEdfOlzZW9Hj93k/er2TsjsCs4jRt0cHEL19dx7V5YzaSX9e+bXG
puA2UWuqHKA2OFUyhYWb1f2GRbRTVDSpaAmT8b7CuIxLxAdbEMycuVtZHzXRb4Yn
krM7qCG/5/Vd4SGdrKyH7kJaYG0Jg7XawA8SdG6RrWdSgBsJOxOh02ilhrQIAFnZ
Ees2JUyWZbVz/RqFO41v8Rdm5IozGpQhN2igP90O7q3CWOjyLBH0xLGSdTqpRkYM
LSGYYS0wx/pzHzpBENcn9b5qYsjwuZLfjViJJLTn6BWMLK8VHZvs1c8pUGOudLVs
Z0jAeiSrXXYivKnTASI5uAfzMMJ6rqjuvbox6jWp9Ys+h6HWQ5/BiIcFSS0SK2gq
Ysn00OxFwnXyfaUYxWp1Tg5cy1nULt0Yoc03olHKRhrsr1b05GdLmU2Ec9lxro/2
JRjYK6evauzvJzKfbpr4neSinxrDUvlG+a6t464JaKi4J51vC4Y=
=vPbZ
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.