4 ms·
The macros aren't set when building the libc, they are set when programs using the libc are build. So every program build on a distribution uses either the defa
by funcDropShadow 5y ago
The macros aren't set when building the libc, they are set when programs using the libc are build. So every program build on a distribution uses either the default or set one of the macros.
- leni536 5y agoThat's interesting, how does glibc maintain ABI compatibility? Alias attributes? Even if glibc does it, if other libraries expose time_t in their ABI and don't do the same, then it's the same problem.
- mananaysiempre 5y ago> [H]ow does glibc maintain ABI compatibility? Alias attributes? Symbol versioning[1,2]. Kind of like aliases, but more awkward. In theory it’s not specific to glibc, in practice hardly anyone else bothers being so careful about their ABI. Note that dynamically linked musl, which Alpine uses (I think..?), doesn’t understand symbol versioning, though I expect this will only last until the first ABI break in musl. [1]: https://www.akkadia.org/drepper/symbol-versioning https://www.akkadia.org/drepper/symbol-versioning [2]: https://maskray.me/blog/2020-11-26-all-about-symbol-versioning https://maskray.me/blog/2020-11-26-all-about-symbol-versioni...
- Hello71 5y agomusl has lasted almost one-third as long as glibc, with significantly less than one-third the number of ABI breaks. as far as I know, the only musl ABI break has been time64; despite glibc's supposedly superior version handling, musl has completed time64 support with headers only, whereas glibc is still in progress.
- leni536 5y ago> Symbol versioning I know that glibc uses symbol versioning to remain ABI-compatible within versions. What I meant was ABI compatibility between 32-bit and 64-bit time_t with the same glibc library. Looks like it uses something like aliases for that (but self-implemented using asm): https://sourceware.org/git/?p=glibc.git;a=blob;f=misc/sys/select.h;h=e9c0e8fc201a75807327c6b0c786c132666b4004;hb=HEAD#l134 https://sourceware.org/git/?p=glibc.git;a=blob;f=misc/sys/se... https://sourceware.org/git/?p=glibc.git;a=blob;f=misc/sys/cdefs.h;h=a05b538579b8801b7a30407fe8770e46d0261234;hb=HEAD#l246 https://sourceware.org/git/?p=glibc.git;a=blob;f=misc/sys/cd...
- user-the-name 5y agoThey are set when building the libc. If you change the macro to something else and then link, you will get code that crashes due to mismatches in ABI.