glibc/config.h.in
Adhemerval Zanella 3b33d6ed60 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.
2017-02-17 18:06:29 -02:00

267 lines
7.6 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#if !defined IS_IN_build && !defined __ASSEMBLER__ && !defined _ISOMAC \
&& !defined __OPTIMIZE__
# error "glibc cannot be compiled without optimization"
#endif
/* Another evil option when it comes to compiling the C library is
--ffast-math since it alters the ABI. */
#if defined __FAST_MATH__ && !defined TEST_FAST_MATH
# error "glibc must not be compiled with -ffast-math"
#endif
/* Define if building with SELinux support. Set by --with-selinux. */
#undef HAVE_SELINUX
/* Defined if building with SELinux support & audit libs are detected. */
#undef HAVE_LIBAUDIT
/* Defined if building with SELinux support & libcap libs are detected. */
#undef HAVE_LIBCAP
/* Define to the assembler line separator character for multiple
assembler instructions per line. Default is `;' */
#undef ASM_LINE_SEP
/* Define if __attribute__((section("foo"))) puts quotes around foo. */
#undef HAVE_SECTION_QUOTES
/* Define if the assembler supports the `.set' directive. */
#undef HAVE_ASM_SET_DIRECTIVE
/* On powerpc64, use overlapping .opd entries. */
#undef USE_PPC64_OVERLAPPING_OPD
/* Define if _Unwind_Find_FDE should be exported from glibc. */
#undef EXPORT_UNWIND_FIND_FDE
/* Define if static NSS modules are wanted. */
#undef DO_STATIC_NSS
/* Assume that the compiler supports __builtin_expect.
This macro is necessary for proper compilation of code
shared between GNU libc and GNU gettext projects. */
#define HAVE_BUILTIN_EXPECT 1
/* Define if the compiler supports __builtin_memset. */
#undef HAVE_BUILTIN_MEMSET
/* Define if compiler accepts -ftree-loop-distribute-patterns. */
#undef HAVE_CC_INHIBIT_LOOP_TO_LIBCALL
/* Define if compiler accepts -fno-stack-protector in an
__attribute__ ((__optimize__)). */
#undef HAVE_CC_NO_STACK_PROTECTOR
/* The level of stack protection in use for glibc as a whole.
May be overridden on a file-by-file basis. */
#ifndef STACK_PROTECTOR_LEVEL
#undef STACK_PROTECTOR_LEVEL
#endif
/* Define if the regparm attribute shall be used for local functions
(gcc on ix86 only). */
#undef USE_REGPARMS
/* Defined on SPARC if GCC emits GOTDATA relocations. */
#undef HAVE_GCC_GOTDATA
/* Define on SPARC if AS supports VIS3 instructions. */
#undef HAVE_AS_VIS3_SUPPORT
/* Define if the linker supports the -z combreloc option. */
#undef HAVE_Z_COMBRELOC
/* Define if _rtld_local structure should be forced into .sdata section. */
#undef HAVE_SDATA_SECTION
/* Define if compiler supports AVX512. */
#undef HAVE_AVX512_SUPPORT
/* Define if assembler supports AVX512DQ. */
#undef HAVE_AVX512DQ_ASM_SUPPORT
/* Define if assembler supports z196 zarch instructions as default on S390. */
#undef HAVE_S390_MIN_Z196_ZARCH_ASM_SUPPORT
/* Define if assembler supports vector instructions on S390. */
#undef HAVE_S390_VX_ASM_SUPPORT
/* Define if gcc supports vector registers as clobbers in inline assembly
on S390. */
#undef HAVE_S390_VX_GCC_SUPPORT
/* Define if assembler supports Intel MPX. */
#undef HAVE_MPX_SUPPORT
/* Define if the compiler\'s exception support is based on libunwind. */
#undef HAVE_CC_WITH_LIBUNWIND
/* Define if the access to static and hidden variables is position independent
and does not need relocations. */
#undef PI_STATIC_AND_HIDDEN
/* Define this to disable the 'hidden_proto' et al macros in
include/libc-symbols.h that avoid PLT slots in the shared objects. */
#undef NO_HIDDEN
/* Define this to disable lazy relocations in DSOs. */
#undef BIND_NOW
/* AArch64 big endian ABI */
#undef HAVE_AARCH64_BE
/* Defined to some form of __attribute__ ((...)) if the compiler supports
a different, more efficient calling convention. */
#if defined USE_REGPARMS && !defined PROF
# define internal_function __attribute__ ((regparm (3), stdcall))
#endif
/* Linux specific: minimum supported kernel version. */
#undef __LINUX_KERNEL_VERSION
/* Override abi-tags ABI version if necessary. */
#undef __ABI_TAG_VERSION
/* bash 2.0 introduced the _XXX_GNU_nonoption_argv_flags_ variable to help
getopt determine whether a parameter is a flag or not. This features
was disabled later since it caused trouble. We are by default therefore
disabling the support as well. */
#undef USE_NONOPTION_FLAGS
/* Mach/Hurd specific: define if mig supports the `retcode' keyword. */
#undef HAVE_MIG_RETCODE
/* Mach specific: define if the `host_page_size' RPC is available. */
#undef HAVE_HOST_PAGE_SIZE
/* Mach/i386 specific: define if the `i386_io_perm_*' RPCs are available. */
#undef HAVE_I386_IO_PERM_MODIFY
/* Mach/i386 specific: define if the `i386_set_gdt' RPC is available. */
#undef HAVE_I386_SET_GDT
/* Defined of libidn is available. */
#undef HAVE_LIBIDN
/* Define if inlined system calls are available. */
#undef HAVE_INLINED_SYSCALLS
/* Define if your compiler defaults to -msecure-plt mode on ppc. */
#undef HAVE_PPC_SECURE_PLT
/* Define if __stack_chk_guard canary should be randomized at program startup. */
#undef ENABLE_STACKGUARD_RANDOMIZE
/* Define if lock elision should be enabled by default. */
#undef ENABLE_LOCK_ELISION
/* Package description. */
#undef PKGVERSION
/* Bug reporting address. */
#undef REPORT_BUGS_TO
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
/* Define if `.ctors' and `.dtors' sections shouldn't be used. */
#undef NO_CTORS_DTORS_SECTIONS
/* Define if obsolete RPC code should be made available for user-level code
to link against. */
#undef LINK_OBSOLETE_RPC
/* Define if Systemtap <sys/sdt.h> probes should be defined. */
#undef USE_STAP_PROBE
/* Define if library functions should try to contact the nscd daemon. */
#undef USE_NSCD
/* Define if the dynamic linker should consult an ld.so.cache file. */
#undef USE_LDCONFIG
/* Define to 1 if STT_GNU_IFUNC support actually works. */
#define HAVE_IFUNC 0
/* Define if gcc supports attribute ifunc. */
#undef HAVE_GCC_IFUNC
/* Define if the linker defines __ehdr_start. */
#undef HAVE_EHDR_START
/*
*/
#ifndef _LIBC
/* These symbols might be defined by some sysdeps configures.
They are used only in miscellaneous generator programs, not
in compiling libc itself. */
/* sysdeps/generic/configure.ac */
#undef HAVE_PSIGNAL
/* sysdeps/unix/configure.ac */
#undef HAVE_STRERROR
/* sysdeps/unix/common/configure.ac */
#undef HAVE_SYS_SIGLIST
#undef HAVE__SYS_SIGLIST
#undef HAVE__CTYPE_
#undef HAVE___CTYPE_
#undef HAVE___CTYPE
#undef HAVE__CTYPE__
#undef HAVE__CTYPE
#undef HAVE__LOCP
#endif
/*
*/
#ifdef _LIBC
/* The zic and zdump programs need these definitions. */
#define HAVE_STRERROR 1
/* The locale code needs these definitions. */
#define HAVE_REGEX 1
/* The ARM hard-float ABI is being used. */
#undef HAVE_ARM_PCS_VFP
/* The ARM movw/movt instructions using PC-relative relocs work right. */
#define ARM_PCREL_MOVW_OK 0
/* The pt_chown binary is being built and used by grantpt. */
#define HAVE_PT_CHOWN 0
/* Define if the compiler supports __builtin_trap without
any external dependencies such as making a function call. */
#define HAVE_BUILTIN_TRAP 0
/* ports/sysdeps/mips/configure.in */
/* Define if using the IEEE 754-2008 NaN encoding on the MIPS target. */
#undef HAVE_MIPS_NAN2008
/* The PowerPC64 ELFv2 ABI is being used. */
#undef HAVE_ELFV2_ABI
/* PowerPC32 uses fcfid for integer to floating point conversions. */
#define HAVE_PPC_FCFID 0
/* PowerPC32 uses fctidz for floating point to long long conversions. */
#define HAVE_PPC_FCTIDZ 0
/* Build glibc with tunables support. */
#define HAVE_TUNABLES 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