Subject: [PATCH] alt/glibc.spec: enable multiarch (IFUNC) for i586 by building as i686 On ALT p11, i586-glibc-core is built for the i586 target with multiarch disabled, so memcpy/memmove/memset/strlen/strcmp/memcmp and the other string functions are the old generic i586 code (plain FUNC symbols, no IFUNC). The i586 memcpy reads the destination buffer before writing it, which makes 32-bit applications that copy large amounts of data (Steam games, e.g. Half-Life 2 with Mesa/radeonsi) run 6-9 times slower than with the Fedora or freedesktop-sdk 32-bit glibc (20-30 FPS vs 180 FPS on the same machine). The i386 IFUNC variants are in sysdeps/i386/i686/multiarch, which is only used when configured for an i686 target; simply adding --enable-multi-arch for %ix86 fails to link ("undefined reference to __memcmp_ia32"). Enable multiarch on %ix86 and configure it with --build/--host=i686-alt-linux. A test build of glibc-2.38.0.223.f053ff-alt1.p11.1 in hasher for i586 succeeds and exports 48 IFUNC symbols (same set as the freedesktop-sdk 26.08 i386 libc). Note: this makes the library require i686 (cmov) CPUs; real i586-only processors would no longer be supported by this package. --- --- a/alt/glibc.spec 2026-10-09 15:28:33.154117397 +0500 +++ b/alt/glibc.spec 2026-10-09 15:28:33.164537673 +0500 @@ -24,7 +24,9 @@ %def_with locales %def_enable memusagestat -%ifarch x86_64 +# IFUNC variants (SSE2/AVX) of memcpy/memmove/memset/strlen/strcmp/... live in +# sysdeps/i386/i686/multiarch, so multiarch on %ix86 requires an i686 target. +%ifarch x86_64 %ix86 %def_enable multiarch %else %def_disable multiarch @@ -361,6 +363,9 @@ %global optflags_lto %nil %configure \ +%ifarch %ix86 + --build=i686-alt-linux --host=i686-alt-linux \ +%endif --disable-crypt \ --disable-profile \ --enable-bind-now \