[tlbuild] TeX Live builds -- second summary
Peter Breitenlohner
peb at mppmu.mpg.de
Wed May 6 16:34:58 CEST 2009
On Wed, 6 May 2009, Ken Brown wrote:
>> By default, user applications will be linked against these DLLs unless the
>> option '-static' is supplied to GCC during the build. If linking
>> statically
>> against libstdc++, you should also use '-static-libgcc' to link likewise
>> against libgcc, or you will experience segfaults on program termination.
>
> I wonder if this means that g++-4 needs '-static' and gcc-4 needs
> '-static-libgcc' when C and C++ programs are linked together. I don't know
> enough programming to test this. Is it clear to you?
Hi Ken,
I guess so and would interpret it as follows: you should use
g++-4 -static -static-libgcc
to statically link a program with some C++ code. In this situation you
should always use g++ for the final link, this will automaticall supply
'-lstdc++' and handle whatever else in needed, i.e., global constructors.
The wording seems to be somewhat ambiguous/confusing how to link pure C
code. It could mean to use 'gcc-4 -static' for static libraries other
than libgcc and in addition 'static-libgcc' for that one static as well.
BTW: I just tested this on our cygwin-1.5.25 with gcc-3.4.4; the '-static*'
flags are accepted but are not required as already observed by Angelo.
Regards
Peter
More information about the tlbuild
mailing list