Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 484678 Details for
Bug 593784
<sys-libs/glibc-2.25-r5 : CFLAGS=-fno-omit-frame-pointer breaks 32-bit x86 build: compilation error: bp cannot be used in asm here
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Backported patch to 2.23.
fix-bp-cannot-be-used-in-asm-here.patch (text/plain), 4.86 KB, created by
Martin Kolleck
on 2017-07-14 20:56:56 UTC
(
hide
)
Description:
Backported patch to 2.23.
Filename:
MIME Type:
Creator:
Martin Kolleck
Created:
2017-07-14 20:56:56 UTC
Size:
4.86 KB
patch
obsolete
>diff -Naur glibc-2.23/config.h.in glibc-2.23-r1/config.h.in >--- glibc-2.23/config.h.in 2017-07-14 00:29:09.830086217 +0200 >+++ glibc-2.23-r1/config.h.in 2016-02-18 18:54:00.000000000 +0100 >@@ -231,4 +231,8 @@ > /* PowerPC32 uses fctidz for floating point to long long conversions. */ > #define HAVE_PPC_FCTIDZ 0 > >+/* Some compiler options may now allow to use ebp in __asm__ (used mainly >+ in i386 6 argument syscall issue). */ >+#define CAN_USE_REGISTER_ASM_EBP 0 >+ > #endif >diff -Naur glibc-2.23/sysdeps/unix/sysv/linux/i386/configure glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/configure >--- glibc-2.23/sysdeps/unix/sysv/linux/i386/configure 2016-02-18 18:54:00.000000000 +0100 >+++ glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/configure 2017-07-14 00:13:43.386731868 +0200 >@@ -1,5 +1,44 @@ > # This file is generated from configure.ac by Autoconf. DO NOT EDIT! > # Local configure fragment for sysdeps/unix/sysv/linux/i386. > >+# Check if CFLAGS allows compiler to use ebp register in inline assembly. >+ >+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler flags allows ebp in inline assembly" >&5 >+$as_echo_n "checking if compiler flags allows ebp in inline assembly... " >&6; } >+if ${libc_cv_can_use_register_asm_ebp+:} false; then : >+ $as_echo_n "(cached) " >&6 >+else >+ >+cat confdefs.h - <<_ACEOF >conftest.$ac_ext >+/* end confdefs.h. */ >+ >+ void foo (int i) >+ { >+ register int reg asm ("ebp") = i; >+ asm ("# %0" : : "r" (reg)); >+ } >+int >+main () >+{ >+ >+ ; >+ return 0; >+} >+_ACEOF >+if ac_fn_c_try_compile "$LINENO"; then : >+ libc_cv_can_use_register_asm_ebp=yes >+else >+ libc_cv_can_use_register_asm_ebp=no >+fi >+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext >+ >+fi >+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_can_use_register_asm_ebp" >&5 >+$as_echo "$libc_cv_can_use_register_asm_ebp" >&6; } >+if test $libc_cv_can_use_register_asm_ebp = yes; then >+ $as_echo "#define CAN_USE_REGISTER_ASM_EBP 1" >>confdefs.h >+ >+fi >+ > libc_cv_gcc_unwind_find_fde=yes > ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed >diff -Naur glibc-2.23/sysdeps/unix/sysv/linux/i386/configure.ac glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/configure.ac >--- glibc-2.23/sysdeps/unix/sysv/linux/i386/configure.ac 2016-02-18 18:54:00.000000000 +0100 >+++ glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/configure.ac 2017-07-14 00:15:10.776733850 +0200 >@@ -1,5 +1,22 @@ > GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. > # Local configure fragment for sysdeps/unix/sysv/linux/i386. > >+# Check if CFLAGS allows compiler to use ebp register in inline assembly. >+AC_CACHE_CHECK([if compiler flags allows ebp in inline assembly], >+ libc_cv_can_use_register_asm_ebp, [ >+AC_COMPILE_IFELSE( >+ [AC_LANG_PROGRAM([ >+ void foo (int i) >+ { >+ register int reg asm ("ebp") = i; >+ asm ("# %0" : : "r" (reg)); >+ }])], >+ [libc_cv_can_use_register_asm_ebp=yes], >+ [libc_cv_can_use_register_asm_ebp=no]) >+]) >+if test $libc_cv_can_use_register_asm_ebp = yes; then >+ AC_DEFINE(CAN_USE_REGISTER_ASM_EBP) >+fi >+ > libc_cv_gcc_unwind_find_fde=yes > ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed >diff -Naur glibc-2.23/sysdeps/unix/sysv/linux/i386/Makefile glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/Makefile >--- glibc-2.23/sysdeps/unix/sysv/linux/i386/Makefile 2016-02-18 18:54:00.000000000 +0100 >+++ glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/Makefile 2017-07-14 00:12:08.030063038 +0200 >@@ -3,19 +3,6 @@ > > ifeq ($(subdir),misc) > sysdep_routines += ioperm iopl vm86 >-# %ebp may be used to pass the 6th argument to syscall. >-CFLAGS-epoll_pwait.o += -fomit-frame-pointer >-CFLAGS-epoll_pwait.os += -fomit-frame-pointer >-CFLAGS-mmap.o += -fomit-frame-pointer >-CFLAGS-mmap.os += -fomit-frame-pointer >-CFLAGS-mmap64.o += -fomit-frame-pointer >-CFLAGS-mmap64.os += -fomit-frame-pointer >-endif >- >-ifeq ($(subdir),sysvipc) >-# %ebp may be used to pass the 6th argument to syscall. >-CFLAGS-semtimedop.o += -fomit-frame-pointer >-CFLAGS-semtimedop.os += -fomit-frame-pointer > endif > > ifeq ($(subdir),elf) >diff -Naur glibc-2.23/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/sysdep.h >--- glibc-2.23/sysdeps/unix/sysv/linux/i386/sysdep.h 2016-02-18 18:54:00.000000000 +0100 >+++ glibc-2.23-r1/sysdeps/unix/sysv/linux/i386/sysdep.h 2017-07-14 00:16:09.406735180 +0200 >@@ -44,9 +44,9 @@ > /* 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 since asm ("ebp") can't be used to put the 6th argument >- in %ebp for syscall. */ >-#if __GNUC_PREREQ (5,0) && !defined PROF >+ 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 __GNUC_PREREQ (5,0) && !defined PROF && CAN_USE_REGISTER_ASM_EBP > # define OPTIMIZE_FOR_GCC_5 > #endif >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 593784
:
445704
|
447794
|
459786
|
479262
|
480768
|
480770
| 484678