Message ID | cover.1641895400.git.fweimer@redhat.com |
---|---|
Headers |
Return-Path: <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 677E238A140F for <patchwork@sourceware.org>; Tue, 11 Jan 2022 10:06:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 677E238A140F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1641895577; bh=EtnG7PTncHVESbo7wFB4gNjA4dIlfgIPyiIkWD79z2k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ZBJHe5vvMYGSe9Vn8pPfCks6vT/819WnMSvdOLDw+HGJc7wZi+Tjhnv/k09z3Sagg kP5LhnC76Grxj1g5klXfDGN97hDtPAH+gLPjNwPrRXhzw5xwoot6ovBBZo9yj+DiDJ 2w9gh4FAcquKhvC8LclcW/1ozd/am1Bc1PYT7+dA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 49748389FC0A for <libc-alpha@sourceware.org>; Tue, 11 Jan 2022 10:05:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 49748389FC0A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-327-t0Qq2_ogOF2sG0AKuFoBGA-1; Tue, 11 Jan 2022 05:05:14 -0500 X-MC-Unique: t0Qq2_ogOF2sG0AKuFoBGA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E628104; Tue, 11 Jan 2022 10:05:13 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 985BE70D23; Tue, 11 Jan 2022 10:05:10 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 0/2] Remove some i386 system call optimizations X-From-Line: 10618fa43399978f066fb375fdf9732d333da925 Mon Sep 17 00:00:00 2001 Message-Id: <cover.1641895400.git.fweimer@redhat.com> Date: Tue, 11 Jan 2022 11:05:08 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Florian Weimer <fweimer@redhat.com> Cc: Jakub Jelinek <jakub@redhat.com> Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Remove some i386 system call optimizations
|
|
Message
Florian Weimer
Jan. 11, 2022, 10:05 a.m. UTC
The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we used it to switch away from using %ebx in assembler constraints, but this appears to be no longer necessary. Tested on i686-linux-gnu. Built with build-many-glibcs.py. Thanks, Florian Florian Weimer (2): i386: Always treat %ebx as an allocatable register i386: Always use __libc_do_syscall for 6-argument syscalls (bug 27997) config.h.in | 4 - sysdeps/unix/sysv/linux/i386/configure | 39 ---- sysdeps/unix/sysv/linux/i386/configure.ac | 17 -- sysdeps/unix/sysv/linux/i386/sysdep.h | 222 +++------------------- 4 files changed, 27 insertions(+), 255 deletions(-) base-commit: e72ef23ee88187284b4b1ca9b2e314e618429d35
Comments
On Tue, Jan 11, 2022 at 2:05 AM Florian Weimer <fweimer@redhat.com> wrote: > > The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we > used it to switch away from using %ebx in assembler constraints, but > this appears to be no longer necessary. This GCC bug has been fixed in GCC 5 as seen in commit 021478683cc091de9902d297a7b161f8343ffb6a Author: Uros Bizjak <uros@gcc.gnu.org> Date: Fri Oct 17 08:00:58 2014 +0200 cpuid.h (__cpuid): Remove definitions that handle %ebx register in a special way. * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx register in a special way. (__cpuid_count): Ditto. * config/i386/driver-i386.h: Protect with "#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))". (host_detect_local_cpu): Mention that GCC with non-fixed %ebx is required to compile the function. From-SVN: r216362 Since GCC 6.2 or above is required to build glibc, please remove the !OPTIMIZE_FOR_GCC_5 path and this issue will be resolved automatically. > Tested on i686-linux-gnu. Built with build-many-glibcs.py. > > Thanks, > Florian > > Florian Weimer (2): > i386: Always treat %ebx as an allocatable register > i386: Always use __libc_do_syscall for 6-argument syscalls (bug 27997) > > config.h.in | 4 - > sysdeps/unix/sysv/linux/i386/configure | 39 ---- > sysdeps/unix/sysv/linux/i386/configure.ac | 17 -- > sysdeps/unix/sysv/linux/i386/sysdep.h | 222 +++------------------- > 4 files changed, 27 insertions(+), 255 deletions(-) > > > base-commit: e72ef23ee88187284b4b1ca9b2e314e618429d35 > -- > 2.34.1 > -- H.J.
On Tue, Jan 11, 2022 at 6:00 AM H.J. Lu <hjl.tools@gmail.com> wrote: > > On Tue, Jan 11, 2022 at 2:05 AM Florian Weimer <fweimer@redhat.com> wrote: > > > > The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we > > used it to switch away from using %ebx in assembler constraints, but > > this appears to be no longer necessary. > > This GCC bug has been fixed in GCC 5 as seen in > > commit 021478683cc091de9902d297a7b161f8343ffb6a > Author: Uros Bizjak <uros@gcc.gnu.org> > Date: Fri Oct 17 08:00:58 2014 +0200 > > cpuid.h (__cpuid): Remove definitions that handle %ebx register in > a special way. > > * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx > register in a special way. > (__cpuid_count): Ditto. > * config/i386/driver-i386.h: Protect with > "#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))". > (host_detect_local_cpu): Mention that GCC with non-fixed %ebx > is required to compile the function. > > From-SVN: r216362 > > Since GCC 6.2 or above is required to build glibc, please > remove the !OPTIMIZE_FOR_GCC_5 path and this issue > will be resolved automatically. There are /* Since GCC 5 and above can properly spill %ebx with PIC when needed, we can inline syscalls with 6 arguments if GCC 5 or above is used to compile glibc. Disable GCC 5 optimization when compiling for profiling or when -fno-omit-frame-pointer is used since asm ("ebp") can't be used to put the 6th argument in %ebp for syscall. */ #if !defined PROF && CAN_USE_REGISTER_ASM_EBP # define OPTIMIZE_FOR_GCC_5 #endif If we want to support profiling or -fno-omit-frame-pointer, we need to keep these codes. > > Tested on i686-linux-gnu. Built with build-many-glibcs.py. > > > > Thanks, > > Florian > > > > Florian Weimer (2): > > i386: Always treat %ebx as an allocatable register > > i386: Always use __libc_do_syscall for 6-argument syscalls (bug 27997) > > > > config.h.in | 4 - > > sysdeps/unix/sysv/linux/i386/configure | 39 ---- > > sysdeps/unix/sysv/linux/i386/configure.ac | 17 -- > > sysdeps/unix/sysv/linux/i386/sysdep.h | 222 +++------------------- > > 4 files changed, 27 insertions(+), 255 deletions(-) > > > > > > base-commit: e72ef23ee88187284b4b1ca9b2e314e618429d35 > > -- > > 2.34.1 > > > > > -- > H.J.
* H. J. Lu: > On Tue, Jan 11, 2022 at 6:00 AM H.J. Lu <hjl.tools@gmail.com> wrote: >> >> On Tue, Jan 11, 2022 at 2:05 AM Florian Weimer <fweimer@redhat.com> wrote: >> > >> > The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we >> > used it to switch away from using %ebx in assembler constraints, but >> > this appears to be no longer necessary. >> >> This GCC bug has been fixed in GCC 5 as seen in >> >> commit 021478683cc091de9902d297a7b161f8343ffb6a >> Author: Uros Bizjak <uros@gcc.gnu.org> >> Date: Fri Oct 17 08:00:58 2014 +0200 >> >> cpuid.h (__cpuid): Remove definitions that handle %ebx register in >> a special way. >> >> * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx >> register in a special way. >> (__cpuid_count): Ditto. >> * config/i386/driver-i386.h: Protect with >> "#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))". >> (host_detect_local_cpu): Mention that GCC with non-fixed %ebx >> is required to compile the function. >> >> From-SVN: r216362 >> >> Since GCC 6.2 or above is required to build glibc, please >> remove the !OPTIMIZE_FOR_GCC_5 path and this issue >> will be resolved automatically. > > There are > > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, > we can inline syscalls with 6 arguments if GCC 5 or above is used > to compile glibc. Disable GCC 5 optimization when compiling for > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") > can't be used to put the 6th argument in %ebp for syscall. */ > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP > # define OPTIMIZE_FOR_GCC_5 > #endif > > If we want to support profiling or -fno-omit-frame-pointer, > we need to keep these codes. This is strictly for %ebp, I think, as indicated by the comment. %ebx does not need to be special-cased for profiling. I assume that building glibc (with profiling) is proof enough that this works? Thanks, Florian
On Tue, Jan 11, 2022 at 12:37 PM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > > On Tue, Jan 11, 2022 at 6:00 AM H.J. Lu <hjl.tools@gmail.com> wrote: > >> > >> On Tue, Jan 11, 2022 at 2:05 AM Florian Weimer <fweimer@redhat.com> wrote: > >> > > >> > The configure check for CAN_USE_REGISTER_ASM_EBP is unreliable. And we > >> > used it to switch away from using %ebx in assembler constraints, but > >> > this appears to be no longer necessary. > >> > >> This GCC bug has been fixed in GCC 5 as seen in > >> > >> commit 021478683cc091de9902d297a7b161f8343ffb6a > >> Author: Uros Bizjak <uros@gcc.gnu.org> > >> Date: Fri Oct 17 08:00:58 2014 +0200 > >> > >> cpuid.h (__cpuid): Remove definitions that handle %ebx register in > >> a special way. > >> > >> * config/i386/cpuid.h (__cpuid): Remove definitions that handle %ebx > >> register in a special way. > >> (__cpuid_count): Ditto. > >> * config/i386/driver-i386.h: Protect with > >> "#if defined(__GNUC__) && (__GNUC__ >= 5 || !defined(__PIC__))". > >> (host_detect_local_cpu): Mention that GCC with non-fixed %ebx > >> is required to compile the function. > >> > >> From-SVN: r216362 > >> > >> Since GCC 6.2 or above is required to build glibc, please > >> remove the !OPTIMIZE_FOR_GCC_5 path and this issue > >> will be resolved automatically. > > > > There are > > > > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, > > we can inline syscalls with 6 arguments if GCC 5 or above is used > > to compile glibc. Disable GCC 5 optimization when compiling for > > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") > > can't be used to put the 6th argument in %ebp for syscall. */ > > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP > > # define OPTIMIZE_FOR_GCC_5 > > #endif > > > > If we want to support profiling or -fno-omit-frame-pointer, > > we need to keep these codes. > > This is strictly for %ebp, I think, as indicated by the comment. %ebx > does not need to be special-cased for profiling. > > I assume that building glibc (with profiling) is proof enough that this > works? You need to test glibc build with -fno-omit-frame-pointer.
* H. J. Lu: >> > There are >> > >> > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, >> > we can inline syscalls with 6 arguments if GCC 5 or above is used >> > to compile glibc. Disable GCC 5 optimization when compiling for >> > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") >> > can't be used to put the 6th argument in %ebp for syscall. */ >> > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP >> > # define OPTIMIZE_FOR_GCC_5 >> > #endif >> > >> > If we want to support profiling or -fno-omit-frame-pointer, >> > we need to keep these codes. >> >> This is strictly for %ebp, I think, as indicated by the comment. %ebx >> does not need to be special-cased for profiling. >> >> I assume that building glibc (with profiling) is proof enough that this >> works? > > You need to test glibc build with -fno-omit-frame-pointer. I tried it, it works (with both patches applied). -fno-omit-frame-pointer is about %ebp, not %ebx. Thanks, Florian
On Tue, Jan 11, 2022 at 2:52 PM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > >> > There are > >> > > >> > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, > >> > we can inline syscalls with 6 arguments if GCC 5 or above is used > >> > to compile glibc. Disable GCC 5 optimization when compiling for > >> > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") > >> > can't be used to put the 6th argument in %ebp for syscall. */ > >> > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP > >> > # define OPTIMIZE_FOR_GCC_5 > >> > #endif > >> > > >> > If we want to support profiling or -fno-omit-frame-pointer, > >> > we need to keep these codes. > >> > >> This is strictly for %ebp, I think, as indicated by the comment. %ebx > >> does not need to be special-cased for profiling. > >> > >> I assume that building glibc (with profiling) is proof enough that this > >> works? > > > > You need to test glibc build with -fno-omit-frame-pointer. > > I tried it, it works (with both patches applied). > -fno-omit-frame-pointer is about %ebp, not %ebx. > > Thanks, > Florian > Do they have to be in glibc 2.35? If not, I prefer to do it after 2.35 is branched. Thanks.
* H. J. Lu: > On Tue, Jan 11, 2022 at 2:52 PM Florian Weimer <fweimer@redhat.com> wrote: >> >> * H. J. Lu: >> >> >> > There are >> >> > >> >> > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, >> >> > we can inline syscalls with 6 arguments if GCC 5 or above is used >> >> > to compile glibc. Disable GCC 5 optimization when compiling for >> >> > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") >> >> > can't be used to put the 6th argument in %ebp for syscall. */ >> >> > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP >> >> > # define OPTIMIZE_FOR_GCC_5 >> >> > #endif >> >> > >> >> > If we want to support profiling or -fno-omit-frame-pointer, >> >> > we need to keep these codes. >> >> >> >> This is strictly for %ebp, I think, as indicated by the comment. %ebx >> >> does not need to be special-cased for profiling. >> >> >> >> I assume that building glibc (with profiling) is proof enough that this >> >> works? >> > >> > You need to test glibc build with -fno-omit-frame-pointer. >> >> I tried it, it works (with both patches applied). >> -fno-omit-frame-pointer is about %ebp, not %ebx. >> >> Thanks, >> Florian >> > > Do they have to be in glibc 2.35? If not, I prefer to do it after > 2.35 is branched. We can't build glibc 2.35 with GCC 12 in Fedora without these changes. The %ebp avoidance I can activate with a configure argument, but the macros for optimized %ebx usage are incompatible with .altmacro, as used by the current Systemtap probes. Thanks, Florian
On Wed, Jan 12, 2022 at 11:37 AM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > > On Tue, Jan 11, 2022 at 2:52 PM Florian Weimer <fweimer@redhat.com> wrote: > >> > >> * H. J. Lu: > >> > >> >> > There are > >> >> > > >> >> > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, > >> >> > we can inline syscalls with 6 arguments if GCC 5 or above is used > >> >> > to compile glibc. Disable GCC 5 optimization when compiling for > >> >> > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") > >> >> > can't be used to put the 6th argument in %ebp for syscall. */ > >> >> > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP > >> >> > # define OPTIMIZE_FOR_GCC_5 > >> >> > #endif > >> >> > > >> >> > If we want to support profiling or -fno-omit-frame-pointer, > >> >> > we need to keep these codes. > >> >> > >> >> This is strictly for %ebp, I think, as indicated by the comment. %ebx > >> >> does not need to be special-cased for profiling. > >> >> > >> >> I assume that building glibc (with profiling) is proof enough that this > >> >> works? > >> > > >> > You need to test glibc build with -fno-omit-frame-pointer. > >> > >> I tried it, it works (with both patches applied). > >> -fno-omit-frame-pointer is about %ebp, not %ebx. > >> > >> Thanks, > >> Florian > >> > > > > Do they have to be in glibc 2.35? If not, I prefer to do it after > > 2.35 is branched. > > We can't build glibc 2.35 with GCC 12 in Fedora without these changes. > > The %ebp avoidance I can activate with a configure argument, but the > macros for optimized %ebx usage are incompatible with .altmacro, as used > by the current Systemtap probes. Please open a glibc bug with a reproducer and CC me. Thanks.
* H. J. Lu: > On Wed, Jan 12, 2022 at 11:37 AM Florian Weimer <fweimer@redhat.com> wrote: >> >> * H. J. Lu: >> >> > On Tue, Jan 11, 2022 at 2:52 PM Florian Weimer <fweimer@redhat.com> wrote: >> >> >> >> * H. J. Lu: >> >> >> >> >> > There are >> >> >> > >> >> >> > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, >> >> >> > we can inline syscalls with 6 arguments if GCC 5 or above is used >> >> >> > to compile glibc. Disable GCC 5 optimization when compiling for >> >> >> > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") >> >> >> > can't be used to put the 6th argument in %ebp for syscall. */ >> >> >> > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP >> >> >> > # define OPTIMIZE_FOR_GCC_5 >> >> >> > #endif >> >> >> > >> >> >> > If we want to support profiling or -fno-omit-frame-pointer, >> >> >> > we need to keep these codes. >> >> >> >> >> >> This is strictly for %ebp, I think, as indicated by the comment. %ebx >> >> >> does not need to be special-cased for profiling. >> >> >> >> >> >> I assume that building glibc (with profiling) is proof enough that this >> >> >> works? >> >> > >> >> > You need to test glibc build with -fno-omit-frame-pointer. >> >> >> >> I tried it, it works (with both patches applied). >> >> -fno-omit-frame-pointer is about %ebp, not %ebx. >> >> >> >> Thanks, >> >> Florian >> >> >> > >> > Do they have to be in glibc 2.35? If not, I prefer to do it after >> > 2.35 is branched. >> >> We can't build glibc 2.35 with GCC 12 in Fedora without these changes. >> >> The %ebp avoidance I can activate with a configure argument, but the >> macros for optimized %ebx usage are incompatible with .altmacro, as used >> by the current Systemtap probes. > > Please open a glibc bug with a reproducer and CC me. Done: <https://sourceware.org/bugzilla/show_bug.cgi?id=28771> Thanks, Florian
On Wed, Jan 12, 2022 at 12:12 PM Florian Weimer <fweimer@redhat.com> wrote: > > * H. J. Lu: > > > On Wed, Jan 12, 2022 at 11:37 AM Florian Weimer <fweimer@redhat.com> wrote: > >> > >> * H. J. Lu: > >> > >> > On Tue, Jan 11, 2022 at 2:52 PM Florian Weimer <fweimer@redhat.com> wrote: > >> >> > >> >> * H. J. Lu: > >> >> > >> >> >> > There are > >> >> >> > > >> >> >> > /* Since GCC 5 and above can properly spill %ebx with PIC when needed, > >> >> >> > we can inline syscalls with 6 arguments if GCC 5 or above is used > >> >> >> > to compile glibc. Disable GCC 5 optimization when compiling for > >> >> >> > profiling or when -fno-omit-frame-pointer is used since asm ("ebp") > >> >> >> > can't be used to put the 6th argument in %ebp for syscall. */ > >> >> >> > #if !defined PROF && CAN_USE_REGISTER_ASM_EBP > >> >> >> > # define OPTIMIZE_FOR_GCC_5 > >> >> >> > #endif > >> >> >> > > >> >> >> > If we want to support profiling or -fno-omit-frame-pointer, > >> >> >> > we need to keep these codes. > >> >> >> > >> >> >> This is strictly for %ebp, I think, as indicated by the comment. %ebx > >> >> >> does not need to be special-cased for profiling. > >> >> >> > >> >> >> I assume that building glibc (with profiling) is proof enough that this > >> >> >> works? > >> >> > > >> >> > You need to test glibc build with -fno-omit-frame-pointer. > >> >> > >> >> I tried it, it works (with both patches applied). > >> >> -fno-omit-frame-pointer is about %ebp, not %ebx. > >> >> > >> >> Thanks, > >> >> Florian > >> >> > >> > > >> > Do they have to be in glibc 2.35? If not, I prefer to do it after > >> > 2.35 is branched. > >> > >> We can't build glibc 2.35 with GCC 12 in Fedora without these changes. > >> > >> The %ebp avoidance I can activate with a configure argument, but the > >> macros for optimized %ebx usage are incompatible with .altmacro, as used > >> by the current Systemtap probes. > > > > Please open a glibc bug with a reproducer and CC me. > > Done: <https://sourceware.org/bugzilla/show_bug.cgi?id=28771> > OPTIMIZE_FOR_GCC_5 enables 2 things: one is let GCC handle -fPIC and the other is use register int reg asm ("ebp") which is unreliable. You want to let GCC handle -fPIC and remove CAN_USE_REGISTER_ASM_EBP. If this is correct, please combine 2 patches into one and reference BZ #28771 in the commit log. Thanks.
* H. J. Lu: > OPTIMIZE_FOR_GCC_5 enables 2 things: one is let GCC handle > -fPIC and the other is use > > register int reg asm ("ebp") > > which is unreliable. You want to let GCC handle -fPIC and > remove CAN_USE_REGISTER_ASM_EBP. If this is correct, > please combine 2 patches into one and reference BZ #28771 > in the commit log. Yes, that is an accurate summary. I will send a patch according to your suggestions tomorrow. Thanks, Florian