9c21573c02
It has been a long practice for software using IEEE 754 floating-point arithmetic run on MIPS processors to use an encoding of Not-a-Number (NaN) data different to one used by software run on other processors. And as of IEEE 754-2008 revision [1] this encoding does not follow one recommended in the standard, as specified in section 6.2.1, where it is stated that quiet NaNs should have the first bit (d1) of their significand set to 1 while signalling NaNs should have that bit set to 0, but MIPS software interprets the two bits in the opposite manner. As from revision 3.50 [2][3] the MIPS Architecture provides for processors that support the IEEE 754-2008 preferred NaN encoding format. As the two formats (further referred to as "legacy NaN" and "2008 NaN") are incompatible to each other, tools have to provide support for the two formats to help people avoid using incompatible binary modules. The change is comprised of two functional groups of features, both of which are required for correct support. 1. Dynamic linker support. To enforce the NaN encoding requirement in dynamic linking a new ELF file header flag has been defined. This flag is set for 2008-NaN shared modules and executables and clear for legacy-NaN ones. The dynamic linker silently ignores any incompatible modules it encounters in dependency processing. To avoid unnecessary processing of incompatible modules in the presence of a shared module cache, a set of new cache flags has been defined to mark 2008-NaN modules for the three ABIs supported. Changes to sysdeps/unix/sysv/linux/mips/readelflib.c have been made following an earlier code quality suggestion made here: http://sourceware.org/ml/libc-ports/2009-03/msg00036.html and are therefore a little bit more extensive than the minimum required. Finally a new name has been defined for the dynamic linker so that 2008-NaN and legacy-NaN binaries can coexist on a single system that supports dual-mode operation and that a legacy dynamic linker that does not support verifying the 2008-NaN ELF file header flag is not chosen to interpret a 2008-NaN binary by accident. 2. Floating environment support. IEEE 754-2008 features are controlled in the Floating-Point Control and Status (FCSR) register and updates are needed to floating environment support so that the 2008-NaN flag is set correctly and the kernel default, inferred from the 2008-NaN ELF file header flag at the time an executable is loaded, respected. As the NaN encoding format is a property of GCC code generation that is both a user-selected GCC configuration default and can be overridden with GCC options, code that needs to know what NaN encoding standard it has been configured for checks for the __mips_nan2008 macro that is defined internally by GCC whenever the 2008-NaN mode has been selected. This mode is determined at the glibc configuration time and therefore a few consistency checks have been added to catch cases where compilation flags have been overridden by the user. The 2008 NaN set of features relies on kernel support as the in-kernel floating-point emulator needs to be aware of the NaN encoding used even on hard-float processors and configure the FPU context according to the value of the 2008 NaN ELF file header flag of the executable being started. As at this time work on kernel support is still in progress and the relevant changes have not made their way yet to linux.org master repository. Therefore the minimum version supported has been artificially set to 10.0.0 so that 2008-NaN code is not accidentally run on a Linux kernel that does not suppport it. It is anticipated that the version is adjusted later on to the actual initial linux.org kernel version to support this feature. Legacy NaN encoding support is unaffected, older kernel versions remain supported. [1] "IEEE Standard for Floating-Point Arithmetic", IEEE Computer Society, IEEE Std 754-2008, 29 August 2008 [2] "MIPS Architecture For Programmers, Volume I-A: Introduction to the MIPS32 Architecture", MIPS Technologies, Inc., Document Number: MD00082, Revision 3.50, September 20, 2012 [3] "MIPS Architecture For Programmers, Volume I-A: Introduction to the MIPS64 Architecture", MIPS Technologies, Inc., Document Number: MD00083, Revision 3.50, September 20, 2012
246 lines
6.9 KiB
C
246 lines
6.9 KiB
C
#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 if weak symbols are available via the `.weak' directive. */
|
||
#undef HAVE_ASM_WEAK_DIRECTIVE
|
||
|
||
/* Define if weak symbols are available via the `.weakext' directive. */
|
||
#undef HAVE_ASM_WEAKEXT_DIRECTIVE
|
||
|
||
/* Define if CFI directives are available. */
|
||
#undef HAVE_ASM_CFI_DIRECTIVES
|
||
|
||
/* 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
|
||
|
||
/* Define if the assembler supports the gnu_unique_object symbol type. */
|
||
#undef HAVE_ASM_UNIQUE_OBJECT
|
||
|
||
/* Define a symbol_name as a global .symbol_name for ld. */
|
||
#undef HAVE_ASM_GLOBAL_DOT_NAME
|
||
|
||
/* 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 using ELF and the assembler supports the `.previous'
|
||
directive. */
|
||
#undef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||
|
||
/* Define if using ELF and the assembler supports the `.popsection'
|
||
directive. */
|
||
#undef HAVE_ASM_POPSECTION_DIRECTIVE
|
||
|
||
/* Defined to the oldest ABI we support, like 2.1. */
|
||
#undef GLIBC_OLDEST_ABI
|
||
|
||
/* Define if static NSS modules are wanted. */
|
||
#undef DO_STATIC_NSS
|
||
|
||
/* 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 the regparm attribute shall be used for local functions
|
||
(gcc on ix86 only). */
|
||
#undef USE_REGPARMS
|
||
|
||
/* Defined on PowerPC if the GCC being used has a problem with clobbering
|
||
certain registers (CR0, MQ, CTR, LR) in asm statements. */
|
||
#undef BROKEN_PPC_ASM_CR0
|
||
|
||
/* 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 gcc supports SSE4. */
|
||
#undef HAVE_SSE4_SUPPORT
|
||
|
||
/* Define if gcc supports AVX. */
|
||
#undef HAVE_AVX_SUPPORT
|
||
|
||
/* Define if gcc supports VEX encoding. */
|
||
#undef HAVE_SSE2AVX_SUPPORT
|
||
|
||
/* Define if gcc supports FMA4. */
|
||
#undef HAVE_FMA4_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
|
||
|
||
|
||
/* 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 if forced unwind support is available. */
|
||
#undef HAVE_FORCED_UNWIND
|
||
|
||
/* Defined of libidn is available. */
|
||
#undef HAVE_LIBIDN
|
||
|
||
/* Define if inlined system calls are available. */
|
||
#undef HAVE_INLINED_SYSCALLS
|
||
|
||
/* Define if your assembler and linker support R_PPC_REL16* relocs. */
|
||
#undef HAVE_ASM_PPC_REL16
|
||
|
||
/* 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 if STT_GNU_IFUNC support actually works. */
|
||
#undef HAVE_IFUNC
|
||
|
||
/*
|
||
*/
|
||
|
||
#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.in */
|
||
#undef HAVE_PSIGNAL
|
||
|
||
/* sysdeps/unix/configure.in */
|
||
#undef HAVE_STRERROR
|
||
|
||
/* sysdeps/unix/common/configure.in */
|
||
#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 pt_chown binary is being built and used by grantpt. */
|
||
#undef HAVE_PT_CHOWN
|
||
|
||
/* ports/sysdeps/mips/configure.in */
|
||
/* Define if using the IEEE 754-2008 NaN encoding on the MIPS target. */
|
||
#undef HAVE_MIPS_NAN2008
|
||
|
||
#endif
|