Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 593784 | Differences between
and this patch

Collapse All | Expand All

(-)a/ChangeLog (+49 lines)
Lines 1-3 Link Here
1
2017-01-17  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2
3
	[BZ #21029]
4
	* config.h.in [CAN_USE_REGISTER_ASM_EBP]: New define.
5
	* sysdeps/unix/sysv/linux/i386/Makefile
6
	[$(subdir) = elf] (sysdep-dl-routines): Add libc-do-syscall.
7
	(uses-6-syscall-arguments): Remove.
8
	[$(subdir) = misc] (CFLAGS-epoll_pwait.o): Likewise.
9
	[$(subdir) = misc] (CFLAGS-epoll_pwait.os): Likewise.
10
	[$(subdir) = misc] (CFLAGS-mmap.o): Likewise.
11
	[$(subdir) = misc] (CFLAGS-mmap.os): Likewise.
12
	[$(subdir) = misc] (CFLAGS-mmap64.o): Likewise.
13
	[$(subdir) = misc] (CFLAGS-mmap64.os): Likewise.
14
	[$(subdir) = misc] (CFLAGS-pselect.o): Likewise.
15
	[$(subdir) = misc] (cflags-pselect.o): Likewise.
16
	[$(subdir) = misc] (cflags-pselect.os): Likewise.
17
	[$(subdir) = misc] (cflags-rtld-mmap.os): Likewise.
18
	[$(subdir) = sysvipc] (cflags-semtimedop.o): Likewise.
19
	[$(subdir) = sysvipc] (cflags-semtimedop.os): Likewise.
20
	[$(subdir) = io] (CFLAGS-posix_fadvise64.o): Likewise.
21
	[$(subdir) = io] (CFLAGS-posix_fadvise64.os): Likewise.
22
	[$(subdir) = io] (CFLAGS-posix_fallocate.o): Likewise.
23
	[$(subdir) = io] (CFLAGS-posix_fallocate.os): Likewise.
24
	[$(subdir) = io] (CFLAGS-posix_fallocate64.o): Likewise.
25
	[$(subdir) = io] (CFLAGS-posix_fallocate64.os): Likewise.
26
	[$(subdir) = io] (CFLAGS-sync_file_range.o): Likewise.
27
	[$(subdir) = io] (CFLAGS-sync_file_range.os): Likewise.
28
	[$(subdir) = io] (CFLAGS-fallocate.o): Likewise.
29
	[$(subdir) = io] (CFLAGS-fallocate.os): Likewise.
30
	[$(subdir) = io] (CFLAGS-fallocate64.o): Likewise.
31
	[$(subdir) = io] (CFLAGS-fallocate64.os): Likewise.
32
	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrdlock.o):
33
	Likewise.
34
	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrdlock.os):
35
	Likewise.
36
	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrwlock.o):
37
	Likewise.
38
	[$(subdir) = nptl] (CFLAGS-pthread_rwlock_timedrwlock.os):
39
	Likewise.
40
	[$(subdir) = nptl] (CFLAGS-sem_wait.o): Likewise.
41
	[$(subdir) = nptl] (CFLAGS-sem_wait.os): Likewise.
42
	[$(subdir) = nptl] (CFLAGS-sem_timedwait.o): Likewise.
43
	[$(subdir) = nptl] (CFLAGS-sem_timedwait.os): Likewise.
44
	* sysdeps/unix/sysv/linux/i386/configure.ac: Add check if compiler allows
45
	ebp on inline assembly.
46
	* sysdeps/unix/sysv/linux/i386/configure: Regenerate.
47
	* sysdeps/unix/sysv/linux/i386/sysdep.h (OPTIMIZE_FOR_GCC_5):
48
	Set if CAN_USE_REGISTER_ASM_EBP is set.
49
1
2017-02-17  H.J. Lu  <hongjiu.lu@intel.com>
50
2017-02-17  H.J. Lu  <hongjiu.lu@intel.com>
2
51
3
	* sysdeps/x86/cpu-features.c (init_cpu_features): Use
52
	* sysdeps/x86/cpu-features.c (init_cpu_features): Use
(-)a/config.h.in (+4 lines)
Lines 259-262 Link Here
259
/* Build glibc with tunables support.  */
259
/* Build glibc with tunables support.  */
260
#define HAVE_TUNABLES 0
260
#define HAVE_TUNABLES 0
261
261
262
/* Some compiler options may now allow to use ebp in __asm__ (used mainly
263
   in i386 6 argument syscall issue).  */
