public inbox for discuss@lists.illumos.org (since 2011-08)
 help / color / mirror / Atom feed
From: Jason King <jason.brian.king@gmail.com>
To: illumos-discuss <discuss@lists.illumos.org>
Subject: Re: [discuss] whats the /lib/libc.so.1 mount for ?
Date: Fri, 31 Jan 2025 17:09:37 +0000	[thread overview]
Message-ID: <SJ2PR20MB71556A21D23361EEF7289D22A4E82@SJ2PR20MB7155.namprd20.prod.outlook.com> (raw)
In-Reply-To: <feeeae01-91cc-4fb4-9774-22cd2246eabe@kit.edu>

[-- Attachment #1: Type: text/plain, Size: 2570 bytes --]

The biggest differences I’m aware of between them is how syscalls are performed. Newer (relatively speaking) CPUs have nicer instructions for syscalls as well as things like optimized implementations of some of the libc string functions. During boot, the system will try to pick the ‘best’ one to use and loopback mount it over the more generic libc.

Newer libraries would likely use linker capabilities to do this in a single library (if the author is aware of them – it’s actually a neat feature that isn’t as well known as it should be IMO). I don’t have access to the relevant history (this all predates illumos), but my best guess is that the linker functionality to allow selection of an optimized implementation of a function based on CPU capabilities probably came later  (and no one’s been interested in doing the work to consolidate them – I suspect it’d get rather tedious).


From: Udo Grabowski (IMKASF) <udo.grabowski@kit.edu>
Date: Friday, January 31, 2025 at 10:56 AM
To: discuss@lists.illumos.org <discuss@lists.illumos.org>
Subject: Re: [discuss] whats the /lib/libc.so.1 mount for ?


On 31-01-2025 17:45, Udo Grabowski (IMKASF) wrote:
>
>
> On 31-01-2025 17:43, Enrico Weigelt, metux IT consult wrote:
>> Hi folks,
>>
>> I'm wondering what the /lib/libc.so.1 mount is actually for.
>>
>> Are there different libc versions that might be mounted ?
>> Where and how exactly is the decision made ? Who mounts it ?
>>
> It depends on the hardware capabilities of the processor, for
> Intel it's usually libc_hwcap1.so.1, for AMD I have
> libc_hwcap2.so.1, and there's a libc_hwcap3.so.1 (ARM?) too.
>
> /lib/libc.so.1 on /usr/lib/libc/libc_hwcap2.so.1 read/write/setuid/
> devices/dev=4c50002 on Mon Dec 16 12:29:34 2024

Here are the specific capabilities used in the different versions (3 is
not ARM), see them with 'file':
/usr/lib/libc/libc_hwcap3.so.1: [SSE MMX CMOV FPU]
/usr/lib/libc/libc_hwcap2.so.1: [SSE2 SSE MMX CMOV AMD_SYSC FPU]
/usr/lib/libc/libc_hwcap1.so.1: [SSE MMX CMOV SEP FPU]
--
Dr.Udo Grabowski  Inst.of Meteorology & Climate Research IMKASF-SAT
https://www.imk-asf.kit.edu/english/sat.php
KIT - Karlsruhe Institute of Technology          https://www.kit.edu
Postfach 3640,76021 Karlsruhe,Germany T:(+49)721 608-26026 F:-926026

------------------------------------------
illumos: illumos-discuss
Permalink: https://illumos.topicbox.com/groups/discuss/T9811b44617503fdd-M1bf20a2e57ee79e8c4bdc6b9
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

[-- Attachment #2: Type: text/html, Size: 5652 bytes --]

  reply	other threads:[~2025-01-31 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-31 16:43 Enrico Weigelt, metux IT consult
2025-01-31 16:45 ` Udo Grabowski (IMKASF)
2025-01-31 16:55   ` Udo Grabowski (IMKASF)
2025-01-31 17:09     ` Jason King [this message]
2025-01-31 22:18       ` Joshua M. Clulow via illumos-discuss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ2PR20MB71556A21D23361EEF7289D22A4E82@SJ2PR20MB7155.namprd20.prod.outlook.com \
    --to=jason.brian.king@gmail.com \
    --cc=discuss@lists.illumos.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).