Project

General

Profile

Actions

Feature #5247

closed

illumos should provide static libc library (libc.a)

Added by Richard PALO over 8 years ago. Updated over 8 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
lib - userland libraries
Start date:
2014-10-20
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

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.

Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

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?

Actions #6

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).

Actions #7

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.

Actions #8

Updated by Garrett D'Amore over 8 years ago

  • Status changed from New to Rejected
Actions

Also available in: Atom PDF