Project

General

Profile

Feature #5247

illumos should provide static libc library (libc.a)

Added by Richard PALO almost 5 years ago. Updated almost 5 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:

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.

History

#1

Updated by Richard PALO almost 5 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

#2

Updated by Igor Pashev almost 5 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

#3

Updated by Igor Pashev almost 5 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

#4

Updated by Richard PALO almost 5 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?

#6

Updated by Rich Lowe almost 5 years ago

This is basically impossible to do correctly (that's why it was removed in the first place).

#7

Updated by Garrett D'Amore almost 5 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.

#8

Updated by Garrett D'Amore almost 5 years ago

  • Status changed from New to Rejected

Also available in: Atom PDF