264
#define CAN_USE_REGISTER_ASM_EBP 0
265
262
#endif
266
#endif
(-)a/sysdeps/unix/sysv/linux/i386/Makefile (-38 / +1 lines)
Lines 1-47 Link Here
1
# The default ABI is 32.
1
# The default ABI is 32.
2
default-abi := 32
2
default-abi := 32
3
3
4
# %ebp is used to pass the 6th argument to system calls, so these
5
# system calls are incompatible with a frame pointer.
6
uses-6-syscall-arguments = -fomit-frame-pointer
7
8
ifeq ($(subdir),misc)
4
ifeq ($(subdir),misc)
9
sysdep_routines += ioperm iopl vm86
5
sysdep_routines += ioperm iopl vm86
10
CFLAGS-epoll_pwait.o += $(uses-6-syscall-arguments)
11
CFLAGS-epoll_pwait.os += $(uses-6-syscall-arguments)
12
CFLAGS-mmap.o += $(uses-6-syscall-arguments)
13
CFLAGS-mmap.os += $(uses-6-syscall-arguments)
14
CFLAGS-mmap64.o += $(uses-6-syscall-arguments)
15
CFLAGS-mmap64.os += $(uses-6-syscall-arguments)
16
CFLAGS-pselect.o += $(uses-6-syscall-arguments)
17
CFLAGS-pselect.os += $(uses-6-syscall-arguments)
18
CFLAGS-rtld-mmap.os += $(uses-6-syscall-arguments)
19
endif
20
21
ifeq ($(subdir),sysvipc)
22
CFLAGS-semtimedop.o += $(uses-6-syscall-arguments)
23
CFLAGS-semtimedop.os += $(uses-6-syscall-arguments)
24
endif
6
endif
25
7
26
ifeq ($(subdir),elf)
8
ifeq ($(subdir),elf)
9
sysdep-dl-routines += libc-do-syscall
27
sysdep-others += lddlibc4
10
sysdep-others += lddlibc4
28
install-bin += lddlibc4
11
install-bin += lddlibc4
29
endif
12
endif
30
13
31
ifeq ($(subdir),io)
14
ifeq ($(subdir),io)
32
sysdep_routines += libc-do-syscall
15
sysdep_routines += libc-do-syscall
33
CFLAGS-posix_fadvise64.o += $(uses-6-syscall-arguments)
34
CFLAGS-posix_fadvise64.os += $(uses-6-syscall-arguments)
35
CFLAGS-posix_fallocate.o += $(uses-6-syscall-arguments)
36
CFLAGS-posix_fallocate.os += $(uses-6-syscall-arguments)
37
CFLAGS-posix_fallocate64.o += $(uses-6-syscall-arguments)
38
CFLAGS-posix_fallocate64.os += $(uses-6-syscall-arguments)
39
CFLAGS-sync_file_range.o += $(uses-6-syscall-arguments)
40
CFLAGS-sync_file_range.os += $(uses-6-syscall-arguments)
41
CFLAGS-fallocate.o += $(uses-6-syscall-arguments)
42
CFLAGS-fallocate.os += $(uses-6-syscall-arguments)
43
CFLAGS-fallocate64.o += $(uses-6-syscall-arguments)
44
CFLAGS-fallocate64.os += $(uses-6-syscall-arguments)
45
endif
16
endif
46
17
47
ifeq ($(subdir),nptl)
18
ifeq ($(subdir),nptl)
Lines 61-74 ifeq ($(subdir),nptl) Link Here
61
# pull in __syscall_error routine
32
# pull in __syscall_error routine
62
libpthread-routines += sysdep
33
libpthread-routines += sysdep
63
libpthread-shared-only-routines += sysdep
34
libpthread-shared-only-routines += sysdep
64
CFLAGS-pthread_rwlock_timedrdlock.o += $(uses-6-syscall-arguments)
65
CFLAGS-pthread_rwlock_timedrdlock.os += $(uses-6-syscall-arguments)
66
CFLAGS-pthread_rwlock_timedwrlock.o += $(uses-6-syscall-arguments)
67
CFLAGS-pthread_rwlock_timedwrlock.os += $(uses-6-syscall-arguments)
68
CFLAGS-sem_wait.o += $(uses-6-syscall-arguments)
69
CFLAGS-sem_wait.os += $(uses-6-syscall-arguments)
70
CFLAGS-sem_timedwait.o += $(uses-6-syscall-arguments)
71
CFLAGS-sem_timedwait.os += $(uses-6-syscall-arguments)
72
endif
35
endif
73
36
74
ifeq ($(subdir),rt)
37
ifeq ($(subdir),rt)
(-)a/sysdeps/unix/sysv/linux/i386/configure (+39 lines)
Lines 3-7 Link Here
3
3
4
arch_minimum_kernel=2.6.32
4
arch_minimum_kernel=2.6.32
5
5
6
# Check if CFLAGS allows compiler to use ebp register in inline assembly.
7
8
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler flags allows ebp in inline assembly" >&5
9
$as_echo_n "checking if compiler flags allows ebp in inline assembly... " >&6; }
10
if ${libc_cv_can_use_register_asm_ebp+:} false; then :
11
  $as_echo_n "(cached) " >&6
