LWN: Comments on "GNU C library 2.33 released" https://lwn.net/Articles/844831/ This is a special feed containing comments posted to the individual LWN article titled "GNU C library 2.33 released". en-us Tue, 28 Oct 2025 21:42:30 +0000 Tue, 28 Oct 2025 21:42:30 +0000 https://www.rssboard.org/rss-specification lwn@lwn.net GNU C library 2.33 released https://lwn.net/Articles/845387/ https://lwn.net/Articles/845387/ nix <div class="FormattedComment"> Other fallout: openssh fails on 32-bit platforms due to needing some 64-bit time syscalls added to the seccomp filter list. (Patch submitted.)<br> <p> Also some obscure --enable-stack-protector=all failures, but I suspect that use of that particular configure flag is quite rare (patches in preparation but they&#x27;re all in the testsuite anyway and do not affect glibc itself).<br> </div> Mon, 08 Feb 2021 15:55:00 +0000 GNU C library 2.33 released https://lwn.net/Articles/845359/ https://lwn.net/Articles/845359/ nix <div class="FormattedComment"> Nope, this is real. march=... does not (reliably? at all) affect the ISA stamping done by sysdeps/x86/isa-level.c, leading to e.g. 32-bit glibcs being built on fast machines for execution on old slow machines being stamped as requiring whatever fast x86-64 box you did your builds on, even if it was built with -march=i586 or something. (ld.so validates this using the CPUID and has no way to override the validation, so everything seems to work when you test it on your build host, even if you test in a VM, and then fails disastrously when you install it on the target machine, with every binary failing to run, even though they would all run just fine if only ld.so let them).<br> <p> See this thread: <a href="https://sourceware.org/pipermail/libc-alpha/2021-February/122268.html">https://sourceware.org/pipermail/libc-alpha/2021-February...</a> (HJ&#x27;s initial patch is definitely not sufficient).<br> <p> For now, it&#x27;s safest to turn off ISA stamping if you&#x27;re building on one machine for execution on any machine which might be older (or otherwise of a lower ISA level). Of course there is no configure flag for this: you have to override the cache variable by adding libc_cv_include_x86_isa_level=no to your configure line.<br> </div> Mon, 08 Feb 2021 13:49:04 +0000 GNU C library 2.33 released https://lwn.net/Articles/845330/ https://lwn.net/Articles/845330/ nix <div class="FormattedComment"> On second thoughts, I think this particular instance was caused by the confluence of multiple local patches (one for the system gcc that passes in -march=native by default, then a specs file that overrides it with march=geode when building for the firewall, combined with a glibc makefile that does not always pass local CFLAGS down, so that one object file ended up being built without -march=geode. It didn&#x27;t use any of the things the higher ISA level called for, but the arch notes system doesn&#x27;t know anything about that, and the lack of an explicit arch on that one file led to everything being contaminated with an arch of x86-64-v2. Sigh.)<br> </div> Sun, 07 Feb 2021 17:54:11 +0000 GNU C library 2.33 released https://lwn.net/Articles/845329/ https://lwn.net/Articles/845329/ nix <div class="FormattedComment"> Well upgrading my firewall was fun! We have more x86-32 rot! (This is *after* recovery, with all /lib links pointed back to 2.32.)<br> <p> nix@fold 4 /home/nix% /lib/ld-2.33.so --preload /lib/libc-2.33.so /bin/ls<br> /lib/libc-2.33.so: CPU ISA level is lower than required<br> <p> Looks like -march=geode does not cause binutils to guess right, at least as of binutils 2.35 (yes, I know this is old, but it still shouldn&#x27;t cause glibc to fail like this):<br> <p> Displaying notes found in: .note.gnu.property<br> Owner Data size Description<br> GNU 0x0000000c NT_GNU_PROPERTY_TYPE_0<br> Properties: x86 ISA needed: x86-64-v2<br> <p> (will report to the glibc list.)<br> <p> Looks like the only way to turn off this stuff right now is to pass libc_cv_include_x86_isa_level=no to configure, which gentoo and others have just started doing.<br> </div> Sun, 07 Feb 2021 17:27:43 +0000 GNU C library 2.33 released https://lwn.net/Articles/845303/ https://lwn.net/Articles/845303/ anton At least Skylake (and its variants up to Comet Lake) can do AVX/AVX2 work with the upper 128 bits of the unit powered down, at lower performance (and it works that way until the upper 128 bits have been powered up). So a better way to deal with both market segmentation and partially failing SIMD units would be to support AVX but on the Pentiums run it without the upper 128 bits of the functional unit. If you wonder about non-working lower 128 bits: then SSE won't work and they cannot sell the die even with disabled AVX. Sat, 06 Feb 2021 17:49:26 +0000 GNU C library 2.33 released https://lwn.net/Articles/845300/ https://lwn.net/Articles/845300/ anton <blockquote>Well, it seems that story got a happy ending, in that the -hwcaps is the ostensibly vendor-neutral solution to the same problem the old vendor-specific "haswell" subdirectory tried to solve?</blockquote> Sorry for mentioning hwcaps, which played no role in this. As the bug report explains, "haswell" is documented as vendor-neutral (despite its name), with the same meaning as "x86-64-v3", but the implementation worked only on Intel CPUs as documented, by explicitly checking for Intel CPUs (like <a href="https://en.wikipedia.org/wiki/Intel_MKL#Performance_and_vendor_lock-in">Intel does in the MKL</a>) and using the instruction set extensions only for them. The bug was not fixed for two years, and it's not clear that it is fixed now; and the reason given does not sound convincing at all. So, can we expect that "x86-64-v3" will fare any better than "haswell"? <p>Concerning chip area, AMD has demonstrated that AVX can be implemented with 128-bit wide functional units, including the low-power low-cost Jaguar (competition for Intel's Atom family). <p>Concerning packaging, at least with Debian's multiarch support, treating them as separate architectures and compiling all libraries for every level might be less work. But distributions that only have lib32/lib64 to deal with multiple architectures cannot go there. Sat, 06 Feb 2021 17:06:06 +0000 GNU C library 2.33 released https://lwn.net/Articles/845301/ https://lwn.net/Articles/845301/ Wol <div class="FormattedComment"> <font class="QuotedText">&gt; Stupid indeed. One can understand not wanting to spend chip area on large vector units, but fusing out functional units for product segmentation reason? Argh.</font><br> <p> Or is this a bit of complex real-estate that has a habit of not working? Fusing out stuff that fails QA and segmenting the product has some logic behind it.<br> <p> Cheers,<br> Wol<br> </div> Sat, 06 Feb 2021 16:54:54 +0000 GNU C library 2.33 released https://lwn.net/Articles/845290/ https://lwn.net/Articles/845290/ joib <div class="FormattedComment"> <font class="QuotedText">&gt; However, looking at Bug 23249, one can get the impression that Intel succeeds in hampering AMD CPUs not just in code compiled with the Intel compiler and using Intel-supplied libraries, but also in free software; and if they succeeded in the hwcaps case, why should they fail in the instruction-set-level case? </font><br> <p> Well, it seems that story got a happy ending, in that the -hwcaps is the ostensibly vendor-neutral solution to the same problem the old vendor-specific &quot;haswell&quot; subdirectory tried to solve?<br> <p> <font class="QuotedText">&gt; Lots of Intel CPUs disable this instruction set feature or that, even on silicon where it is implemented (e.g., Skylake Pentiums have AVX disabled); apparently Intel&#x27;s marketing thinks that they can perform market segmentation in that way. </font><br> <p> Stupid indeed. One can understand not wanting to spend chip area on large vector units, but fusing out functional units for product segmentation reason? Argh.<br> <p> <font class="QuotedText">&gt; Will distributions compile every packet for four different levels and install the one for the particular machine? </font><br> <p> I would guess that the binary package for libfoo would contain the .so&#x27;s for all 4 microarchitecture levels (or if the developers or distributors do benchmarking, only those levels where it makes a difference). Then again, I recall Debian/Ubuntu used to have libc6-i686 which was glibc compiled for the i686 target rather than the default i386 or i486, so maybe they will do separate packages. Sounds tedious, but oh well.<br> </div> Sat, 06 Feb 2021 12:23:24 +0000 GNU C library 2.33 released https://lwn.net/Articles/845289/ https://lwn.net/Articles/845289/ joib <div class="FormattedComment"> <font class="QuotedText">&gt; The architecture levels are something that you set the compiler to compile for and for the dynamic linking mechanism to use in searching for libraries (not sure how it will work out for finding executables; do we have to set the PATH depending on which machine we are working on?). So the idea is that people will compile a library for, say, the v3 level, and if the auto-vectorizer finds something to vectorize, it will use AVX and AVX2 rather than, at most, SSE2. </font><br> <p> Yes, that is my understanding as well. I don&#x27;t think there is an equivalent mechanism for executables (like you say it could be done with $PATH, but, ugh).<br> <p> <font class="QuotedText">&gt; So this will be more automatic and require less development effort to make use of instruction set extensions than what glibc does for its memmove variants. </font><br> <p> Yes. Though they are separate, there is a (minor) bloat reduction potential in not generating function versions &quot;below&quot; the microarchitecture level. But I guess the implementation could be somewhat hairy, and it&#x27;s just a little bit of extra space on disk as it won&#x27;t be loaded into memory, so maybe not worth worrying about.<br> <p> <font class="QuotedText">&gt; I wonder whether the benefits are enough to make this a success. It reminds me of the x32 ABI; it had some demonstrated performance advantages over the i386 and x86-64 ABIs, but in the end it was not enough to make it fly.</font><br> <p> I think the big difference here is that it&#x27;s not a new ABI, requiring the recompilation of everything. Rather this can be opt-in on a per-library basis, with the levels used chosen by the developers or distro packagers depending on what performance impact it might have. Say, glibc could provide all of x86-64{,-v2,-v3,-v4}, libfoo could provide x86-64{,-v3} and libbar could provide only the base x86-64, and depending on what hardware you run on the dynamic loader would use the best available variant of each library, mixing them freely.<br> </div> Sat, 06 Feb 2021 12:04:13 +0000 GNU C library 2.33 released https://lwn.net/Articles/845287/ https://lwn.net/Articles/845287/ anton That could be the case, unless somebody adjust the source code to not compile it unless the level is v2. <p>Anyway, reading <a href="https://sourceware.org/pipermail/libc-alpha/2020-July/116135.html">this message</a> makes the whole idea much clearer to me: The architecture levels are something that you set the compiler to compile for and for the dynamic linking mechanism to use in searching for libraries (not sure how it will work out for finding executables; do we have to set the PATH depending on which machine we are working on?). So the idea is that people will compile a library for, say, the v3 level, and if the auto-vectorizer finds something to vectorize, it will use AVX and AVX2 rather than, at most, SSE2. <p>So this will be more automatic and require less development effort to make use of instruction set extensions than what glibc does for its memmove variants. <p>I wonder whether the benefits are enough to make this a success. It reminds me of the x32 ABI; it had some demonstrated performance advantages over the i386 and x86-64 ABIs, but in the end it was not enough to make it fly. Sat, 06 Feb 2021 10:40:07 +0000 GNU C library 2.33 released https://lwn.net/Articles/845285/ https://lwn.net/Articles/845285/ anton It is unlikely that AMD will add their own extensions, at least as long as they don't dominate the market for AMD64 architectures. They tried that with 3DNow!, it did not become popular, and since about 2011 AMD CPUs have dropped 3DNow! (but they had to support it for quite a while, in K8 and K10). FMA4 is a similar story. <p>But if AMD should choose to not implement AVX-512 (I expect they will support it at some time), AMD users run the code compiled for v3; I don't see a problem here. However, looking at <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=23249">Bug 23249</a>, one can get the impression that Intel succeeds in hampering AMD CPUs not just in code compiled with the Intel compiler and using Intel-supplied libraries, but also in free software; and if they succeeded in the hwcaps case, why should they fail in the instruction-set-level case? <p>As for Intel CPUs not supporting instruction set extensions, it's not just the Atom product line. Lots of Intel CPUs disable this instruction set feature or that, even on silicon where it is implemented (e.g., Skylake Pentiums have AVX disabled); apparently Intel's marketing thinks that they can perform market segmentation in that way. <p>The only thing it achieves is that almost nobody uses the more advanced features. This instruction-set level idea has a certain potential at improving this situation, but I wonder: Even if it's as easy as invoking gcc with some architecture-level option, I guess that most upstream developers will set up their build infrastructure to just compile for the base level by default (and the builder configure to have it compiled with specific options). Will distributions compile every packet for four different levels and install the one for the particular machine? Sat, 06 Feb 2021 10:20:41 +0000 GNU C library 2.33 released https://lwn.net/Articles/845282/ https://lwn.net/Articles/845282/ dvdeug <div class="FormattedComment"> Looking at the PDFs joib so helpfully linked to, the latest level is AVX-512, which AMD has apparently issued no public plans to support. It seems not impossible that AMD will never support AVX-512, and will add its own extensions that GCC wants to support. H. J. Lu, the lead author on the PDF, works for Intel, and none of the authors list amd.com emails; it seems likely they&#x27;re more tied into Intel&#x27;s plans than AMD&#x27;s plans.<br> <p> From another angle, <a href="https://www.extremetech.com/computing/312673-linus-torvalds-i-hope-avx512-dies-a-painful-death">https://www.extremetech.com/computing/312673-linus-torval...</a> mentions that Atom CPUs don&#x27;t even support AVX; what happens when Atom CPUs come out with new instructions specialized for low-power ChromeBooks? Or even some specific instructions, like AES enhancements, make their way all the way down the line to Atom CPUs?<br> <p> Either way, AMD adding its own instructions without supporting AVX-512 or newer instructions making their way down to cheap CPUs with limited AVX support, it seems entirely out of the control of the GNU toolchain people that there are no new instructions they need to support on CPUs that don&#x27;t support AVX-512.<br> </div> Sat, 06 Feb 2021 06:08:57 +0000 GNU C library 2.33 released https://lwn.net/Articles/845254/ https://lwn.net/Articles/845254/ joib <div class="FormattedComment"> LLVM has also added support for these microarchitecture levels: <a href="https://github.com/llvm/llvm-project/commit/012dd42e027e">https://github.com/llvm/llvm-project/commit/012dd42e027e</a> . Though I don&#x27;t know if they have any input into the design, or whether they&#x27;re just copying what the GNU toolchain is doing.<br> </div> Fri, 05 Feb 2021 20:17:43 +0000 GNU C library 2.33 released https://lwn.net/Articles/845236/ https://lwn.net/Articles/845236/ nix <div class="FormattedComment"> Yeah, most of these things use runtime checks anyway. The hwcaps scheme that this replaces was meant for things like cmov which had pervasive impact on compiler output, so that rebuilding whole shared libraries for different subarchitectures was worthwhile -- so really the question isn&#x27;t &quot;what are x86 CPUs capable of&quot; which is indeed a bloody awful mess, but rather &quot;what things that x86 CPUs are capable of does GCC generate noticeably better code for while not being backwardly-compatible to the older models&quot;. Since GCC&#x27;s code generation for different x86 processors is completely under the control of the GNU toolchain people (and, indeed, mostly the exact same GNU toolchain people who specified this feature), I think we can say they probably won&#x27;t get torpedoed in the future, since they&#x27;d literally be torpedoing themselves.<br> </div> Fri, 05 Feb 2021 19:14:19 +0000 GNU C library 2.33 released https://lwn.net/Articles/845151/ https://lwn.net/Articles/845151/ atai <div class="FormattedComment"> In the lwn weekly summary this item was referred to as &quot;glib release&quot; instead of glibc release<br> </div> Fri, 05 Feb 2021 07:42:06 +0000 GNU C library 2.33 released https://lwn.net/Articles/845136/ https://lwn.net/Articles/845136/ joib <div class="FormattedComment"> But there is no interaction between the glibc-hwcaps and function multiversioning, no?<br> <p> So the x86-64-v4 libc.so will still contain __memmove_ssse3 etc. though it will never be used?<br> </div> Thu, 04 Feb 2021 21:03:03 +0000 GNU C library 2.33 released https://lwn.net/Articles/845134/ https://lwn.net/Articles/845134/ joib <div class="FormattedComment"> <font class="QuotedText">&gt; Basically AMD64 is a mismash of supported features, across all chips and even within just Intel chips. </font><br> <p> AFAIU the glibc-hwcaps and the microarchitecture levels are meant to provide somewhat decent baselines that apply to many CPU&#x27;s out there and are expected to be &quot;standard&quot; features in x86 CPU&#x27;s going forwards. It&#x27;s up to the psABI developers to not be too aggressive in adding stuff there that might disappear from the market or are of interest only to a small subset of the market (both of these applying to the Xeon Phi&#x27;s you mentioned).<br> <p> <font class="QuotedText">&gt; I&#x27;ve got &quot;System V Application Binary Interface: AMD64 Architecture Processor Supplement (With LP64 and ILP32 Programming Models) Version 1.0&quot;, but I don&#x27;t see any details about the microarchitecture levels; if that&#x27;s the right document, the newer versions only come as TeX files.</font><br> <p> For some reason the PDF&#x27;s are excruciatingly hard to find. If you click on the &quot;Wiki&quot; section you get a placeholder page saying that the project has no wiki pages. However, the PDF&#x27;s are there, the URL is<br> <p> <a href="https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/x86-64-psABI">https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/x86-64-p...</a><br> <p> (The microarchitecture levels are in Table 3.1)<br> </div> Thu, 04 Feb 2021 20:53:24 +0000 GNU C library 2.33 released https://lwn.net/Articles/845060/ https://lwn.net/Articles/845060/ arekm <div class="FormattedComment"> That way, ah! Thanks.<br> </div> Thu, 04 Feb 2021 12:54:49 +0000 GNU C library 2.33 released https://lwn.net/Articles/845058/ https://lwn.net/Articles/845058/ fweimer <div class="FormattedComment"> Distributions can build glibc multiple times with different build flags, and install the shared objects into those subdirectories. Some distributions already did this with a POWER9-optimized glibc in the legacy power9 AT_PLATFORM subdirectory.<br> </div> Thu, 04 Feb 2021 12:24:15 +0000 GNU C library 2.33 released https://lwn.net/Articles/845049/ https://lwn.net/Articles/845049/ arekm <div class="FormattedComment"> Actually I&#x27;m asking about optimized variants loaded from &quot;under the glibc-hwcaps directory. I don&#x27;t see any like this in 2.33.<br> </div> Thu, 04 Feb 2021 10:03:33 +0000 GNU C library 2.33 released https://lwn.net/Articles/845047/ https://lwn.net/Articles/845047/ anton glibc has alternative implementations for some functions already before (e.g., glibc-2.28 contains names such as __memmove_ssse3, __memmove_avx512_unaligned, __memmove_avx512_no_vzeroupper and more). So this seems to be a mechanism to help select between such versions. Thu, 04 Feb 2021 10:00:46 +0000 GNU C library 2.33 released https://lwn.net/Articles/845043/ https://lwn.net/Articles/845043/ anton This mess is probably the reason for the new scheme. So yes, glibc may not use all the features of the CPU at hand, but then, does it make a difference? And if it makes a difference, I guess the shared object for, say, x86-64-v4, can still do a CPUID check for the additional feature and then put the appropriate function pointer in the dispatch table, but at least the code can rely on all the v4 features and does not have to worry about whether these are available. Thu, 04 Feb 2021 09:45:33 +0000 GNU C library 2.33 released https://lwn.net/Articles/845029/ https://lwn.net/Articles/845029/ dvdeug <div class="FormattedComment"> Except that looking at <a href="https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#CPUs_with_AVX-512">https://en.wikipedia.org/wiki/Advanced_Vector_Extensions#...</a> :<br> For various AVX-512 features--see Wikipedia for the descriptions--<br> Knights Landing supports ER.<br> Knights Mill supports ER, 4FMAPS and VPOPCNTDQ.<br> Skylake-SP supports VL (and none of the above).<br> Cannon Lake supports VL and IFMA.<br> Cascade Lake-SP supports VL and VNNI. <br> Ice Lake supports VL, IFMA, VBMI2, VPOPCNTDQ and VNNI.<br> <p> That is, Knights Mill is a superset of Knights Landing; Skylake is a subset of Cannon Lake and Cascade Lake (neither of which are a subset of each other), and Ice Lake is a superset of Cannon Lake and Cascade Lake (but not Knights Landing).<br> <p> Likewise, FMA4 can never be supported in this scheme, since more recent processors don&#x27;t support it.<br> <p> Basically AMD64 is a mismash of supported features, across all chips and even within just Intel chips. Even if you&#x27;re not concerned about getting optimal performance out of older chips, nobody could have known when FMA4 came out if and how it was going to be supported in the future. Looking at the full AVX-512 table, I don&#x27;t know what features in Ice Lake are going to be standard in the future; it seems like either they&#x27;re going to be running far behind the leading edge, or end up defining the top &quot;logical architecture level&quot; as something that it turns out no new processors are supporting, and thus being forced to break the architecture levels.<br> <p> I&#x27;ve got &quot;System V Application Binary Interface: AMD64 Architecture Processor Supplement (With LP64 and ILP32 Programming Models) Version 1.0&quot;, but I don&#x27;t see any details about the microarchitecture levels; if that&#x27;s the right document, the newer versions only come as TeX files.<br> </div> Thu, 04 Feb 2021 06:39:46 +0000 GNU C library 2.33 released https://lwn.net/Articles/844885/ https://lwn.net/Articles/844885/ arekm <div class="FormattedComment"> Does 2.33 already provide some optimized variants or it just adds feature for loading but without any optimized versions?<br> </div> Tue, 02 Feb 2021 22:32:54 +0000 GNU C library 2.33 released https://lwn.net/Articles/844868/ https://lwn.net/Articles/844868/ josh <div class="FormattedComment"> This is the headline feature:<br> <p> <font class="QuotedText">&gt; The dynamic linker loads optimized implementations of shared objects from subdirectories under the glibc-hwcaps directory on the library search path if the system&#x27;s capabilities meet the requirements for that subdirectory. Initially supported subdirectories include &quot;power9&quot; and &quot;power10&quot; for the powerpc64le-linux-gnu architecture, &quot;z13&quot;, &quot;z14&quot;, &quot;z15&quot; for s390x-linux-gnu, and &quot;x86-64-v2&quot;, &quot;x86-64-v3&quot;, &quot;x86-64-v4&quot; for x86_64-linux-gnu. In the x86_64-linux-gnu case, the subdirectory names correspond to the vendor-independent x86-64 microarchitecture levels defined in the x86-64 psABI supplement.</font><br> <p> This is a replacement for the old hardware capabilities mechanism, which caused a combinatorial explosion of checks for each capability. This new mechanism groups capabilities together into logical architecture levels that are increasing supersets, so it can just look for one of them at a time.<br> </div> Tue, 02 Feb 2021 16:52:12 +0000