[PATCH 0/2] Remove some i386 system call optimizations

Florian Weimer fweimer@redhat.com
Tue Jan 11 22:52:39 GMT 2022


* 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



More information about the Libc-alpha mailing list