12
else
13
14
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
15
/* end confdefs.h.  */
16
17
    void foo (int i)
18
    {
19
      register int reg asm ("ebp") = i;
20
      asm ("# %0" : : "r" (reg));
21
    }
22
int
23
main ()
24
{
25
26
  ;
27
  return 0;
28
}
29
_ACEOF
30
if ac_fn_c_try_compile "$LINENO"; then :
31
  libc_cv_can_use_register_asm_ebp=yes
32
else
33
  libc_cv_can_use_register_asm_ebp=no
34
fi
35
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
36
37
fi
38
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_can_use_register_asm_ebp" >&5
39
$as_echo "$libc_cv_can_use_register_asm_ebp" >&6; }
40
if test $libc_cv_can_use_register_asm_ebp = yes; then
41
  $as_echo "#define CAN_USE_REGISTER_ASM_EBP 1" >>confdefs.h
42
43
fi
44
6
libc_cv_gcc_unwind_find_fde=yes
45
libc_cv_gcc_unwind_find_fde=yes
7
ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
46
ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
(-)a/sysdeps/unix/sysv/linux/i386/configure.ac (+17 lines)
Lines 3-7 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. Link Here
3
3
4
arch_minimum_kernel=2.6.32
4
arch_minimum_kernel=2.6.32
5
5
6
# Check if CFLAGS allows compiler to use ebp register in inline assembly.
7
AC_CACHE_CHECK([if compiler flags allows ebp in inline assembly],
8
                libc_cv_can_use_register_asm_ebp, [
9
AC_COMPILE_IFELSE(
10
  [AC_LANG_PROGRAM([
11
    void foo (int i)
12
    {
13
      register int reg asm ("ebp") = i;
14
      asm ("# %0" : : "r" (reg));
15
    }])],
16
  [libc_cv_can_use_register_asm_ebp=yes],
17
  [libc_cv_can_use_register_asm_ebp=no])
18
])
19
if test $libc_cv_can_use_register_asm_ebp = yes; then
20
  AC_DEFINE(CAN_USE_REGISTER_ASM_EBP)
21
fi
22
6
libc_cv_gcc_unwind_find_fde=yes
23
libc_cv_gcc_unwind_find_fde=yes
7
ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
24
ldd_rewrite_script=sysdeps/unix/sysv/linux/ldd-rewrite.sed
(-)a/sysdeps/unix/sysv/linux/i386/sysdep.h (-4 / +3 lines)
Lines 44-52 Link Here
44
/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
44
/* Since GCC 5 and above can properly spill %ebx with PIC when needed,
45
   we can inline syscalls with 6 arguments if GCC 5 or above is used
45
   we can inline syscalls with 6 arguments if GCC 5 or above is used
46
   to compile glibc.  Disable GCC 5 optimization when compiling for
46
   to compile glibc.  Disable GCC 5 optimization when compiling for
47
   profiling since asm ("ebp") can't be used to put the 6th argument
47
   profiling or when -fno-omit-frame-pointer is used since asm ("ebp")
48
   in %ebp for syscall.  */
48
   can't be used to put the 6th argument in %ebp for syscall.  */
49
#if __GNUC_PREREQ (5,0) && !defined PROF
49
#if __GNUC_PREREQ (5,0) && !defined PROF && CAN_USE_REGISTER_ASM_EBP
50
# define OPTIMIZE_FOR_GCC_5
50
# define OPTIMIZE_FOR_GCC_5
51
#endif
51
#endif
52
52
53
- 

Return to bug 593784