We need to build Fedora 36 with !CAN_USE_REGISTER_ASM_EBP because of auto-vectorization at -O2. This results in a different build failure in nptl/pthread_create.c because the probes there use .altmacro, which breaks inline system calls later in this file.
To reproduce, build glibc with systemtap-sdt-devel-4.6-4.fc35 (or the Fedora rawhide version) and:
../git/configure --prefix=/usr CC="gcc -m32" CXX="g++ -m32" --build=i686-linux-gnu libc_cv_can_use_register_asm_ebp=no --enable-systemtap
pthread_create.c: Assembler messages:
pthread_create.c:594: Error: % operator needs absolute expression
pthread_create.c:597: Error: % operator needs absolute expression
../sysdeps/unix/sysv/linux/default-sched.h:31: Error: % operator needs absolute expression
../sysdeps/unix/sysv/linux/default-sched.h:34: Error: % operator needs absolute expression
../sysdeps/unix/sysv/linux/default-sched.h:37: Error: % operator needs absolute expression
../sysdeps/unix/sysv/linux/default-sched.h:40: Error: % operator needs absolute expression
make: *** [../o-iterator.mk:9: /home/fweimer/src/gnu/glibc/build/nptl/pthread_create.o] Error 1
Fixed for 2.35 via:
Author: Florian Weimer <firstname.lastname@example.org>
Date: Thu Jan 13 14:59:29 2022 +0100
i386: Remove broken CAN_USE_REGISTER_ASM_EBP (bug 28771)
The configure check for CAN_USE_REGISTER_ASM_EBP tried to compile a
simple function that uses %ebp as an inline assembly operand. If
compilation failed, CAN_USE_REGISTER_ASM_EBP was set 0, which
eventually had these consequences:
(1) %ebx was avoided as an inline assembly operand, with an
assembler macro hack to avoid unnecessary register moves.
(2) %ebp was avoided as an inline assembly operand, using an
out-of-line syscall function for 6-argument system calls.
(1) is no longer needed for any GCC version that is supported for
building glibc. %ebx can be used directly as a register operand.
Therefore, this commit removes the %ebx avoidance completely. This
avoids the assembler macro hack, which turns out to be incompatible
with the current Systemtap probe macros (which switch to .altmacro
(2) is still needed in many build configurations. The existing
configure check cannot really capture that because the simple function
succeeds to compile, while the full glibc build still fails.
Therefore, this commit removes the check, the CAN_USE_REGISTER_ASM_EBP
macro, and uses the out-of-line syscall function for 6-argument system
Reviewed-by: H.J. Lu <email@example.com>
*** Bug 27997 has been marked as a duplicate of this bug. ***