This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/21029] glibc-2.23 (and later) fails to compile with -fno-omit-frame-pointer on i386


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

--- Comment #3 from Jan Ziak (http://atom-symbol.net) <0xe2.0x9a.0x9b at gmail dot com> ---
(In reply to Adhemerval Zanella from comment #1)
> AFAIK it is not an issue because 'ebp' is this context is used on kernel ABI
> to pass the 6th argument (the file sysdeps/unix/sysv/linux/i386/sysdep.h
> contains a comment about the linux convention for i686).

It's an issue as long as it is fixable in glibc. The fact is, it *is* fixable
in glibc.

It's an issue as long as it is fixable in gcc. The fact is, it *is* fixable in
gcc.

It's an issue as long as it is fixable in the Linux kernel. The fact is, it
*is* fixable in Linux kernel.

It's an issue as long as it is fixable on my machine alone. The fact is, it
*is* fixable on my machine alone.

The question is: which software component is the easiest to change and will
have the most impact on the world.

> Unless there is a compiler option to make easier to create syscall macros
> (so compiler can restore ebp somehow), you will need to explict disable
> -fno-omit-frame-pointer on these files.
> 
> Another option would to code this syscalls in asm, but I will advise against
> since to make i386 to use the generic code is exactly to avoid the
> proliferation of such implementations.

The best solution is the update the definition of INTERNAL_SYSCALL with
something like this:

    LOADREGS_##nr(args)
    asm volatile (
    PUSHREGS_ASM_##nr(args)
    "call *%%gs:%P2"
    POPREGS_ASM_##nr
    : "=a" (resultvar)

#define PUSHREGS_ASM_5(args...) "" // empty
#define PUSHREGS_ASM_6(args...) "push %%ebp; mov arg6, %%ebp;"

#define POPREGS_ASM_5 "" // empty
#define POPREGS_ASM_6 "pop %%ebp"

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]