Feature #5247
closedillumos should provide static libc library (libc.a)
0%
Description
As with other distros, it is [extremely] useful to be able to link a program without shared library dependencies (e.g. gcc -static).
In order to do this, libc.a needs to be provided, at least as part of the build, if not in the generated packages. This would allow debugging libc to be much easier as well.
Updated by Richard PALO over 8 years ago
In order to do this, libc.a needs to be provided, at least as part of the build, if not in the generated packages. This would allow debugging libc to be much easier as well.
Apparently they are built (extrait from the Makefile):
# Note that we build libc_pic.a for the benefit of building # ld.so.1, but we do not install it. Only ld.so.1 needs it # and it must be built in the same workspace as libc.
Just a question of packaging...
8241 ../../lib/libc/amd64/libc_pic.a 6593 ../../lib/libc/i386/libc_pic.a
Updated by Igor Pashev over 8 years ago
What about libsocket etc? What about stable kernel<->userspace ABI?
See for example https://illumos.org/issues/3713 and https://illumos.org/issues/3714
Updated by Igor Pashev over 8 years ago
Also AFAIK libc_pic.a does not include all symbols from libc.so, only one used by ld.so, nd it is quite fragile
Updated by Richard PALO over 8 years ago
I noticed in the former opensolaris.developer list Adam Leventhal finished his reponse to
'Re: Building libc.a - msg#00232' with the following:
.. and then there appear to be some other issues on which I assume people are loath to comment since you probably don't mean to be doing this at all...
That is to say, there doesn't seem to be a reasonable foolproof workaround for stubbing dl* and _ld_libc symbols from ld.so.1, so it looks as if libc_pic.a is unuseable as it currently is for static linking.
Apparently Guy Shaw was looking into this during the Sun days, perhaps there's some more advanced work in progress to entertain?
Updated by Igor Pashev over 8 years ago
Updated by Rich Lowe over 8 years ago
This is basically impossible to do correctly (that's why it was removed in the first place).
Updated by Garrett D'Amore over 8 years ago
- Tags deleted (
needs-triage)
No. No. No.
I've done lots & lots of debugging of libc, you don't need static binaries.
We will never, EVER, ship a static libc.a anymore. I'm closing this WILL NOT FIX.