public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28771] New: %ebx optimization macros are incompatible with .altmacro in Systemtap probes
@ 2022-01-12 20:11 fweimer at redhat dot com
  2022-01-13 14:22 ` [Bug libc/28771] " fweimer at redhat dot com
  2022-01-13 14:23 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2022-01-12 20:11 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28771

            Bug ID: 28771
           Summary: %ebx optimization macros are incompatible with
                    .altmacro in Systemtap probes
           Product: glibc
           Version: 2.35
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
                CC: drepper.fsp at gmail dot com, hjl.tools at gmail dot com
  Target Milestone: ---
             Build: i686-linux-gnu
             Flags: security-

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[2]: *** [../o-iterator.mk:9:
/home/fweimer/src/gnu/glibc/build/nptl/pthread_create.o] Error 1

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/28771] %ebx optimization macros are incompatible with .altmacro in Systemtap probes
  2022-01-12 20:11 [Bug libc/28771] New: %ebx optimization macros are incompatible with .altmacro in Systemtap probes fweimer at redhat dot com
@ 2022-01-13 14:22 ` fweimer at redhat dot com
  2022-01-13 14:23 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2022-01-13 14:22 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28771

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |2.35
                 CC|                            |fweimer at redhat dot com
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for 2.35 via:

commit a78e6a10d0b50d0ca80309775980fc99944b1727
Author: Florian Weimer <fweimer@redhat.com>
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
    unconditionally).

    (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
    calls unconditionally.

    Reviewed-by: H.J. Lu <hjl.tools@gmail.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libc/28771] %ebx optimization macros are incompatible with .altmacro in Systemtap probes
  2022-01-12 20:11 [Bug libc/28771] New: %ebx optimization macros are incompatible with .altmacro in Systemtap probes fweimer at redhat dot com
  2022-01-13 14:22 ` [Bug libc/28771] " fweimer at redhat dot com
@ 2022-01-13 14:23 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2022-01-13 14:23 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28771

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xer8686 at mail dot ru

--- Comment #2 from Florian Weimer <fweimer at redhat dot com> ---
*** Bug 27997 has been marked as a duplicate of this bug. ***

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-13 14:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 20:11 [Bug libc/28771] New: %ebx optimization macros are incompatible with .altmacro in Systemtap probes fweimer at redhat dot com
2022-01-13 14:22 ` [Bug libc/28771] " fweimer at redhat dot com
2022-01-13 14:23 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).