Hi Eugene, On Tue, Sep 14, 2021 at 11:30 AM Eugene Syromyatnikov <evgsyr@xxxxxxxxx> wrote: > > On Tue, Sep 14, 2021 at 2:53 AM Stefan Puiu <stefan.puiu@xxxxxxxxx> wrote: [...] > > 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 I think libc provides libm/librt as library files; the linker just finds them in /usr/lib, /usr/lib64 or whatever other folder they are installed into. So I would say it's not "supported by the compiler" technically, but by libc. > 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. That's assuming that the libraries adhere to those standards, I'm not sure if that's the situation. There are also functions like backtrace (https://man7.org/linux/man-pages/man3/backtrace.3.html) which are extensions, and some might not be implemented in other libraries besides glibc. Maybe the Linux man-pages should mention glibc explicitly instead of a rather ambiguous libc? And then details about the other libs can be added, wherever they differ. Thanks, Stefan. > > [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}