Re: [PATCH 00/45] Add LIBRARY section (based on FreeBSD manual pages)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 14, 2021 at 2:53 AM Stefan Puiu <stefan.puiu@xxxxxxxxx> wrote:
> Not sure what value "libc, -lc" to the man pages. I think having a
> standardized section for functions that require libraries other than
> libc is fine, so you remember when you need -lm or -lrt (although IIRC
> recently a few of these were folded in libc, at least for glibc). But
> -lc feels kind of redundant. Does that mean you need to add -lc in
> your Makefile? Some people might interpret it as such.

Isn't it covered by the

> I think no library section = no special library required might be clearer.
>
> Also, on FreeBSD it's quite obvious you're talking about THE library.
> But on Linux, you have glibc, musl libc, diet libc... Is the plan to
> document requirements for all of these? E.g link with -lm on musl
> libc, no special flags on glibc..?

I think, the split is codified in the standards[1][2][3][4][5] (so,
-lm/-lrt are expected to be supported by the compiler, per my
understanding, and providing the necessary -l* option will always
work, because it's codified in C standard, contrary to not providing
one) and the fact that glibc provides libm/librt symbols in -lc is
more akin to a bit of convenience (for application or glibc
developers, not sure which ones), and not something one should rely
upon.

[1] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libc.html
[2] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libm.html
[3] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libpthread.html
[4] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/libdl.html
[5] https://refspecs.linuxbase.org/LSB_3.0.0/LSB-PDA/LSB-PDA/librt.html

-- 
Eugene Syromyatnikov
mailto:evgsyr@xxxxxxxxx
xmpp:esyr@jabber.{ru|org}



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux