diff options
author | Matthew Fortune <matthew.fortune@imgtec.com> | 2014-06-01 00:16:25 +0100 |
---|---|---|
committer | Matthew Fortune <matthew.fortune@imgtec.com> | 2014-12-31 21:09:21 +0000 |
commit | 0bd956720c457ff054325b48f26ac7c91cb060e8 (patch) | |
tree | 403b4652711dbce685ca37ab835653bee15f93b3 /sysdeps/unix | |
parent | f59ad976ed979d22637c5187f6a92fbbd8c191e4 (diff) | |
download | glibc-0bd956720c457ff054325b48f26ac7c91cb060e8.tar.gz glibc-0bd956720c457ff054325b48f26ac7c91cb060e8.tar.xz glibc-0bd956720c457ff054325b48f26ac7c91cb060e8.zip |
Add support for MIPS O32 FPXX and .MIPS.abiflags
* elf/elf.h (PT_MIPS_ABIFLAGS): Define. (Elf_MIPS_ABIFlags_v0): New structure. (EF_MIPS_FP64): Define. (MIPS_AFL_REG_NONE, MIPS_AFL_REG_32, MIPS_AFL_REG_64): Likewise. (MIPS_AFL_REG_128, MIPS_AFL_ASE_DSP, MIPS_AFL_ASE_DSP64): Likewise. (MIPS_AFL_ASE_DSPR2, MIPS_AFL_ASE_EVA, MIPS_AFL_ASE_MCU): Likewise. (MIPS_AFL_ASE_MDMX, MIPS_AFL_ASE_MIPS3D, MIPS_AFL_ASE_MT): Likewise. (MIPS_AFL_ASE_SMARTMIPS, MIPS_AFL_ASE_VIRT): Likewise. (MIPS_AFL_ASE_VIRT64, MIPS_AFL_ASE_MSA, MIPS_AFL_ASE_MSA64): Likewise. (MIPS_AFL_ASE_MIPS16, MIPS_AFL_ASE_MICROMIPS): Likewise. (MIPS_AFL_ASE_XPA, MIPS_AFL_EXT_XLR, MIPS_AFL_EXT_OCTEON2): Likewise. (MIPS_AFL_EXT_OCTEONP, MIPS_AFL_EXT_LOONGSON_3A): Likewise. (MIPS_AFL_EXT_OCTEON, MIPS_AFL_EXT_5900, MIPS_AFL_EXT_4010): Likewise. (MIPS_AFL_EXT_4100, MIPS_AFL_EXT_3900, MIPS_AFL_EXT_10000): Likewise. (MIPS_AFL_EXT_SB1, MIPS_AFL_EXT_4111, MIPS_AFL_EXT_4120): Likewise. (MIPS_AFL_EXT_5400, MIPS_AFL_EXT_5500): Likewise. (MIPS_AFL_EXT_LOONGSON_2E, MIPS_AFL_EXT_LOONGSON_2F): Likewise. (Val_GNU_MIPS_ABI_FP_ANY, Val_GNU_MIPS_ABI_FP_DOUBLE): New enum values. (Val_GNU_MIPS_ABI_FP_SINGLE, Val_GNU_MIPS_ABI_FP_SOFT): Likewise. (Val_GNU_MIPS_ABI_FP_OLD_64, Val_GNU_MIPS_ABI_FP_XX): Likewise. (Val_GNU_MIPS_ABI_FP_64, Val_GNU_MIPS_ABI_FP_64A): Likewise. (Val_GNU_MIPS_ABI_FP_MAX): Likewise. * sysdeps/mips/Makefile [subdir=elf]: Add tst-abi-interlink, tst-mode-switch-1, tst-mode-switch-2, tst-mode-switch-3 tests. * sysdeps/mips/bits/linkmap.h (struct link_map_machine): Add fpmode field. * sysdeps/mips/dl-machine.h (elf_machine_matches_host): Reject EF_MIPS_FP64. * sysdeps/mips/dl-machine-reject-phdr.h: New file. * sysdeps/mips/tst-abi-fp32mod.c: Likewise. * sysdeps/mips/tst-abi-fpxxmod.c: Likewise. * sysdeps/mips/tst-abi-fpxxomod.c: Likewise. * sysdeps/mips/tst-abi-fp64mod.c: Likewise. * sysdeps/mips/tst-abi-fp64amod.c: Likewise. * sysdeps/mips/tst-abi-interlink.c: Likewise. * sysdeps/mips/tst-mode-switch-1.c: Likewise. * sysdeps/mips/tst-mode-switch-2.c: Likewise. * sysdeps/mips/tst-mode-switch-3.c: Likewise. * sysdeps/unix/sysv/linux/mips/configure.ac (o32-fpabi): Define to record the current FP ABI extension. (mips-mode-switch): Define to show if kernel headers support mode switching. * sysdeps/unix/sysv/linux/mips/configure: Regenerate. * sysdeps/unix/sysv/linux/mips/ldsodefs.h: Increase maximum supported SYSV ABI version to 3. * sysdeps/unix/sysv/linux/mips/libc-abis: Add new MIPS_O32_FP64 feature.
Diffstat (limited to 'sysdeps/unix')
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/configure | 142 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/configure.ac | 53 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/ldsodefs.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mips/libc-abis | 3 |
4 files changed, 199 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/configure b/sysdeps/unix/sysv/linux/mips/configure index 6db1f80a4f..83f8b13aab 100644 --- a/sysdeps/unix/sysv/linux/mips/configure +++ b/sysdeps/unix/sysv/linux/mips/configure @@ -105,6 +105,148 @@ if test -z "$libc_mips_float"; then as_fn_error $? "could not determine if compiler is using hard or soft floating point ABI" "$LINENO" 5 fi +libc_mips_o32_fp= + +if test x"$libc_mips_abi" = xo32 -a x"$libc_mips_float" = xhard; then + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if !defined(__mips_fpr) + #error Missing FPR sizes + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if (__mips_fpr != 32) + #error Not FP32 + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_mips_o32_fp=32 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if (__mips_fpr != 0) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16) + #error Not FPXX (without odd single-precision registers) + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_mips_o32_fp=xx +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if (__mips_fpr != 0) + #error Not FPXX (with odd single precision registers) + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_mips_o32_fp=xxo +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if (__mips_fpr != 64) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16) + #error Not FP64A + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_mips_o32_fp=64a +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #if (__mips_fpr != 64) + #error Not FP64 + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_mips_o32_fp=64 +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +config_vars="$config_vars +o32-fpabi = ${libc_mips_o32_fp}" + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <linux/prctl.h> + #if !defined(PR_GET_FP_MODE) || !defined(PR_SET_FP_MODE) + #error New prctl support for setting FP modes not found + #endif +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libc_mips_mode_switch=yes +else + libc_mips_mode_switch=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +config_vars="$config_vars +mips-mode-switch = ${libc_mips_mode_switch}" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } diff --git a/sysdeps/unix/sysv/linux/mips/configure.ac b/sysdeps/unix/sysv/linux/mips/configure.ac index c3f217a34f..5039ec969f 100644 --- a/sysdeps/unix/sysv/linux/mips/configure.ac +++ b/sysdeps/unix/sysv/linux/mips/configure.ac @@ -44,6 +44,59 @@ if test -z "$libc_mips_float"; then AC_MSG_ERROR([could not determine if compiler is using hard or soft floating point ABI]) fi +libc_mips_o32_fp= + +if test x"$libc_mips_abi" = xo32 -a x"$libc_mips_float" = xhard; then + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #if !defined(__mips_fpr) + #error Missing FPR sizes + #endif])], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #if (__mips_fpr != 32) + #error Not FP32 + #endif])], + [libc_mips_o32_fp=32], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #if (__mips_fpr != 0) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16) + #error Not FPXX (without odd single-precision registers) + #endif])], + [libc_mips_o32_fp=xx], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #if (__mips_fpr != 0) + #error Not FPXX (with odd single precision registers) + #endif])], + [libc_mips_o32_fp=xxo], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #if (__mips_fpr != 64) || !defined(_MIPS_SPFPSET) || (_MIPS_SPFPSET != 16) + #error Not FP64A + #endif])], + [libc_mips_o32_fp=64a], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #if (__mips_fpr != 64) + #error Not FP64 + #endif])], + [libc_mips_o32_fp=64], + [])])])])])], + []) +fi +LIBC_CONFIG_VAR([o32-fpabi],[${libc_mips_o32_fp}]) + +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #include <linux/prctl.h> + #if !defined(PR_GET_FP_MODE) || !defined(PR_SET_FP_MODE) + #error New prctl support for setting FP modes not found + #endif])], + [libc_mips_mode_switch=yes], + [libc_mips_mode_switch=no]) +LIBC_CONFIG_VAR([mips-mode-switch],[${libc_mips_mode_switch}]) + AC_CACHE_CHECK([whether the compiler is using the 2008 NaN encoding], libc_cv_mips_nan2008, [AC_EGREP_CPP(yes, [dnl #ifdef __mips_nan2008 diff --git a/sysdeps/unix/sysv/linux/mips/ldsodefs.h b/sysdeps/unix/sysv/linux/mips/ldsodefs.h index d7c62f4b9c..70f8f16956 100644 --- a/sysdeps/unix/sysv/linux/mips/ldsodefs.h +++ b/sysdeps/unix/sysv/linux/mips/ldsodefs.h @@ -34,7 +34,7 @@ extern void _dl_static_init (struct link_map *map); #undef VALID_ELF_ABIVERSION #define VALID_ELF_ABIVERSION(osabi,ver) \ (ver == 0 \ - || (osabi == ELFOSABI_SYSV && ver < 2) \ + || (osabi == ELFOSABI_SYSV && ver < 4) \ || (osabi == ELFOSABI_GNU && ver < LIBC_ABI_MAX)) #endif /* ldsodefs.h */ diff --git a/sysdeps/unix/sysv/linux/mips/libc-abis b/sysdeps/unix/sysv/linux/mips/libc-abis index f180a03efd..14ff60322a 100644 --- a/sysdeps/unix/sysv/linux/mips/libc-abis +++ b/sysdeps/unix/sysv/linux/mips/libc-abis @@ -11,3 +11,6 @@ MIPS_PLT mips*-*-linux* # Unique symbol definitions for C++. # Architecture independent, all ELF targets (== all targets) UNIQUE +# +# MIPS O32 FP64 +MIPS_O32_FP64 mips*-*-linux* |