summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/i386/sysdep.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-01-08 11:38:23 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-02-17 18:06:29 -0200
commit3b33d6ed6096c1d20d05a650b06026d673f7399a (patch)
treeaaca20724918d38903fe3ffe780fd17a9de3b9eb /sysdeps/unix/sysv/linux/i386/sysdep.h
parent52ac22365a332cacf7aa97f1b41b3a0adfaff778 (diff)
Rework -fno-omit-frame-pointer support on i386
Commit 6b1df8b27f fixed the -OS build issue on i386 (BZ#20729) by expliciting disabling frame pointer (-fomit-frame-pointer) on the faulty objects. Although it does fix the issue, it is a subpar workaround that adds complexity in build process (a rule for each object to add the required compiler option and pontentially more rules for objects that call {INLINE,INTERNAL}_SYSCALL) and does not allow the implementations to get all the possible debug/calltrack information possible (used mainly in debuggers and performance measurement tools). This patch fixes it by adding an explicit configure check to see if -fno-omit-frame-pointer is set and to act accordingly (set or not OPTIMIZE_FOR_GCC_5). The make rules is simplified and only one is required: to add libc-do-syscall on loader due mmap (which will be empty anyway for default build with -fomit-frame-pointer). Checked on i386-linux-gnu with GCC 6.2.1 with CFLAGS sets as '-Os', '-O2 -fno-omit-frame-pointer', and '-O2 -fomit-frame-pointer'. For '-Os' the testsuite issues described by BZ#19463 and BZ#15105 still applied. It fixes BZ #21029, although it is marked as duplicated of #20729 (I reopened to track this cleanup). [BZ #21029] * config.h.in [CAN_USE_REGISTER_ASM_EBP]: New define. * sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = elf] (sysdep-dl-routines): Add libc-do-syscall. (uses-6-syscall-arguments): Remove. [$(subdir) = misc] (CFLAGS-epoll_pwait.o): Likewise. [$(subdir) = misc] (CFLAGS-epoll_pwait.os): Likewise. [$(subdir) = misc] (CFLAGS-mmap.o): Likewise. [$(subdir) = misc] (CFLAGS-mmap.os): Likewise. [$(subdir) = misc] (CFLAGS-mmap64.o): Likewise. [$(subdir) = misc] (CFLAGS-mmap64.os): Likewise. [$(subdir) = misc] (CFLAGS-pselect.o): Likewise. [$(subdir) = misc] (cflags-pselect.o): Likewise. [$(subdir) = misc] (cflags-pselect.os): Likewise. [$(subdir) = misc] (cflags-rtld-mmap.os): Likewise. [$(subdir) = sysvipc] (cflags-semtimedop.o): Likewise. [$(subdir) = sysvipc] (cflags-semtimedop.os): Likewise. [$(subdir) = io] (CFLAGS-posix_fadvise64.o): Likewise. [$(subdir) = io] (CFLAGS-posix_fadvise64.os): Likewise. [$(subdir) = io] (CFLAGS-posix_fallocate.o): Likewise. [$(subdir) = io] (CFLAGS-posix_fallocate.os): Likewise. [$(subdir) = io] (CFLAGS-posix_fallocate64.o): Likewise. [$(subdir) = io] (CFLAGS-posix_fallocate64.os): Likewise. [$(subdir) = io] (CFLAGS-sync_file_range.o): Likewise. [$(subdir) = io] (CFLAGS-sync_file_range.os): Likewise. [$(subdir) = io] (CFLAGS-fallocate.o): Likewise. [$(subdir) = io] (CFLAGS-fallocate.os): Likewise. [$(subdir) = io] (CFLAGS-fallocate64.o): Likewise. [$(subdir) = io] (CFLAGS-fallocate64.os): Likewise. [$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrdlock.o): Likewise. [$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrdlock.os): Likewise. [$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrwlock.o): Likewise. [$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrwlock.os): Likewise. [$(subdir) = nptl] (CFLAGS-sem_wait.o): Likewise. [$(subdir) = nptl] (CFLAGS-sem_wait.os): Likewise. [$(subdir) = nptl] (CFLAGS-sem_timedwait.o): Likewise. [$(subdir) = nptl] (CFLAGS-sem_timedwait.os): Likewise. * sysdeps/unix/sysv/linux/i386/configure.ac: Add check if compiler allows ebp on inline assembly. * sysdeps/unix/sysv/linux/i386/configure: Regenerate. * sysdeps/unix/sysv/linux/i386/sysdep.h (OPTIMIZE_FOR_GCC_5): Set if CAN_USE_REGISTER_ASM_EBP is set. (check_consistency): Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux/i386/sysdep.h')
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index baf46421b2..449b23e49b 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -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