From: fweimer@redhat.com (Florian Weimer)
To: libc-alpha@sourceware.org
Subject: [PATCH] i386: Support CFLAGS which imply -fno-omit-frame-pointer [BZ #20729]
Date: Fri, 28 Oct 2016 15:05:00 -0000 [thread overview]
Message-ID: <20161028150542.A781D439942E0@oldenburg.str.redhat.com> (raw)
2016-10-28 Florian Weimer <fweimer@redhat.com>
[BZ #20729]
Support i386 builds with CFLAGS which imply -fno-omit-frame-pointer.
* sysdeps/unix/sysv/linux/i386/Makefile
(uses-6-syscall-arguments): Define.
[subdir == misc] (CFLAGS-epoll_pwait.o, CFLAGS-epoll_pwait.os)
(CFLAGS-mmap.o, CFLAGS-mmap.os, CFLAGS-mmap64.o, CFLAGS-mmap64.os)
(CFLAGS-pselect.o, CFLAGS-pselect.os, CFLAGS-rtld-mmap.os): Use it.
[subdir = sysvipc] (CFLAGS-semtimedop.o, CFLAGS-semtimedop.os):
Likewise.
[subdir = io] (CFLAGS-posix_fadvise64.o, CFLAGS-posix_fadvise64.os)
(CFLAGS-posix_fallocate.o, CFLAGS-posix_fallocate.os)
(CFLAGS-posix_fallocate64.o, CFLAGS-posix_fallocate64.os)
(CFLAGS-sync_file_range.o, CFLAGS-sync_file_range.os)
(CFLAGS-fallocate.o, CFLAGS-fallocate.os, CFLAGS-fallocate64.o)
(CFLAGS-fallocate64.os): Likewise.
[subdir = nptl] (CFLAGS-pthread_rwlock_timedrdlock.o)
(CFLAGS-pthread_rwlock_timedrdlock.os)
(CFLAGS-pthread_rwlock_timedwrlock.o)
(CFLAGS-pthread_rwlock_timedwrlock.os, CFLAGS-sem_wait.o)
(CFLAGS-sem_wait.os, CFLAGS-sem_timedwait.o)
(CFLAGS-sem_timedwait.os): Likewise.
diff --git a/sysdeps/unix/sysv/linux/i386/Makefile b/sysdeps/unix/sysv/linux/i386/Makefile
index 6073a9f..2596cdf 100644
--- a/sysdeps/unix/sysv/linux/i386/Makefile
+++ b/sysdeps/unix/sysv/linux/i386/Makefile
@@ -1,21 +1,26 @@
# The default ABI is 32.
default-abi := 32
+# %ebp is used to pass the 6th argument to system calls, so these
+# system calls are incompatible with a frame pointer.
+uses-6-syscall-arguments = -fomit-frame-pointer
+
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
+CFLAGS-epoll_pwait.o += $(uses-6-syscall-arguments)
+CFLAGS-epoll_pwait.os += $(uses-6-syscall-arguments)
+CFLAGS-mmap.o += $(uses-6-syscall-arguments)
+CFLAGS-mmap.os += $(uses-6-syscall-arguments)
+CFLAGS-mmap64.o += $(uses-6-syscall-arguments)
+CFLAGS-mmap64.os += $(uses-6-syscall-arguments)
+CFLAGS-pselect.o += $(uses-6-syscall-arguments)
+CFLAGS-pselect.os += $(uses-6-syscall-arguments)
+CFLAGS-rtld-mmap.os += $(uses-6-syscall-arguments)
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
+CFLAGS-semtimedop.o += $(uses-6-syscall-arguments)
+CFLAGS-semtimedop.os += $(uses-6-syscall-arguments)
endif
ifeq ($(subdir),elf)
@@ -23,12 +28,22 @@ sysdep-others += lddlibc4
install-bin += lddlibc4
endif
-# fallocate, posix_fallocate use six-argument inline syscalls.
ifeq ($(subdir),io)
sysdep_routines += libc-do-syscall
+CFLAGS-posix_fadvise64.o += $(uses-6-syscall-arguments)
+CFLAGS-posix_fadvise64.os += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate.o += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate.os += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate64.o += $(uses-6-syscall-arguments)
+CFLAGS-posix_fallocate64.os += $(uses-6-syscall-arguments)
+CFLAGS-sync_file_range.o += $(uses-6-syscall-arguments)
+CFLAGS-sync_file_range.os += $(uses-6-syscall-arguments)
+CFLAGS-fallocate.o += $(uses-6-syscall-arguments)
+CFLAGS-fallocate.os += $(uses-6-syscall-arguments)
+CFLAGS-fallocate64.o += $(uses-6-syscall-arguments)
+CFLAGS-fallocate64.os += $(uses-6-syscall-arguments)
endif
-# libpthread uses six-argument inline syscalls.
ifeq ($(subdir),nptl)
libpthread-sysdep_routines += libc-do-syscall
libpthread-shared-only-routines += libc-do-syscall
@@ -50,6 +65,14 @@ ifeq ($(subdir),nptl)
# pull in __syscall_error routine
libpthread-routines += sysdep
libpthread-shared-only-routines += sysdep
+CFLAGS-pthread_rwlock_timedrdlock.o += $(uses-6-syscall-arguments)
+CFLAGS-pthread_rwlock_timedrdlock.os += $(uses-6-syscall-arguments)
+CFLAGS-pthread_rwlock_timedwrlock.o += $(uses-6-syscall-arguments)
+CFLAGS-pthread_rwlock_timedwrlock.os += $(uses-6-syscall-arguments)
+CFLAGS-sem_wait.o += $(uses-6-syscall-arguments)
+CFLAGS-sem_wait.os += $(uses-6-syscall-arguments)
+CFLAGS-sem_timedwait.o += $(uses-6-syscall-arguments)
+CFLAGS-sem_timedwait.os += $(uses-6-syscall-arguments)
endif
ifeq ($(subdir),rt)
next reply other threads:[~2016-10-28 15:05 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-28 15:05 Florian Weimer [this message]
2016-10-28 15:08 ` Carlos O'Donell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161028150542.A781D439942E0@oldenburg.str.redhat.com \
--to=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).