about summary refs log tree commit diff
Commit message (Collapse)AuthorAgeFilesLines
* Fix -Wempty-body warnings in glibc.Joseph Myers2019-02-134-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One group of warnings seen building glibc with -Wextra is -Wempty-body warnings about an 'if' body (or in one case an 'else' body) that is just a semicolon, "warning: suggest braces around empty body in an 'if' statement [-Wempty-body]" - I think the point of the warning being to make it more visible whether an 'if' body is actually present or not. This patch fixes such warnings in glibc. There's one place, with a semicolon at the end of a comment, where this is clearly making the presence of an 'else' body more visible. The other cases involve macro definitions expanding to nothing. While there's no issue there with visibility at the call sites, I think it's still cleaner to have a macro that expands to something nonempty appropriate for the context - so do {} while (0) if it's only intended to be usable as a statement, or ((void) 0) where the macro definition is an alternative to a call to a function returning void, so this patch makes those changes. Tested for x86_64. * catgets/gencat.c (normalize_line): Use braces around empty 'else' body. * include/stap-probe.h [!USE_STAP_PROBE && !__ASSEMBLER__] (STAP_PROBE0): Use do {} while (0) for do-nothing definition. [!USE_STAP_PROBE && !__ASSEMBLER__] (STAP_PROBE1): Likewise. [!USE_STAP_PROBE && !__ASSEMBLER__] (STAP_PROBE2): Likewise. [!USE_STAP_PROBE && !__ASSEMBLER__] (STAP_PROBE3): Likewise. [!USE_STAP_PROBE && !__ASSEMBLER__] (STAP_PROBE4): Likewise. * libio/libio.h (_IO_funlockfile): Use ((void) 0) for do-nothing definition.
* Avoid fall-through in test-container if execlp fails.Joseph Myers2019-02-132-0/+6
| | | | | | | | | | | | | One of the implicit-fallthrough warnings from compiling glibc with -Wextra appears to indicate an actual bug: the test-container code could fall through inappropriately if execlp returns (which only occurs on error). This patch adds appropriate error handling in this case to avoid that fall-through. Tested for x86_64. * support/test-container.c (recursive_remove): Use FAIL_EXIT1 if execlp returns.
* String benchtest cleanupWilco Dijkstra2019-02-1220-384/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Continue cleanup of the string benchtests. Remove simplistic byte-oriented versions with faster generic implementations. Remove bcopy/bzero benchmarks (bcopy/bzero are obsolete and never emitted by compilers). Remove builtin versions of memcpy, memset and strlen. Remove all remaining "stupid" implementations given they are always slower than the "simple" variants and thus don't add anything useful. * benchtests/bench-strcasecmp.c (stupid_strcasecmp): Remove. * benchtests/bench-strcasestr.c (stupid_strcasestr): Remove. * benchtests/bench-strchr.c (stupid_strchr): Remove. * benchtests/bench-strcmp.c (stupid_strcmp): Remove. * benchtests/bench-strcspn.c (stupid_strcspn): Remove. * benchtests/bench-strlen.c (builtin_strlen): Remove. * benchtests/bench-strncasecmp.c (stupid_strncasecmp): Remove. * benchtests/bench-strncmp.c (stupid_strncmp): Remove. * benchtests/bench-strpbrk.c (stupid_strpbrk): Remove. * benchtests/bench-strspn.c (stupid_strspn): Remove. * benchtests/Makefile: Remove bench-bcopy.c and bench-bzero.c. * benchtests/bench-bcopy.c: Delete file. * benchtests/bench-bzero.c: Likewise. * benchtests/bench-memccpy.c (stupid_memccpy): Remove. (simple_memccpy): Remove. (generic_memccpy): Add function. * benchtests/bench-memcpy.c: (builtin_memcpy): Remove. * benchtests/bench-memmove.c (simple_bcopy): Remove. * benchtests/bench-mempcpy.c (simple_mempcpy): Remove. (generic_mempcpy): Add new function. * benchtests/bench-memset.c (simple_bzero): Remove. (builtin_bzero): Remove. (builtin_memset): Remove. * benchtests/bench-rawmemchr.c (simple_rawmemchr): Remove. (generic_rawmemchr): Add new function.
* nss: getent: Print IPv6 scope ID for ahosts/ahostsv6 if availableFlorian Weimer2019-02-122-8/+32
| | | | | This information is sometimes useful and actually required for link-local addresses.
* elf: Test for LD_AUDIT module returning zero from la_version [BZ #24122]Adhemerval Zanella2019-02-124-2/+138
| | | | | | This includes the original test case from commit 8e889c5da3c5981c5a46a93fec02de40131ac5a6 ("elf: Fix LD_AUDIT for modules with invalid version (BZ#24122)).
* elf: Ignore LD_AUDIT interfaces if la_version returns 0 [BZ #24122]Florian Weimer2019-02-122-162/+215
| | | | | | | | | | | | | | | | | This change moves the audit module loading and early notification into separate functions out of dl_main. It restores the bug fix from commit 8e889c5da3c5981c5a46a93fec02de40131ac5a6 ("elf: Fix LD_AUDIT for modules with invalid version (BZ#24122)") which was reverted in commit 83e6b59625f45db1eee93e5684091f740c52a083 ("[elf] Revert 8e889c5da3 (BZ#24122)"). The actual bug fix is the separate error message for the case when la_version returns zero. The dynamic linker error message (which is NULL in this case) is no longer used. Based on the intended use of version zero (ignore this module due to explicit request), the message is only printed if debugging is enabled.
* Add fall-through comments.Joseph Myers2019-02-1210-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds fall-through comments in some cases where -Wextra produces implicit-fallthrough warnings. The patch is non-exhaustive. Apart from architecture-specific code for non-x86_64 architectures, it does not change sunrpc/xdr.c (legacy code, probably should have such changes, but left to be dealt with separately), or places that already had comments about the fall-through but not matching the form expected by -Wimplicit-fallthrough=3 (the default level with -Wextra; my inclination is to adjust those comments to match rather than downgrading to -Wimplicit-fallthrough=1 to allow any comment), or one place where I thought the implicit fallthrough was not correct and so should be handled separately as a bug fix. I think the key thing to consider in review of this patch is whether the fall-through is indeed intended and correct in each place where such a comment is added. Tested for x86_64. * elf/dl-exception.c (_dl_exception_create_format): Add fall-through comments. * elf/ldconfig.c (parse_conf_include): Likewise. * elf/rtld.c (print_statistics): Likewise. * locale/programs/charmap.c (parse_charmap): Likewise. * misc/mntent_r.c (__getmntent_r): Likewise. * posix/wordexp.c (parse_arith): Likewise. (parse_backtick): Likewise. * resolv/ns_ttl.c (ns_parse_ttl): Likewise. * sysdeps/x86/cpu-features.c (init_cpu_features): Likewise. * sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
* Use float in e_sqrt.cPaul Clarke2019-02-112-1/+6
| | | | | | | | | | | | | | | | The type used within e_sqrt.c(__slow_ieee754_sqrtf) was, unnecessarily and likely inadvertently, double. float is not only appropriate, but also more efficient, avoiding the need for the compiler to emit a round-to-single-precision instruction. This is the difference in compiled code: 0000000000000000 <__ieee754_sqrtf>: 0: 2c 08 20 ec fsqrts f1,f1 - 4: 18 08 20 fc frsp f1,f1 - 8: 20 00 80 4e blr + 4: 20 00 80 4e blr (Found by Anton Blanchard.)
* Fix a few whitespace arrangement inconsistencies in time/strftime_l.cTAMUKI Shoichi2019-02-112-3/+7
| | | | | | | | | | Having checked the arrangement of whitespace in time/strftime_l.c using "unexpand" and "unexpand -a" command, three inconsistencies are detected. So fix them for consistency. ChangeLog: * time/strftime_l.c: Fix a few whitespace arrangement inconsistencies.
* Remove powerpc bits/mathinline.h.Joseph Myers2019-02-082-58/+4
| | | | | | | | | | | | | | Continuing the process of moving away from having bits/mathinline.h headers in glibc, leaving the compiler to inline functions as appropriate depending on the options passed to it, this patch removes the header for powerpc. <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88558> is the corresponding GCC bug for adding replacements for these powerpc (32-bit-only) lrint / lrintf inlines. Tested with build-many-glibcs.py for its powerpc configurations. * sysdeps/powerpc/bits/mathinline.h: Remove.
* math: Enable <bits/math-finite.h> sysdeps overrideFlorian Weimer2019-02-082-0/+6
| | | | | | | | | sysdeps/ia64/fpu/bits/math-finite.h exists and will be installed on ia64, but during the build, the default math/bits/math-finite.h file is used, which is wrong. Fixes commit 0ac5ae2335292908f39031b1ea9fe8edce433c0f ("Optimize libm").
* Move generic <bits/unistd_ext.h> to a more regular locationFlorian Weimer2019-02-082-0/+5
| | | | | | | | | | No functional change; the previous path worked as well, but it re-added the obsolete sysdeps/generic/bits directory, which was removed (for the first time) in commit c72565e5f1124c2dc72573e83406fe999e56091f. Fixes commit e47d82c99a6db060419b421768aced76bea92997 ("Provide <bits/unistd_ext.h> as a sysdeps header exclusively").
* nss: Add tst-nss-files-hosts-long test [BZ #21915]Patsy Franklin2019-02-084-1/+64
| | | | | | | | | When the /etc/hosts file has a line longer than 1028 characters getent ahostsv4 and ahostsv6 will fail. This test performs a getent call on a /etc/hosts file that contains a very long line (greater than 1028) using the test-in-container framework.
* Provide <bits/unistd_ext.h> as a sysdeps header exclusivelyFlorian Weimer2019-02-083-1/+6
| | | | | | | | | | | | | Non-sysdeps headers cannot be overriden by sysdeps headers across the entire build, so it is necessary to turn such extension headers into sysdeps headers themselves. The approach here follows the existing <bits/shm.h> header (although it uses sysdeps/gnu instead of sysdeps/generic). Fixes commit 1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92 ("Linux: Add gettid system call wrapper [BZ #6399]") and commit 8f89ab216f205c2ffd90d1fc8454efdfc0b01dee ("posix: Fix missing wrapper header for <bits/unistd_ext.h>").
* posix: Fix missing wrapper header for <bits/unistd_ext.h>Florian Weimer2019-02-082-0/+5
| | | | | | | Fixes commit 1d0fc213824eaa2a8f8c4385daaa698ee8fb7c92 ("Linux: Add gettid system call wrapper [BZ #6399]"). Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* tst-strftime2: Use array_length macros instead of magic numbersTAMUKI Shoichi2019-02-082-1/+7
| | | | | | | ChangeLog: * time/tst-strftime2.c: Use array_length macros instead of magic numbers.
* nptl: Avoid fork handler lock for async-signal-safe fork [BZ #24161]Florian Weimer2019-02-084-9/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 27761a1042daf01987e7d79636d0c41511c6df3c ("Refactor atfork handlers") introduced a lock, atfork_lock, around fork handler list accesses. It turns out that this lock occasionally results in self-deadlocks in malloc/tst-mallocfork2: (gdb) bt #0 __lll_lock_wait_private () at ../sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:63 #1 0x00007f160c6f927a in __run_fork_handlers (who=(unknown: 209394016), who@entry=atfork_run_prepare) at register-atfork.c:116 #2 0x00007f160c6b7897 in __libc_fork () at ../sysdeps/nptl/fork.c:58 #3 0x00000000004027d6 in sigusr1_handler (signo=<optimized out>) at tst-mallocfork2.c:80 #4 sigusr1_handler (signo=<optimized out>) at tst-mallocfork2.c:64 #5 <signal handler called> #6 0x00007f160c6f92e4 in __run_fork_handlers (who=who@entry=atfork_run_parent) at register-atfork.c:136 #7 0x00007f160c6b79a2 in __libc_fork () at ../sysdeps/nptl/fork.c:152 #8 0x0000000000402567 in do_test () at tst-mallocfork2.c:156 #9 0x0000000000402dd2 in support_test_main (argc=1, argv=0x7ffc81ef1ab0, config=config@entry=0x7ffc81ef1970) at support_test_main.c:350 #10 0x0000000000402362 in main (argc=<optimized out>, argv=<optimized out>) at ../support/test-driver.c:168 If no locking happens in the single-threaded case (where fork is expected to be async-signal-safe), this deadlock is avoided. (pthread_atfork is not required to be async-signal-safe, so a fork call from a signal handler interrupting pthread_atfork is not a problem.)
* ChangeLog: Correct date of last commitFlorian Weimer2019-02-081-1/+1
|
* Linux: Add gettid system call wrapper [BZ #6399]Florian Weimer2019-02-0840-9/+388
| | | | | | | | | | This commit adds gettid to <unistd.h> on Linux, and not to the kernel-independent GNU API. gettid is now supportable on Linux because too many things assume a 1:1 mapping between libpthread threads and kernel threads. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* rt: Turn forwards from librt to libc into compat symbols [BZ #24194]Florian Weimer2019-02-083-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a ("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17, clock_gettime, clock_getres, clock_settime, clock_getcpuclockid, clock_nanosleep were added to libc, and the file rt/clock-compat.c was added with forwarders to the actual implementations in libc. These forwarders were wrapped in #if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17) so that they are not present for newer architectures (such as powerpc64le) with a 2.17 or later ABI baseline. But the forwarders were not marked as compatibility symbols. As a result, on older architectures, historic configure checks such as AC_CHECK_LIB(rt, clock_gettime) still cause linking against librt, even though this is completely unnecessary. It also creates a needless porting hazard because architectures behave differently when it comes to symbol availability. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Add compiler barriers around modifications of the robust mutex list for ↵Stefan Liebler2019-02-072-4/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pthread_mutex_trylock. [BZ #24180] While debugging a kernel warning, Thomas Gleixner, Sebastian Sewior and Heiko Carstens found a bug in pthread_mutex_trylock due to misordered instructions: 140: a5 1b 00 01 oill %r1,1 144: e5 48 a0 f0 00 00 mvghi 240(%r10),0 <--- THREAD_SETMEM (THREAD_SELF, robust_head.list_op_pending, NULL); 14a: e3 10 a0 e0 00 24 stg %r1,224(%r10) <--- last THREAD_SETMEM of ENQUEUE_MUTEX_PI vs (with compiler barriers): 140: a5 1b 00 01 oill %r1,1 144: e3 10 a0 e0 00 24 stg %r1,224(%r10) 14a: e5 48 a0 f0 00 00 mvghi 240(%r10),0 Please have a look at the discussion: "Re: WARN_ON_ONCE(!new_owner) within wake_futex_pi() triggerede" (https://lore.kernel.org/lkml/20190202112006.GB3381@osiris/) This patch is introducing the same compiler barriers and comments for pthread_mutex_trylock as introduced for pthread_mutex_lock and pthread_mutex_timedlock by commit 8f9450a0b7a9e78267e8ae1ab1000ebca08e473e "Add compiler barriers around modifications of the robust mutex list." ChangeLog: [BZ #24180] * nptl/pthread_mutex_trylock.c (__pthread_mutex_trylock):
* array_length: Make usable as a constant expressionFlorian Weimer2019-02-072-6/+12
| | | | | | | Do not use a statement expression in array_length, so that array_length can be used at file scope and as a constant expression. Instead, put the _Static_assert into a struct (as a declaration), and nest this in the expression using a sizeof expression.
* support: Implement xdlmopenFlorian Weimer2019-02-074-1/+39
| | | | | Put xdlmopen into its own file, to avoid disturbing static linking tests (where dlmopen pulls in additional code).
* Avoid "inline" after return type in function definitions.Joseph Myers2019-02-069-42/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One group of warnings seen with -Wextra is warnings for static or inline not at the start of a declaration (-Wold-style-declaration). This patch fixes various such cases for inline, ensuring it comes at the start of the declaration (after any static). A common case of the fix is "static inline <type> __always_inline"; the definition of __always_inline starts with __inline, so the natural change is to "static __always_inline <type>". Other cases of the warning may be harder to fix (one pattern is a function definition that gets rewritten to be static by an including file, "#define funcname static wrapped_funcname" or similar), but it seems worth fixing these cases with inline anyway. Tested for x86_64. * elf/dl-load.h (_dl_postprocess_loadcmd): Use __always_inline before return type, without separate inline. * elf/dl-tunables.c (maybe_enable_malloc_check): Likewise. * elf/dl-tunables.h (tunable_is_name): Likewise. * malloc/malloc.c (do_set_trim_threshold): Likewise. (do_set_top_pad): Likewise. (do_set_mmap_threshold): Likewise. (do_set_mmaps_max): Likewise. (do_set_mallopt_check): Likewise. (do_set_perturb_byte): Likewise. (do_set_arena_test): Likewise. (do_set_arena_max): Likewise. (do_set_tcache_max): Likewise. (do_set_tcache_count): Likewise. (do_set_tcache_unsorted_limit): Likewise. * nis/nis_subr.c (count_dots): Likewise. * nptl/allocatestack.c (advise_stack_range): Likewise. * sysdeps/ieee754/dbl-64/s_sin.c (do_cos): Likewise. (do_sin): Likewise. (reduce_sincos): Likewise. (do_sincos): Likewise. * sysdeps/unix/sysv/linux/x86/elision-conf.c (do_set_elision_enable): Likewise. (TUNABLE_CALLBACK_FNDECL): Likewise.
* support: Use dlerror to detect NULL symbols in xdlsymFlorian Weimer2019-02-062-10/+15
|
* x86: Remove unnecessary <stap-probe.h> include from lowlevellock.hFlorian Weimer2019-02-063-4/+6
| | | | | | | | | | | | | | | | In the i386 case, it appears that the sole remaining LIBC_PROBE was removed in commit a9fe4c5aa8e53ee30f7d0a1c878391d5d6324e6e ("Support six-argument syscalls from C for 32-bit x86, use generic lowlevellock-futex.h (bug 18138)."), when sysdeps/unix/sysv/linux/i386/lowlevellock-futex.h was replaced with the generic version. For x86_64, the relevant change is commit 76f71081cd3fe355b9c18d1fc5e87643c788cfac ("Use generic lowlevellock-futex.h in x86_64 lowlevellock.h."), again by using the generic version of <lowlevellock-futex.h>. Tested on i386 and x86_64, with and without --enable-systemtap.
* Fix wide char format specifier in libio/tst-bz24153.c.Stefan Liebler2019-02-062-2/+6
| | | | | | | | | | | | | | | | | | | | On big endian systems the test fails with: tst-bz24153.c:88: numeric comparison failure left: 1660944385 (0x63000001); from: ch right: 99 (0x63); from: L'c' tst-bz24153.c:90: numeric comparison failure left: 1677721601 (0x64000001); from: ch right: 100 (0x64); from: L'd' error: 2 test failures One 'char' ("%c") is stored to the 'wchar_t *': ch = 0x00000001 | 0x63000000 This patch is using "%lc" as format specifier to read a wchar_t. ChangeLog: * libio/tst-bz24153.c (wide): Use wide char format specifier.
* S390: Fix introduction of __wmemcmp and weak wmemcmp symbols.Stefan Liebler2019-02-062-1/+7
| | | | | | | | | | | | The recent commit 65f7767a914144ae303f7b9ae81865061793dcb9 has introduced __wmemcmp and the weak alias wmemcmp. This patch also introduces those symbols if glibc is build with CFLAGS="-march=z13" where the ifunc is omitted. ChangeLog: * sysdeps/s390/wmemcmp-vx.S: Add strong alias to __wmemcmp and weak alias to wmemcmp.
* Fix alignment of TLS variables for tls variant TLS_TCB_AT_TP [BZ #23403]Stefan Liebler2019-02-068-42/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The alignment of TLS variables is wrong if accessed from within a thread for architectures with tls variant TLS_TCB_AT_TP. For the main thread the static tls data is properly aligned. For other threads the alignment depends on the alignment of the thread pointer as the static tls data is located relative to this pointer. This patch adds this alignment for TLS_TCB_AT_TP variants in the same way as it is already done for TLS_DTV_AT_TP. The thread pointer is also already properly aligned if the user provides its own stack for the new thread. This patch extends the testcase nptl/tst-tls1.c in order to check the alignment of the tls variables and it adds a pthread_create invocation with a user provided stack. The test itself is migrated from test-skeleton.c to test-driver.c and the missing support functions xpthread_attr_setstack and xposix_memalign are added. ChangeLog: [BZ #23403] * nptl/allocatestack.c (allocate_stack): Align pointer pd for TLS_TCB_AT_TP tls variant. * nptl/tst-tls1.c: Migrate to support/test-driver.c. Add alignment checks. * support/Makefile (libsupport-routines): Add xposix_memalign and xpthread_setstack. * support/support.h: Add xposix_memalign. * support/xthread.h: Add xpthread_attr_setstack. * support/xposix_memalign.c: New File. * support/xpthread_attr_setstack.c: Likewise.
* arm: Use "nr" constraint for Systemtap probes [BZ #24164]Florian Weimer2019-02-054-0/+53
| | | | | | | With the default "nor" constraint, current GCC will use the "o" constraint for constants, after emitting the constant to memory. That results in unparseable Systemtap probe notes such as "-4@.L1052". Removing the "o" alternative and using "nr" instead avoids this.
* Fix assertion in malloc.c:tcache_get.Joseph Myers2019-02-042-1/+4
| | | | | | | | | | | | | | | | | | One of the warnings that appears with -Wextra is "ordered comparison of pointer with integer zero" in malloc.c:tcache_get, for the assertion: assert (tcache->entries[tc_idx] > 0); Indeed, a "> 0" comparison does not make sense for tcache->entries[tc_idx], which is a pointer. My guess is that tcache->counts[tc_idx] is what's intended here, and this patch changes the assertion accordingly. Tested for x86_64. * malloc/malloc.c (tcache_get): Compare tcache->counts[tc_idx] with 0, not tcache->entries[tc_idx].
* Remove duplicate initialization of field in nscd.Joseph Myers2019-02-042-1/+5
| | | | | | | | | | | | | | | | | | | I'm looking at the warnings from building glibc with -Wextra, to see if we could use -Wextra by default, possibly with a few of its warnings disabled, and so benefit from warnings in -Wextra but not in -Wall. (The vast bulk of the extra warnings so produced are from -Wunused-parameter -Wsign-compare -Wmissing-field-initializers -Wtype-limits, so I expect those would be disabled at least at first.) Various miscellaneous warnings show up with -Wextra that it clearly seems to make sense to fix independent of whether we add -Wextra to the normal options for building glibc. This patch fixes one: "initialized field overwritten [-Woverride-init]" in nscd. Tested for x86_64. * nscd/connections.c (reqinfo): Initialize SHUTDOWN element only once.
* Fix handling of collating elements in fnmatch (bug 17396, bug 16976)Andreas Schwab2019-02-0411-151/+217
| | | | | | This fixes the same bug in fnmatch that was fixed by commit 7e2f0d2d77 for regexp matching. As a side effect it also removes the use of an unbound VLA.
* x86-64 memcmp: Use unsigned Jcc instructions on size [BZ #24155]H.J. Lu2019-02-045-10/+111
| | | | | | | | | | | | | | | | Since the size argument is unsigned. we should use unsigned Jcc instructions, instead of signed, to check size. Tested on x86-64 and x32, with and without --disable-multi-arch. [BZ #24155] CVE-2019-7309 * NEWS: Updated for CVE-2019-7309. * sysdeps/x86_64/memcmp.S: Use RDX_LP for size. Clear the upper 32 bits of RDX register for x32. Use unsigned Jcc instructions, instead of signed. * sysdeps/x86_64/x32/Makefile (tests): Add tst-size_t-memcmp-2. * sysdeps/x86_64/x32/tst-size_t-memcmp-2.c: New test.
* <spawn.h>: Add missing nonnull attributes and __restrict qualifiersFlorian Weimer2019-02-042-24/+63
| | | | | For consistency with execve, the __argv arguments are not marked nonnull.
* elf: Implement --preload option for the dynamic linkerDavid Newall2019-02-045-7/+89
|
* testrun.sh: Exit in case of incorrect argumentMatthew Malcomson2019-02-042-0/+5
|
* time: Avoid alignment gaps in __tzfile_readFlorian Weimer2019-02-042-30/+32
| | | | | | | | | | | By ordering the suballocations by decreasing alignment, alignment gaps can be avoided. Also use __glibc_unlikely for reading the transitions and type indexes. In the 8-byte case, two reads are now needed because the transitions and type indexes are no longer adjacent. The separate call to __fread_unlocked does not matter from a performance point of view because __tzfile_read is only invoked rarely.
* time: Use struct alloc_buffer in __tzfile_readFlorian Weimer2019-02-032-49/+55
| | | | | | | The computation of tzspec_len is moved in front of the total_size computation, so that the allocation size computation and the suballocations are next to each other. Also add an assert that tzspec_len is positive when it is actually used later.
* testsuite: stdlib/isomac.c: add missing includeAurelien Jarno2019-02-032-0/+5
| | | | | | | | | | | | | | | | | When running the testsuite, building stdlib/isomac.c outputs the following warning: gcc -O -D_GNU_SOURCE -DIS_IN_build -include /home/aurel32/glibc-build/config.h isomac.c -o /home/aurel32/glibc-build/stdlib/isomac isomac.c: In function ‘get_null_defines’: isomac.c:260:3: warning: implicit declaration of function ‘close’; did you mean ‘pclose’? [-Wimplicit-function-declaration] close (fd); ^~~~~ pclose Fix that by adding the <unistd.h> include. Changelog: * stdlib/isomac.c: Include <unistd.h>.
* time: Use int, not long int, for internal GMT offsetsFlorian Weimer2019-02-034-8/+19
| | | | | | | The GMT offset can be outside the range of a 16-bit int type, which is presumably the reason why long int was used in struct tm. We cannot change struct tm, but we can change the internal type for the offset.
* libio: Use stdin consistently for input functions [BZ #24153]Florian Weimer2019-02-0311-29/+157
| | | | | The internal _IO_stdin_ variable is not updated when the application assigns to stdin, which is a GNU extension.
* manual: Document lack of conformance of sched_* functions [BZ #14829]Florian Weimer2019-02-023-27/+48
| | | | | | | | On Linux, we define _POSIX_PRIORITY_SCHEDULING, but functions such as sched_setparam and sched_setscheduler apply to individual threads, not processes. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Require GCC 6.2 or later to build glibc.Joseph Myers2019-02-016-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | As discussed during development for glibc 2.29, when we increased the required minimum GCC version for building glibc to GCC 5, working purely based on the times at which such requirements have been increased in the past it would be appropriate for glibc 2.30 to require GCC 6 (matching GCC 4.9 having been required for glibc 2.26). Naming 6.2 specifically as the minimum version then means a separate version requirement no longer needs to be specified for powerpc64le. Thus, this patch increases the minimum to 6.2, removing the documentation of the separate requirement for powerpc64le. It does not remove the powerpc64le configure test, or any __GNUC_PREREQ that could be removed as not being in installed headers or files shared with gnulib; I think such cleanups are best done separately. Tested for x86_64. * configure.ac (libc_cv_compiler_ok): Require GCC 6.2 or later. * configure: Regenerated. * manual/install.texi (Tools for Compilation): Update minimum GCC version. * INSTALL: Regenerated.
* support: Correct error message for TEST_COMPARE_STRINGFlorian Weimer2019-02-013-7/+13
| | | | It should say "string", not "blob".
* support: Handle AF_LOCAL, AF_UNSPEC in support_format_address_familyFlorian Weimer2019-02-012-0/+9
|
* manual: Update struct sockaddr_in, struct sockaddr_sin6 descriptionFlorian Weimer2019-02-012-10/+35
| | | | | Clarify the byte order of the the struct fields and document sin6_flowinfo and sin6_scope_id.
* Cleanup clock_*time includesWilco Dijkstra2019-02-017-98/+46
| | | | | | | | | | | | | | Clock_gettime, settime and getres implementations are unncessarily complex due to using defines and C file inclusion. Simplify the code by replacing the redundant defines and removing the inclusion, making it much easier to understand. No functional changes. * sysdeps/posix/clock_getres.c (__clock_getres): Cleanup. * sysdeps/unix/clock_gettime.c (__clock_gettime): Cleanup. * sysdeps/unix/clock_settime.c (__clock_settime): Cleanup. * sysdeps/unix/sysv/linux/clock_getres.c (__clock_getres): Cleanup. * sysdeps/unix/sysv/linux/clock_gettime.c (__clock_gettime): Cleanup. * sysdeps/unix/sysv/linux/clock_settime.c (__clock_settime): Cleanup.
* aarch64: Optimized memchr specific to AmpereComputing emagFeng Xue2019-02-017-3/+320
| | | | | | | | | | | | | | | | | | This version uses general register based memory instruction to load data, because vector register based is slightly slower in emag. Character-matching is performed on 16-byte (both size and alignment) memory block in parallel each iteration. * sysdeps/aarch64/memchr.S (__memchr): Rename to MEMCHR. [!MEMCHR](MEMCHR): Set to __memchr. * sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add memchr_generic and memchr_nosimd. * sysdeps/aarch64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add memchr ifuncs. * sysdeps/aarch64/multiarch/memchr.c: New file. * sysdeps/aarch64/multiarch/memchr_generic.S: Likewise. * sysdeps/aarch64/multiarch/memchr_nosimd.S: Likewise.
* aarch64: Optimized memset specific to AmpereComputing emagFeng Xue2019-02-016-2/+228
| | | | | | | | | | | | | | | | | | | This version uses general register based memory store instead of vector register based, for the former is faster than the latter in emag. The fact that DC ZVA size in emag is 64-byte, is used by IFUNC dispatch to select this memset, so that cost of runtime-check on DC ZVA size can be saved. * sysdeps/aarch64/multiarch/Makefile (sysdep_routines): Add memset_emag. * sysdeps/aarch64/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add __memset_emag to memset ifunc. * sysdeps/aarch64/multiarch/memset.c (libc_ifunc): Add IS_EMAG check for ifunc dispatch. * sysdeps/aarch64/multiarch/memset_base64.S: New file. * sysdeps/aarch64/multiarch/memset_emag.S: New file.