aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2017-07-03resolv: Mirror the entire resolver configuration in struct resolv_confFlorian Weimer
This commit adds the remaining unchanging members (which are loaded from /etc/resolv.conf) to struct resolv_conf. The extended name server list is currently not used by the stub resolver. The switch depends on a cleanup: The _u._ext.nssocks array stores just a single socket, and needs to be replaced with a single socket value. (The compatibility gethostname implementation does not use the extended addres sort list, either. Updating the compat code is not worthwhile.)
2017-07-03resolv: Lift domain search list limits [BZ #19569] [BZ #21475]Florian Weimer
This change uses the extended resolver state in struct resolv_conf to store the search list. If applications have not patched the _res object directly, this extended search list will be used by the stub resolver during name resolution.
2017-07-03resolv: Introduce struct resolv_conf with extended resolver stateFlorian Weimer
This change provides additional resolver configuration state which is not exposed through the _res ABI. It reuses the existing initstamp field in the supposedly-private part of _res. Some effort is undertaken to avoid memory safety issues introduced by applications which directly patch the _res object. With this commit, only the initstamp field is moved into struct resolv_conf. Additional members will be added later, eventually migrating the entire resolver configuration.
2017-07-03resolv: Introduce struct resolv_context [BZ #21668]Florian Weimer
struct resolv_context objects provide a temporary resolver context which does not change during a name lookup operation. Only when the outmost context is created, the stub resolver configuration is verified to be current (at present, only against previous res_init calls). Subsequent attempts to obtain the context will reuse the result of the initial verification operation. struct resolv_context can also be extended in the future to store data which needs to be deallocated during thread cancellation.
2017-07-03resolv: Add preinit tests to resolv/tst-resolv-res_init-skeleton.cFlorian Weimer
2017-07-03More fixes after the recent import from CLDR-31Rafal Luzynski
After the recent import of month names from CLDR (bug 21217) more imports are also needed, mostly abbreviated month names. * localedata/locales/br_FR (abmon): Reworded "Eve " to "Mezh". * localedata/locales/fy_NL (abmon): Reworded "Maa" (March) to "Mrt" and "Maa" (May) to "Mai". * localedata/locales/lg_UG (abmon): Reworded "Jun" to "Juu". * localedata/locales/ln_CD (abmon): "yan", "fbl", "msi", and so on. * localedata/locales/mn_MN (abmon): "1-р сар", "2-р сар", "3-р сар", and so on. * localedata/locales/vi_VN (abmon): Reworded "Th01" to "Thg 1", "Th02" to "Thg 2" and so on. * localedata/locales/yo_NG (abday): "Àìkú", "Ajé", "Ìsẹ́gun", and so on, also comment updated to match the new content. (day): "Ọjọ́ Àìkú", "Ọjọ́ Ajé", "Ọjọ́ Ìsẹ́gun", and so on. (abmon): "Ṣẹ́rẹ́", "Èrèlè", "Ẹrẹ̀nà", and so on. (mon): Comment updated to match the actual content. (d_t_fmt): Changed "%A" to "%a" and "%B" to "%b". * localedata/locales/zu_ZA (abmon): "Jan", "Feb", "Mas", and so on, also comment updated to match the new content. (mon): comment updated to match the actual content.
2017-07-03powerpc: Clean up strlen and strnlen for power8Rajalakshmi Srinivasaraghavan
To align a quadword aligned address to 64 bytes, maximum of three 16 bytes load is needed for worst case instead of loading four times.
2017-07-01Use __builtin_popcount in __sched_cpucount [BZ #21696]H.J. Lu
posix/sched_cpucount.c assumes that size of __cpu_mask == size of long, which is incorrect for x32. This patch uses __builtin_popcount, which is availabe in GCC 4.9, in posix/sched_cpucount.c. Tested on i686, x86-64 and x32 with multi-arch disabled. [BZ #21696] * posix/sched_cpucount.c: Don't include <limits.h>. (__sched_cpucount): Use __builtin_popcount.
2017-07-01Fix typo in glibc.tune.cpu nameSiddhesh Poyarekar
2017-06-30float128: Add signbit alternative for old compilersGabriel F. T. Gomes
In math/math.h, __MATH_TG will expand signbit to __builtin_signbit*, e.g.: __builtin_signbitf128, before GCC 6. However, there has never been a __builtin_signbitf128 in GCC and the type-generic builtin is only available since GCC 6. For older GCC, this patch defines __builtin_signbitf128 to __signbitf128, so that the internal function is used instead of the non-existent builtin. This patch also changes the implementation of __signbitf128, because it was reusing the implementation of __signbitl from ldbl-128, which calls __builtin_signbitl. Using the long double version of the builtin is not correct on machines where _Float128 is ABI-distinct from long double (i.e.: ia64, powerpc64le, x86, x86_84). The new implementation does not rely on builtins when being built with GCC versions older than 6.0. The new code does not currently affect powerpc64le builds, because only GCC 6.2 fulfills the requirements from configure. It might affect powerpc64le builds if those requirements are backported to older versions of the compiler. The new code affects x86_64 builds, since glibc is supposed to build correctly with older versions of GCC. Tested for powerpc64le and x86_64. * include/math.h (__signbitf128): Define as hidden. * sysdeps/ieee754/float128/s_signbitf128.c (__signbitf128): Reimplement without builtins. * sysdeps/ia64/bits/floatn.h [!__GNUC_PREREQ (6, 0)] (__builtin_signbitf128): Define to __signbitf128. * sysdeps/powerpc/bits/floatn.h: Likewise. * sysdeps/x86/bits/floatn.h: Likewise.
2017-06-30Consolidate Linux fcntl implementationAdhemerval Zanella
This patch consolidates the fcntl Linux syscall generation on sysdeps/unix/sysv/linux/fcntl.c. It basically removes all the architecture specific implementations. Checked on i686-linux-gnu, x86_64-linux-gnu, x86_64-linux-gnux32, aarch64-linux-gnu, arm-linux-gnueabihf, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/arm/fcntl.c: Remove file. * sysdeps/unix/sysv/linux/generic/wordsize-32/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/hppa/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/i386/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/m68k/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/microblaze/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips32/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/mips/mips64/n32/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/sh/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc32/fcntl.c: Likewise. * sysdeps/unix/sysv/linux/fcntl.c: New file. * sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c: Refactor to use default implementation.
2017-06-30tunables, aarch64: New tunable to override cpuSiddhesh Poyarekar
Add a new tunable (glibc.tune.cpu) to override CPU identification on aarch64. This is useful in two cases: one where it is desirable to pretend to be another CPU for purposes of testing or because routines written for that CPU are beneficial for specific workloads and second where the underlying kernel does not support emulation of MRS to get the MIDR of the CPU. * elf/dl-tunables.h (tunable_is_name): Move from... * elf/dl-tunables.c (is_name): ... here. (parse_tunables, __tunables_init): Adjust. * manual/tunables.texi: Document glibc.tune.cpu. * sysdeps/aarch64/dl-tunables.list: New file. * sysdeps/unix/sysv/linux/aarch64/cpu-features.c (struct cpu_list): New type. (cpu_list): New list of CPU names and their MIDR. (get_midr_from_mcpu): New function. (init_cpu_features): Override MIDR if necessary.
2017-06-30aarch64: Call all string function implementations in testsSiddhesh Poyarekar
The string function implementations implemented so far do not use any instructions that may deviate from standard aarch64, so it is possible for all routines to run on all armv8 hardware. Select all implementations in the benchmarks and tests. * sysdeps/aarch64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Unconditionally select thunderx routine for testing.
2017-06-30i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120]H.J. Lu
GCC 7 changed the definition of max_align_t on i386: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=9b5c49ef97e63cc63f1ffa13baf771368105ebe2 As a result, glibc malloc no longer returns memory blocks which are as aligned as max_align_t requires. This causes malloc/tst-malloc-thread-fail to fail with an error like this one: error: allocation function 0, size 144 not aligned to 16 This patch moves the MALLOC_ALIGNMENT definition to <malloc-alignment.h> and increases the malloc alignment to 16 for i386. [BZ #21120] * malloc/malloc-internal.h (MALLOC_ALIGNMENT): Moved to ... * sysdeps/generic/malloc-alignment.h: Here. New file. * sysdeps/i386/malloc-alignment.h: Likewise. * sysdeps/generic/malloc-machine.h: Include <malloc-alignment.h>.
2017-06-30resolv: Improve debugging output from tst-resolv-res_initFlorian Weimer
2017-06-30resolv: Remove source argument fron res_optionsFlorian Weimer
2017-06-30resolv: Remove DEBUG from resolv/res_query.cFlorian Weimer
2017-06-30resolv: Reformat resolv/res_data.c to GNU styleFlorian Weimer
2017-06-30resolv: Move res_query, res_search res_querydomain, hostaliasFlorian Weimer
From res_data.c to query.c
2017-06-30resolv: Move res_isourserver, res_send from res_data.c to res_send.cFlorian Weimer
2017-06-30resolv: Turn _res_opcodes into a compatibility symbolFlorian Weimer
2017-06-30resolv: Move fp_nquery, fp_query, p_query, _res_opcodesFlorian Weimer
From res_data.c to res_debug.c. Also drop the unnecessary _res initialization from fp_nquery.
2017-06-30resolv: Remove unused resolv/res_debug.h header fileFlorian Weimer
2017-06-30resolv: Remove DEBUG from resolv/res_send.cFlorian Weimer
2017-06-30resolv: Move the res_mkquery function to the resolv/mk_query.c fileFlorian Weimer
2017-06-30resolv: Reformat resolv/res_mkquery.c to GNU styleFlorian Weimer
2017-06-30resolv: Remove DEBUG macro from resolv/res_mkquery.cFlorian Weimer
2017-06-30support: Report actual exit status in support_capture_subprocess_checkFlorian Weimer
2017-06-30resolv: Make RES_ROTATE start with a random name server [BZ #19570]Florian Weimer
Do not copy the actual name server addresses to rotate them. Use a global rotation offset instead.
2017-06-30localedata: CLDRv29: update LC_ADDRESS.lang_name translationsMike Frysinger
This updates a bunch of locales based on CLDR v29 data: az_AZ: changing Azərbaycanca to azərbaycan dili be_BY: changing беларуская мова to беларуская bem_ZM: changing iciBemba to Ichibemba bg_BG: changing български език to български bo_CN: changing པོད་སྐད་ to བོད་སྐད་ bo_IN: changing པོད་སྐད་ to བོད་སྐད་ br_FR: changing Brezhoneg to brezhoneg brx_IN: lang_name: setting to बड़ो ce_RU: changing нохчийн мотт to нохчийн cs_CZ: changing Čeština to čeština dz_BT: changing (རྫོང་ཁ to རྫོང་ཁ el_CY: changing ελληνικά to Ελληνικά el_GR: changing ελληνικά to Ελληνικά es_AR: changing Español to español es_BO: changing Español to español es_CL: changing Español to español es_CO: changing Español to español es_CR: changing Español to español es_CU: changing Español to español es_DO: changing Español to español es_EC: changing Español to español es_ES: changing Español to español es_GT: changing Español to español es_HN: changing Español to español es_MX: changing Español to español es_NI: changing Español to español es_PA: changing Español to español es_PE: changing Español to español es_PR: changing Español to español es_PY: changing Español to español es_SV: changing Español to español es_US: changing Español to español es_UY: changing Español to español es_VE: changing Español to español et_EE: changing eesti keel to eesti eu_ES: changing Euskara to euskara fr_BE: changing Français to français fr_CA: changing Français to français fr_CH: changing Français to français fr_FR: changing Français to français fr_LU: changing Français to français fur_IT: changing Furlan to furlan fy_NL: changing Frysk to West-Frysk gl_ES: changing Galego to galego gv_GB: changing y Ghaelg to Gaelg he_IL: lang_name: setting to עברית hsb_DE: changing Hornjoserbšćina to hornjoserbšćina hy_AM: changing Հայերեն to հայերեն id_ID: changing Bahasa Indonesia to Bahasa Indonesia it_CH: changing Italiano to italiano it_IT: changing Italiano to italiano kl_GL: changing Kalaallisut to kalaallisut km_KH: changing ភាសាខ្មែរ to ខ្មែរ ko_KR: changing 한국말 to 한국어 ks_IN: changing kạ̄šur to کٲشُر kw_GB: changing Kernowek to kernewek ky_KG: changing Кыргызча to кыргызча lg_UG: changing Oluganda to Luganda lt_LT: changing lietuvių kalba to lietuvių lv_LV: changing latviešu valoda to latviešu mk_MK: changing македонск/и јазик to македонски mn_MN: changing Монгол хэл to монгол nb_NO: changing Bokmål to norsk bokmål nn_NO: changing Nynorsk to nynorsk os_RU: lang_name: setting to ирон ru_RU: lang_name: setting to русский ru_UA: lang_name: setting to русский se_NO: changing Davvisámegiella to davvisámegiella sk_SK: lang_name: setting to slovenčina ta_IN: lang_name: setting to தமிழ் ta_LK: lang_name: setting to தமிழ் tk_TM: changing Türkmençe to türkmençe tr_CY: changing Turkish to Türkçe tr_TR: changing Turkish to Türkçe ur_IN: lang_name: setting to {اردو} ur_PK: lang_name: setting to {اردو} vi_VN: changing Việt ngữ to Tiếng Việt yo_NG: changing Yorùbá to Èdè Yorùbá zu_ZA: changing IsiZulu to isiZulu Most of these are simple case changes, but they match the CLDR db. A search for a few of the others suggests they're also correct.
2017-06-29SPARC sys/ucontext.h namespace fixes (bug 21457).Joseph Myers
This patch fixes various miscellaneous namespace issues in the SPARC sys/ucontext.h header. These are similar to changes made previous to other sys/ucontext.h headers, where the SPARC header was excluded from those previous patches because of its complexity. Tested for SPARC with build-many-glibcs.py. [BZ #21457] * sysdeps/unix/sysv/linux/sparc/sys/ucontext.h (__ctx): New macro. [__WORDSIZE == 64] (MC_TSTATE): Define only for [__USE_MISC]. [__WORDSIZE == 64] (MC_PC): Likewise. [__WORDSIZE == 64] (MC_NPC): Likewise. [__WORDSIZE == 64] (MC_Y): Likewise. [__WORDSIZE == 64] (MC_G1): Likewise. [__WORDSIZE == 64] (MC_G2): Likewise. [__WORDSIZE == 64] (MC_G3): Likewise. [__WORDSIZE == 64] (MC_G4): Likewise. [__WORDSIZE == 64] (MC_G5): Likewise. [__WORDSIZE == 64] (MC_G6): Likewise. [__WORDSIZE == 64] (MC_G7): Likewise. [__WORDSIZE == 64] (MC_O0): Likewise. [__WORDSIZE == 64] (MC_O1): Likewise. [__WORDSIZE == 64] (MC_O2): Likewise. [__WORDSIZE == 64] (MC_O3): Likewise. [__WORDSIZE == 64] (MC_O4): Likewise. [__WORDSIZE == 64] (MC_O5): Likewise. [__WORDSIZE == 64] (MC_O6): Likewise. [__WORDSIZE == 64] (MC_O7): Likewise. [__WORDSIZE == 64] (MC_NGREG): Rename to __MC_NGREG and define to __MC_NGREG if [__USE_MISC]. [__WORDSIZE == 64] (MC_MAXFPQ): Define only for [__USE_MISC]. [__WORDSIZE == 64] (mc_gregset_t): Define using __MC_NGREG. [__WORDSIZE == 64] (struct mc_fq): Rename to struct __mc_fq. Define fields using __ctx. [__WORDSIZE == 64] (mc_fpu_t): Remove struct tag. Define fields using __ctx. [__WORDSIZE == 64] (mcontext_t): Define fields using __ctx. (REG_PSR): Define only for [__USE_MISC]. (REG_PC): Likewise. (REG_nPC): Likewise. (REG_Y): Likewise. (REG_G1): Likewise. (REG_G2): Likewise. (REG_G3): Likewise. (REG_G4): Likewise. (REG_G5): Likewise. (REG_G6): Likewise. (REG_G7): Likewise. (REG_O0): Likewise. (REG_O1): Likewise. (REG_O2): Likewise. (REG_O3): Likewise. (REG_O4): Likewise. (REG_O5): Likewise. (REG_O6): Likewise. (REG_O7): Likewise. [__WORDSIZE == 64] (REG_ASI): Define only for [__USE_MISC]. [__WORDSIZE == 64] (REG_FPRS): Likewise. (NGREG): Rename to __NGREG and define to __NGREG if [__USE_MISC]. (gregset_t): Define using __NGREG. (SPARC_MAXREGWINDOW): Rename to __SPARC_MAXREGWINDOW and define to __SPARC_MAXREGWINDOW if [__USE_MISC]. (struct rwindow): Rename to struct __rwindow. Define fields using __ctx. (rw_fp): Define only for [__USE_MISC]. (rw_rtn): Likewise. (gwindows_t): Remove struct tag. Define fields using __ctx and __SPARC_MAXREGWINDOW. (MAXFPQ): Define only for [__USE_MISC]. (struct fpq): Rename to struct __fpq. Define fields using __ctx. (struct fq): Rename to struct __fq. Define fields using __ctx. (FPU_REGS_TYPE): Define only for [__USE_MISC]. (FPU_DREGS_TYPE): Likewise. (V7_FPU_FSR_TYPE): Likewise. (V9_FPU_FSR_TYPE): Likewise. (V9_FPU_FPRS_TYPE): Likewise. [__WORDSIZE == 64] (fpregset_t): Remove struct tag. Define fields using __ctx. [__WORDSIZE != 64] (fpregset_t): Likewise. [__WORDSIZE != 64] (xrs_t): Define fields using __ctx. [__WORDSIZE != 64] (XRS_ID): Define only for [__USE_MISC]. [__WORDSIZE != 64] (mcontext_t): Define fields using __ctx. Rename field filler to __glibc_reserved1. * sysdeps/unix/sysv/linux/sparc/sparc32/ucontext_i.sym (MC_FILLER): Remove.
2017-06-29vfprintf: Fix tst-vfprintf-mbs-prec and tst-vfprintf-user-typeFlorian Weimer
2017-06-29posix: Improve default posix_spawn implementationAdhemerval Zanella
This patch improves the default posix implementation of posix_spawn{p} and align with Linux one. The main idea is to fix some issues already fixed in Linux code, and deprecated vfork internal usage (source of various bug reports). In a short: - It moves POSIX_SPAWN_USEVFORK usage and sets it a no-op. Since the process that actually spawn the new process do not share memory with parent (with vfork), it fixes BZ#14750 for this implementation. - It uses a pipe to correctly obtain the return upon failure of execution (BZ#18433). - It correctly enable/disable asynchronous cancellation (checked on ptl/tst-exec5.c). - It correctly disable/enable signal handling. Using this version instead of Linux shows only one regression, posix/tst-spawn3, because of pipe2 usage which increase total number of file descriptor. * sysdeps/posix/spawni.c (__spawni_child): New function. (__spawni): Rename to __spawnix.
2017-06-29vfprintf: Reuse work_buffer in group_numberFlorian Weimer
2017-06-29vfprintf: Use struct scratch_buffer for positional arguments allocationFlorian Weimer
2017-06-29_i18n_number_rewrite: Use struct scratch_bufferFlorian Weimer
2017-06-29vfprintf: Reduce WORK_BUFFER_SIZE for wchar_t buildsFlorian Weimer
2017-06-29vfprintf: Add test case for multi-byte/wide strings and precisionFlorian Weimer
2017-06-29vfprintf: Add test case for user-defined types and format specifiersFlorian Weimer
2017-06-28posix: Adapt tst-spawn{2,3} to use libsupport.Adhemerval Zanella
Checked on x86_64-linux-gnu. * posix/tst-spawn2.c (do_test): Use libsupport. * posix/tst-spawn3.c (do_test): Likewise.
2017-06-28Fix gen-tgmath-tests.py output for GCC 7 <float.h>.Joseph Myers
* math/gen-tgmath-tests.py (Tests.__init__): Define __STDC_WANT_IEC_60559_TYPES_EXT__ at start of generated file.
2017-06-28Support _Float128 in tgmath.h.Joseph Myers
This patch adds tgmath.h support for _Float128, so eliminating the awkward caveat in NEWS about the type not being supported there. This does inevitably increase the size of macro expansions (which grows particularly fast when you have nested calls to tgmath.h macros), but only when _Float128 is supported and the declarations of _Float128 interfaces are visible; otherwise the expansions are unchanged. Tested for x86_64 and arm. * math/tgmath.h: Include <bits/libc-header-start.h> and <bits/floatn.h>. (__TGMATH_F128): New macro. (__TGMATH_CF128): Likewise. (__TGMATH_UNARY_REAL_ONLY): Use __TGMATH_F128. (__TGMATH_UNARY_REAL_RET_ONLY): Likewise. (__TGMATH_BINARY_FIRST_REAL_ONLY): Likewise. (__TGMATH_BINARY_FIRST_REAL_STD_ONLY): New macro. (__TGMATH_BINARY_REAL_ONLY): Use __TGMATH_F128. (__TGMATH_BINARY_REAL_STD_ONLY): New macro. (__TGMATH_BINARY_REAL_RET_ONLY): Use __TGMATH_F128. (__TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY): Likewise. (__TGMATH_TERNARY_REAL_ONLY): Likewise. (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): Likewise. (__TGMATH_UNARY_REAL_IMAG): Use __TGMATH_CF128. (__TGMATH_UNARY_IMAG): Use __TGMATH_F128. (__TGMATH_UNARY_REAL_IMAG_RET_REAL): Use __TGMATH_CF128. (__TGMATH_BINARY_REAL_IMAG): Likewise. (nexttoward): Use __TGMATH_BINARY_FIRST_REAL_STD_ONLY. [__USE_MISC] (scalb): Use __TGMATH_BINARY_REAL_STD_ONLY. * math/gen-tgmath-tests.py (Type.init_types): Enable _FloatN and _FloatNx types if the corresponding HUGE_VAL macros are defined.
2017-06-28Use clog10 not __clog10 in tgmath.h log10 macro.Joseph Myers
As a GNU extension, for _GNU_SOURCE glibc's complex.h provides a clog10 function and tgmath.h supports complex arguments to the log10 macro. However, tgmath.h uses __clog10 not clog10 in defining the macro. There is no namespace reason (ignoring the block-scope namespace issues that would apply equally to *every* function called by tgmath.h macros) for using __clog10 here, since this is only for _GNU_SOURCE so clog10 is always visible when this macro definition is used. Furthermore, __clog10f128 is not exported, so supporting _Float128 in tgmath.h implies using clog10 not __clog10 there. (__clog10 and clog10 aren't used in libstdc++ either, although that library would have a good case for using the __clog10 reserved-namespace export: the standard C++ library includes log10 of a complex number.) This patch duly changes the header to use clog10, and enables tests of the macro for complex arguments. Tested for x86_64. * math/tgmath.h [__USE_GNU] (log10): Use clog10 not __clog10. * math/gen-tgmath-tests.py (Tests.add_all_tests): Test log10 for complex arguments.
2017-06-28Fix tgmath.h totalorder, totalordermag return type (bug 21687).Joseph Myers
The tgmath.h totalorder and totalordermag macros wrongly return a floating-point type. They should return int, like the underlying functions. This patch fixes them accordingly, updating tests including enabling tests of those functions from gen-tgmath-tests.py. Tested for x86_64. [BZ #21687] * math/tgmath.h (__TGMATH_BINARY_REAL_RET_ONLY): New macro. (totalorder): Use it. (totalordermag): Likewise. * math/gen-tgmath-tests.py (Tests.add_all_tests): Enable tests of totalorder and totalordermag. * math/test-tgmath.c (F(compile_test)): Do not call totalorder or totalordermag in arguments of calls to those functions. (NCALLS): Change to 134.
2017-06-28Simplify tgmath.h for integer return types.Joseph Myers
The tgmath.h macros for function with integer return types generate unnecessary casts to the return type. Since in those cases the return type does not depend on the argument type, all the cases in the conditional expressions already have the right type, and no casts are needed; this patch removes them. Tested for x86_64. * math/tgmath.h (__TGMATH_UNARY_REAL_RET_ONLY): Do not take or cast to return type argument. (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): Likewise. (lrint): Update call to __TGMATH_UNARY_REAL_RET_ONLY. (llrint): Likewise. (lround): Likewise. (llround): Likewise. (ilogb): Likewise. (llogb): Likewise. (fromfp): Update call to __TGMATH_TERNARY_FIRST_REAL_RET_ONLY. (ufromfp): Likewise. (fromfpx): Likewise. (ufromfpx): Likewise.
2017-06-28Remove NO_LONG_DOUBLE conditionals in libm tests (bug 21607).Joseph Myers
As noted in bug 21607, NO_LONG_DOUBLE conditionals in libm tests are no longer effective. For most this is harmless - they were only present because of long double functions not being declared with _LIBC defined, and _LIBC is no longer defined for building most tests. For the few where this is actually relevant to the test, testing LDBL_MANT_DIG > DBL_MANT_DIG is more appropriate as that limits the test to public APIs. This patch fixes the tests accordingly. Tested for x86_64 and arm. [BZ #21607] * math/basic-test.c [!NO_LONG_DOUBLE]: Change conditionals to [LDBL_MANT_DIG > DBL_MANT_DIG]. * math/bug-nextafter.c [!NO_LONG_DOUBLE]: Remove conditionals. * math/bug-nexttoward.c [!NO_LONG_DOUBLE]: Likewise. * math/test-math-isinff.cc [!NO_LONG_DOUBLE]: Likewise. * math/test-math-iszero.cc [!NO_LONG_DOUBLE]: Likewise. * math/test-nan-overflow.c [!NO_LONG_DOUBLE]: Likewise. * math/test-nan-payload.c [!NO_LONG_DOUBLE]: Likewise. * math/test-nearbyint-except-2.c [!NO_LONG_DOUBLE]: Likewise. * math/test-nearbyint-except.c [!NO_LONG_DOUBLE]: Likewise. * math/test-powl.c [!NO_LONG_DOUBLE]: Likewise. * math/test-signgam-finite-c99.c [!NO_LONG_DOUBLE]: Likewise. * math/test-signgam-finite.c [!NO_LONG_DOUBLE]: Likewise. * math/test-signgam-main.c [!NO_LONG_DOUBLE]: Likewise. * math/test-snan.c [!NO_LONG_DOUBLE]: Likewise. * math/test-tgmath-ret.c [!NO_LONG_DOUBLE]: Likewise. * math/test-tgmath.c: Include <float.h>. [!NO_LONG_DOUBLE]: Change conditionals to [LDBL_MANT_DIG > DBL_MANT_DIG]. * math/test-tgmath2.c: Include <float.h>. [!NO_LONG_DOUBLE]: Change conditionals to [LDBL_MANT_DIG > DBL_MANT_DIG].
2017-06-28Add more thorough generated tgmath.h test.Joseph Myers
This patch adds a more thorough test of tgmath.h macros, verifying both the return type and the function called for all the cases of valid argument types. (Cases with current problems - I've just filed four bugs - are disabled or omitted pending fixing those problems.) The test uses a Python generator (works with both Python 2 and 3) to generate a C file which is then built and run as a test in the usual way (and that C file includes its own dummy definitions of libm functions similar to existing tgmath.h tests). The motivation is to make it easier to add tests of tgmath.h for _Float128 when adding tgmath.h support for that type; the _FloatN / _FloatNx support is present in the script, but disabled until the tgmath.h support is written. Tested for x86_64, and for arm to check things in the long double = double case. (In that case, it's OK to call either double or long double functions when the selected type is double or long double, as long as the return type of the macro is exactly correct.) * math/gen-tgmath-tests.py: New file. * math/Makefile [PYTHON] (tests): Add test-tgmath3. [PYTHON] (generated): Add test-tgmath3.c. [PYTHON] (CFLAGS-test-tgmath3.c): New variable. [PYTHON] ($(objpfx)test-tgmath3.c): New rule.
2017-06-28Require binutils 2.25 or later to build glibc.Joseph Myers
This patch implements a requirement of binutils >= 2.25 (up from 2.22) to build glibc. Tests for 2.24 or later on x86_64 and s390 are removed. It was already the case, as indicated by buildbot results, that 2.24 was too old for building tests for 32-bit x86 (produced internal linker errors linking elf/tst-gnu2-tls1mod.so). I don't know if any configure tests for binutils features are obsolete given the increased version requirement. Tested for x86_64. * configure.ac (AS): Require binutils 2.25 or later. (LD): Likewise. * configure: Regenerated. * sysdeps/s390/configure.ac (AS): Remove version check. * sysdeps/s390/configure: Regenerated. * sysdeps/x86_64/configure.ac (AS): Remove version check. * sysdeps/x86_64/configure: Regenerated. * manual/install.texi (Tools for Compilation): Document requirement for binutils 2.25 or later. * INSTALL: Regenerated.
2017-06-28Support building glibc with gold 1.14 or above [BZ #14995]H.J. Lu
This patch changes configure.ac to allow gold 1.14 or above to be used to configire glibc so that gold glibc bugs can be fixed. Tested with CC="gcc -fuse-ld=gold" CXX="g++ -fuse-ld=gold" on Fedora 25 with gold 1.14 (20170623). Gold 1.14 was first released in binutils 2.28. On x86-64, for "make check", I got Error in `/export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1': double free or corruption (fasttop): 0x00000000008755f0 *** ======= Backtrace: ========= /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x772fb)[0x7f85225b52fb] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x7d6c6)[0x7f85225bb6c6] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x7df0e)[0x7f85225bbf0e] /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(+0x182d)[0x7f85226e682d] /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(dlclose+0x1f)[0x7f85226e623f] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so(+0x933)[0x7f8522539933] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0xfd1a)[0x7f85226fbd1a] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x3c5e0)[0x7f852257a5e0] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(+0x3c63a)[0x7f852257a63a] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so(+0x9aa)[0x7f85225399aa] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0xf74a)[0x7f85226fb74a] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0xf85b)[0x7f85226fb85b] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0x13e98)[0x7f85226ffe98] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(_dl_catch_error+0x71)[0x7f85226643c1] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so(+0x13639)[0x7f85226ff639] /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(+0x1156)[0x7f85226e6156] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(_dl_catch_error+0x71)[0x7f85226643c1] /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(+0x1789)[0x7f85226e6789] /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so.2(dlopen+0x32)[0x7f85226e61e2] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1[0x4009ca] /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so.6(__libc_start_main+0xf1)[0x7f8522565231] /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1[0x400a5a] ======= Memory map: ======== 00400000-00401000 r-xp 00000000 08:11 26334965 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1 00401000-00402000 r--p 00000000 08:11 26334965 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1 00402000-00403000 rw-p 00001000 08:11 26334965 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload1 00875000-00896000 rw-p 00000000 00:00 0 [heap] 7f851c000000-7f851c021000 rw-p 00000000 00:00 0 7f851c021000-7f8520000000 ---p 00000000 00:00 0 7f85222f3000-7f8522309000 r-xp 00000000 08:02 136658 /usr/lib64/libgcc_s-6.3.1-20170216.so.1 7f8522309000-7f8522508000 ---p 00016000 08:02 136658 /usr/lib64/libgcc_s-6.3.1-20170216.so.1 7f8522508000-7f8522509000 r--p 00015000 08:02 136658 /usr/lib64/libgcc_s-6.3.1-20170216.so.1 7f8522509000-7f852250a000 rw-p 00016000 08:02 136658 /usr/lib64/libgcc_s-6.3.1-20170216.so.1 7f8522539000-7f852253a000 r-xp 00000000 08:11 26334619 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so 7f852253a000-7f852253b000 r--p 00000000 08:11 26334619 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so 7f852253b000-7f852253c000 rw-p 00001000 08:11 26334619 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/constload2.so 7f852253c000-7f852253e000 rw-p 00000000 00:00 0 7f852253e000-7f85226da000 r-xp 00000000 08:11 26309973 /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so 7f85226da000-7f85226db000 ---p 0019c000 08:11 26309973 /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so 7f85226db000-7f85226de000 r--p 0019c000 08:11 26309973 /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so 7f85226de000-7f85226e1000 rw-p 0019f000 08:11 26309973 /export/build/gnu/glibc-gold/build-x86_64-linux/libc.so 7f85226e1000-7f85226e5000 rw-p 00000000 00:00 0 7f85226e5000-7f85226e8000 r-xp 00000000 08:11 26313777 /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so 7f85226e8000-7f85226e9000 r--p 00002000 08:11 26313777 /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so 7f85226e9000-7f85226ea000 rw-p 00003000 08:11 26313777 /export/build/gnu/glibc-gold/build-x86_64-linux/dlfcn/libdl.so 7f85226ea000-7f85226ec000 rw-p 00000000 00:00 0 7f85226ec000-7f8522711000 r-xp 00000000 08:11 26309972 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so 7f8522711000-7f8522712000 rw-p 00000000 00:00 0 7f8522712000-7f8522713000 r--p 00025000 08:11 26309972 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so 7f8522713000-7f8522714000 rw-p 00026000 08:11 26309972 /export/build/gnu/glibc-gold/build-x86_64-linux/elf/ld.so 7f8522714000-7f8522715000 rw-p 00000000 00:00 0 7ffc5a2bd000-7ffc5a2df000 rw-p 00000000 00:00 0 [stack] 7ffc5a32c000-7ffc5a32e000 r--p 00000000 00:00 0 [vvar] 7ffc5a32e000-7ffc5a330000 r-xp 00000000 00:00 0 [vdso] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall] and make[4]: *** [/export/build/gnu/glibc-gold/build-x86_64-linux/elf/vismain] Error 1 This is because gold doesn't support protected data symbols: configure:5672: checking linker support for protected data symbol configure:5682: gcc -fuse-ld=gold -nostdlib -nostartfiles -fno-stack-protector -fPIC -shared conftest.c -o conftest.so configure:5685: $? = 0 configure:5692: gcc -fuse-ld=gold -nostdlib -nostartfiles -fno-stack-protector conftest.c -o conftest conftest.so /usr/local/bin/ld.gold: error: /tmp/ccXWoofs.o: cannot make copy relocation for protected symbol 'bar', defined in conftest.so collect2: error: ld returned 1 exit status make[4]: *** [/export/build/gnu/glibc-gold/build-x86_64-linux/elf/tst-split-dynreloc] Error 1 This is because gold doesn't support INSERT in linker script: https://sourceware.org/bugzilla/show_bug.cgi?id=21676 The total failures are FAIL: dlfcn/bug-dl-leaf FAIL: elf/constload1 FAIL: elf/global FAIL: elf/ifuncmain1 FAIL: elf/ifuncmain1pic FAIL: elf/ifuncmain1pie FAIL: elf/ifuncmain1vis FAIL: elf/ifuncmain1vispic FAIL: elf/ifuncmain1vispie FAIL: elf/ifuncmain3 FAIL: elf/initfirst FAIL: elf/preloadtest FAIL: elf/tst-audit11 FAIL: elf/tst-audit12 FAIL: elf/tst-audit4 FAIL: elf/tst-audit5 FAIL: elf/tst-audit6 FAIL: elf/tst-audit7 FAIL: elf/tst-dlmodcount FAIL: elf/tst-dlmopen1 FAIL: elf/tst-dlmopen3 FAIL: elf/tst-dlopenrpath FAIL: elf/tst-latepthread FAIL: elf/tst-leaks1-mem FAIL: elf/tst-nodelete-dlclose FAIL: elf/unload6 FAIL: nss/test-netdb FAIL: nss/tst-nss-test1 FAIL: posix/tst-getaddrinfo5 [BZ #14995] * configure.ac: Allow gold 1.14 or above to configire glibc * configure: Regenerated.
2017-06-28Miscellaneous sys/ucontext.h namespace fixes (bug 21457).Joseph Myers
This patch fixes various miscellaneous namespace issues in sys/ucontext.h headers. Some struct tags are removed where the structs also have *_t typedef names, while other struct tags without such names are renamed to start __; the changes are noted in NEWS as they can affect C++ name mangling (although there seems to be little if any external use of these types, at least based on checking codesearch.debian.net). For powerpc, pointers to struct pt_regs (not defined in this header) are changed to point to struct __ctx(pt_regs), so in the __USE_MISC case those struct fields continue to point to the existing struct pt_regs type for maximum compatibility, while when that's a namespace issue they point to a struct __pt_regs type which is always an incomplete struct. Tested for affected architectures with build-many-glibcs.py. [BZ #21457] * sysdeps/unix/sysv/linux/m68k/sys/ucontext.h (fpregset_t): Remove struct tag. * sysdeps/unix/sysv/linux/mips/sys/ucontext.h (fpregset_t): Likewise. * sysdeps/unix/sysv/linux/nios2/sys/ucontext.h (mcontext_t): Likewise. * sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h (pt_regs): Declare struct type with __ctx. [__WORDSIZE != 32] (mcontext_t): Use __ctx with pt_regs struct tag. (ucontext_t) [__WORDSIZE == 32]: Use __ctx with pt_regs struct tag and regs field name.