summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-09-14aarch64: Don't use DC ZVA for memset.glibc-2.28-amp-branchChristoph Muellner
This optimises memset for SPEC rate runs on Xgene3 processors. Provided by Feng Xue. Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
2018-08-03aarch64: Fix bits/utmp.h for GCC 8Szabolcs Nagy
The same suppression of -Wstringop-truncation warnings as in commit 7532837d7b03b3ca5b9a63d77a5bd81dd23f3d9c but for aarch64. 2018-02-21 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/bits/utmp.h (struct utmp): Use __attribute_nonstring__.
2018-08-03aarch64: Update ILP32 abilistsSzabolcs Nagy
Update libc and libm abilists with copy_file_range, mlock2, pkey_* and _FloatN related symbols. Remove pthread_self from the libpthread abilist. This will need to be merged with the initial ilp32 abilist commit. 2018-01-26 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Update.
2018-08-03aarch64: Fix jmp_buf-macros.h for ILP32.Szabolcs Nagy
The offset is different on ILP32 because __saved_mask is 4 byte aligned. 2017-11-28 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/jmp_buf-macros.h (SAVED_MASK_OFFSET): Fix for ILP32.
2018-08-03aarch64: Update ILP32 abilistsSzabolcs Nagy
Update libc and libm abilists with memfd_create and new _FloatN symbols. Remove __nis_hash and __p_secstodate from libnsl and libresolv abilists. This will need to be merged with the initial ilp32 abilist commit. 2017-11-27 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libnsl.abilist: Update. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist: Update.
2018-08-03aarch64: Update ILP32 abilistsSzabolcs Nagy
Update abilist files because a number of symbols got removed for GLIBC_2.27. ILP32 now needs separate localplt.data as well because it has no matherr PLT anymore. (Eventually this will be merged into the initial abilist commit.) 2017-09-29 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist (__nss_group_lookup): Remove. (__nss_hosts_lookup): Remove. (__nss_passwd_lookup): Remove. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist (_LIB_VERSION): Remove. (matherr): Remove. (pow10): Remove. (pow10f): Remove. (pow10l): Remove. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist (_res_opcodes): Remove. * sysdeps/unix/sysv/linux/aarch64/ilp32/localplt.data: New file.
2018-08-03aarch64: Fix ipc_perm definition for ILP32Steve Ellcey
Here is another aarch64 ILP32 patch. The mode field in ipc_perm in ILP32 should be a 16 bit field, not a 32 bit one. This was out-of-sync with what the kernel had. This was causing sysvipc/test-sysvsem to fail in ILP32 mode. 2017-09-01 Yury Norov <ynorov@caviumnetworks.com> Steve Ellcey <sellcey@cavium.com> * sysdeps/unix/sysv/linux/aarch64/bits/ipc.h (ipc_perm): Ifdef and pad the mode field for ILP32.
2018-08-03aarch64: Set ilp32 minimum linux version to 4.12Szabolcs Nagy
Mainline linux does not support ilp32 yet, but there is support for this abi since linux v4.12 in the arm64 linux repo under ilp32 staging branches. 2017-09-01 Szabolcs Nagy <szabolcs.nagy@arm.com> * sysdeps/unix/sysv/linux/aarch64/configure.ac (arch_minimum_kernel): Set to 4.12.0 on ILP32. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate.
2018-08-03Add ILP32 support to aarch64 in build-many-glibcs.pySteve Ellcey
2017-09-01 Steve Ellcey <sellcey@caviumnetworks.com> * scripts/build-many-glibcs.py (Context.add_all_configs): Add ilp32 variants of aarch64 architecture.
2018-08-03aarch64: Add ILP32 supportSteve Ellcey
Add support for the ILP32 abi variant to aarch64. 2017-09-01 Andrew Pinski <andrew.pinski@caviumnetworks.com> Yury Norov <ynorov@caviumnetworks.com> Steve Ellcey <sellcey@caviumnetworks.com> * elf/cache.c (print_entry): Add FLAG_AARCH64_LIB32. * sysdeps/aarch64/configure.ac (HAVE_AARCH64_ILP32): New define. (default-abi): Allow for ilp32 ABI. * sysdeps/aarch64/configure: Regenerate. * sysdeps/aarch64/Implies: Deleted. * sysdeps/aarch64/ilp32/Implies: New file. * sysdeps/aarch64/ilp32/Implies-after: New file. * sysdeps/aarch64/lp64/Implies: New file. * sysdeps/aarch64/lp64/Implies-after: New file. * sysdeps/aarch64/nptl/bits/pthreadtypes-arch.h (__PTHREAD_RWLOCK_INT_FLAGS_SHARED): Set to 1. * sysdeps/aarch64/preconfigure (machine): Check for ilp32/lp64. * sysdeps/aarch64/tls-macros.h (TLS_IE): Remove register specification for __result and ifdef for ILP32. * sysdeps/generic/ldconfig.h (FLAG_AARCH64_LIB32): New define. * sysdeps/unix/sysv/linux/aarch64/Implies: Remove generic and wordsize-64 entries. * sysdeps/unix/sysv/linux/aarch64/Makefile (abi-variants): Add new variants for ilp32 and ilp32_be. (abi-lp64-condition, abi-lp64_be-condition): Check for __WORDSIZE equal to 64. (abi-ilp32-condition, abi-ilp32_be-condition): New. * sysdeps/unix/sysv/linux/aarch64/configure.ac (arch_minimum_kernel): Use different value for ILP32. (LIBC_SLIBDIR_RTLDDIR): Modify for ILP32. * sysdeps/unix/sysv/linux/aarch64/configure: Regenerate. * sysdeps/unix/sysv/linux/aarch64/ilp32/Implies: New file. * sysdeps/unix/sysv/linux/aarch64/ilp32/c++-types.data: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/kernel_stat.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/stat.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/statfs.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/typesizes.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/utmp.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/bits/utmpx.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/kernel-features.h: Likewise. * sysdeps/unix/sysv/linux/aarch64/Implies: Add unix/sysv/linux/aarch64. * sysdeps/unix/sysv/linux/aarch64/ioctl.S: Move to lp64 directory. * sysdeps/unix/sysv/linux/aarch64/mmap.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/shlib-versions: Likewise. * sysdeps/unix/sysv/linux/aarch64/c++-types.data: Likewise. * sysdeps/unix/sysv/linux/aarch64/ldd-rewrite.sed: Likewise. * sysdeps/unix/sysv/linux/aarch64/ipc_priv.h (__IPC_64): Check __ILP32 when setting. * sysdeps/unix/sysv/linux/arm/readelflib.c (process_elf_file): Check for EM_AARCH64 when processing ELFCLASS32 object. * sysdeps/unix/sysv/linux/bits/fcntl-linux.h (F_GETLK, F_SETLCK, F_SETLKW): Check for __OFF_T_MATCHES_OFF64_T when defining.
2018-08-03aarch64: Add abilists for ILP32 supportSteve Ellcey
Rename lp64 abilist files and add new ilp32 abilist files with GLIBC_2.27 symbol versions. 2017-09-01 Andrew Pinski <andrew.pinski@caviumnetworks.com> Yury Norov <ynorov@caviumnetworks.com> Steve Ellcey <sellcey@caviumnetworks.com> * sysdeps/unix/sysv/linux/aarch64/ilp32/ld.abilist: New file. * sysdeps/unix/sysv/linux/aarch64/ilp32/libBrokenLocale.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libanl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libcrypt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libdl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libnsl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libresolv.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/librt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libthread_db.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ilp32/libutil.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/ld.abilist: Moved to lp64 directory. * sysdeps/unix/sysv/linux/aarch64/libBrokenLocale.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libanl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libc.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libcrypt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libdl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libnsl.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libpthread.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libresolv.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/librt.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libthread_db.abilist: Likewise. * sysdeps/unix/sysv/linux/aarch64/libutil.abilist: Likewise.
2018-08-01Update NEWS, version.h, and features.h for glibc 2.28.Carlos O'Donell
2018-08-01Synchronize translation project PO files.Carlos O'Donell
2018-08-01hurd: Fix exec usage of mach_setup_threadSamuel Thibault
Exec needs that mach_setup_thread does *not* set up TLS since it works on another task, so we have to split this into mach_setup_tls. * mach/mach.h (__mach_setup_tls, mach_setup_tls): Add prototypes. * mach/setup-thread.c (__mach_setup_thread): Move TLS setup to... (__mach_setup_tls): ... new function. (mach_setup_tls): New alias. * hurd/hurdsig.c (_hurdsig_init): Call __mach_setup_tls after __mach_setup_thread. * sysdeps/mach/hurd/profil.c (update_waiter): Likewise. * sysdeps/mach/hurd/setitimer.c (setitimer_locked): Likewise. * mach/Versions [libc] (mach_setup_tls): Add symbol. * sysdeps/mach/hurd/i386/libc.abilist (mach_setup_tls): Likewise.
2018-08-01hurd: Add missing ChangeLog entrySamuel Thibault
2018-07-31hurd: Fix startup of static binaries linked against libpthreadSamuel Thibault
* sysdeps/mach/hurd/i386/init-first.c (init1): Move ELF hdr and TLS initialization... (init): ... before initializing libpthread.
2018-07-31Update tooling versions verified to work with glibc.Carlos O'Donell
2018-07-31Update contrib.texi contributions.Carlos O'Donell
2018-07-31Update translation for be.Carlos O'Donell
2018-07-31Update SH libm-tests-ulpsAdhemerval Zanella
* sysdeps/sh/libm-test-ulps: Update.
2018-07-31Update translations for bg, de, hr, pt_BR, sv, and vi.Carlos O'Donell
2018-07-30x86/CET: Fix property note parser [BZ #23467]H.J. Lu
GNU_PROPERTY_X86_FEATURE_1_AND may not be the first property item. We need to check each property item until we reach the end of the property or find GNU_PROPERTY_X86_FEATURE_1_AND. This patch adds 2 tests. The first test checks if IBT is enabled and the second test reads the output from the first test to check if IBT is is enabled. The second second test fails if IBT isn't enabled properly. Reviewed-by: Carlos O'Donell <carlos@redhat.com> [BZ #23467] * sysdeps/unix/sysv/linux/x86/Makefile (tests): Add tst-cet-property-1 and tst-cet-property-2 if CET is enabled. (CFLAGS-tst-cet-property-1.o): New. (ASFLAGS-tst-cet-property-dep-2.o): Likewise. ($(objpfx)tst-cet-property-2): Likewise. ($(objpfx)tst-cet-property-2.out): Likewise. * sysdeps/unix/sysv/linux/x86/tst-cet-property-1.c: New file. * sysdeps/unix/sysv/linux/x86/tst-cet-property-2.c: Likewise. * sysdeps/unix/sysv/linux/x86/tst-cet-property-dep-2.S: Likewise. * sysdeps/x86/dl-prop.h (_dl_process_cet_property_note): Parse each property item until GNU_PROPERTY_X86_FEATURE_1_AND is found.
2018-07-30x86: Add tst-get-cpu-features-static to $(tests) [BZ #23458]H.J. Lu
All tests should be added to $(tests). Reviewed-by: Carlos O'Donell <carlos@redhat.com> [BZ #23458] * sysdeps/x86/Makefile (tests): Add tst-get-cpu-features-static.
2018-07-28hurd: Fix some ld.so symbol override from libcSamuel Thibault
ld.so symbols to be overriden by libc need to be extern to really get overriden. * sysdeps/mach/hurd/not-errno.h: New file. * sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
2018-07-28hurd: Fix some ld.so symbol override from libcSamuel Thibault
ld.so symbols to be overriden by libc need to be extern to really get overriden. * sysdeps/mach/hurd/dl-unistd.h (__access, __brk, __lseek, __read, __sbrk): Do not set attribute_hidden. * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly. * sysdeps/mach/hurd/i386/localplt.data: Update accordingly.
2018-07-27Update translations for cs, pl, and uk.Carlos O'Donell
2018-07-27x86/CET: Don't parse beyond the note endH.J. Lu
Simply check if "ptr < ptr_end" since "ptr" is always incremented by 8. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * sysdeps/x86/dl-prop.h (_dl_process_cet_property_note): Don't parse beyond the note end.
2018-07-27Update NEWS with ISO 14651 update information.Carlos O'Donell
2018-07-27NEWS: Avoid the words "nominative" and "genitive".Rafal Luzynski
Glibc supports two grammatical forms of month names and we keep adding the locale data which actually use this feature but those two forms are not necessarily nominative and genitive. It is better to use a more generic term. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2018-07-27Fix Linux fcntl OFD locks on unsupported kernelsAdhemerval Zanella
This patch make the OFD tests return unsupported if kernel does not support OFD locks (it was added on 3.15). Checked on a ia64-linux-gnu with Linux 3.14. * sysdeps/unix/sysv/linux/tst-ofdlocks.c: Return unsupported if kernel does not support OFD locks. * sysdeps/unix/sysv/linux/tst-ofdlocks-compat.c: Likewise.
2018-07-27Add the missing ChangeLog entry for commit be525a69a66H.J. Lu
2018-07-27hurd: Fix some ld.so symbol override from libcSamuel Thibault
ld.so symbols to be overriden by libc need to be extern to really get overriden. More fixes are needed to avoid the hidden attribute. * sysdeps/mach/hurd/Versions (libc): Make __access and __access_noerrno external so they can override the ld symbols. (ld): Make __access, __read, __sbrk, __strtoul_internal, __write, __writev, __open64, __access_noerrno extern so they can be overrided. * sysdeps/mach/hurd/i386/libc.abilist: Update accordingly. * sysdeps/mach/hurd/i386/ld.abilist: Update accordingly.
2018-07-26Update libc.pot.Carlos O'Donell
2018-07-26Update powerpc-nofpu ulps.Joseph Myers
* sysdeps/powerpc/nofpu/libm-test-ulps: Update.
2018-07-26x86: Populate COMMON_CPUID_INDEX_80000001 for Intel CPUs [BZ #23459]H.J. Lu
Reviewed-by: Carlos O'Donell <carlos@redhat.com> [BZ #23459] * sysdeps/x86/cpu-features.c (get_extended_indices): New function. (init_cpu_features): Call get_extended_indices for both Intel and AMD CPUs. * sysdeps/x86/cpu-features.h (COMMON_CPUID_INDEX_80000001): Remove "for AMD" comment.
2018-07-26x86: Correct index_cpu_LZCNT [BZ # 23456]H.J. Lu
cpu-features.h has #define bit_cpu_LZCNT (1 << 5) #define index_cpu_LZCNT COMMON_CPUID_INDEX_1 #define reg_LZCNT But the LZCNT feature bit is in COMMON_CPUID_INDEX_80000001: Initial EAX Value: 80000001H ECX Extended Processor Signature and Feature Bits: Bit 05: LZCNT available index_cpu_LZCNT should be COMMON_CPUID_INDEX_80000001, not COMMON_CPUID_INDEX_1. The VMX feature bit is in COMMON_CPUID_INDEX_1: Initial EAX Value: 01H Feature Information Returned in the ECX Register: 5 VMX Reviewed-by: Carlos O'Donell <carlos@redhat.com> [BZ # 23456] * sysdeps/x86/cpu-features.h (index_cpu_LZCNT): Set to COMMON_CPUID_INDEX_80000001.
2018-07-26Fix string/tst-xbzero-opt if build with gcc head.Stefan Liebler
On s390x, the test string/tst-xbzero-opt is failing if build with gcc head: FAIL: no clear/prepare: expected 32 got 0 FAIL: no clear/test: expected some got 0 FAIL: ordinary clear/prepare: expected 32 got 0 INFO: ordinary clear/test: found 0 patterns (memset not eliminated) PASS: explicit clear/prepare: expected 32 got 32 PASS: explicit clear/test: expected 0 got 0 In setup_no_clear / setup_ordinary_clear, GCC is omitting the memcpy loop in prepare_test_buffer. Thus count_test_patterns does not find any of the test_pattern. This patch calls use_test_buffer in order to force the compiler to really copy the pattern to buf. ChangeLog: * string/tst-xbzero-opt.c (use_test_buffer): New function. (prepare_test_buffer): Call use_test_buffer as compiler barrier.
2018-07-26htl: Use weak aliases for public symbolsFlorian Weimer
Strong definitions of flockfile, funlockfile, ftrylockfile can conflict with application symbols when linking statically.
2018-07-25Add missing localedata/en_US.UTF-8.in (Bug 23393).Carlos O'Donell
Commit 7cd7d36f1feb3ccacf476e909b115b45cdd46e77 failed to include the new testing file en_US.UTF-8.in.
2018-07-25Keep expected behaviour for [a-z] and [A-z] (Bug 23393).Carlos O'Donell
In commit 9479b6d5e08eacce06c6ab60abc9b2f4eb8b71e4 we updated all of the collation data to harmonize with the new version of ISO 14651 which is derived from Unicode 9.0.0. This collation update brought with it some changes to locales which were not desirable by some users, in particular it altered the meaning of the locale-dependent-range regular expression, namely [a-z] and [A-Z], and for en_US it caused uppercase letters to be matched by [a-z] for the first time. The matching of uppercase letters by [a-z] is something which is already known to users of other locales which have this property, but this change could cause significant problems to en_US and other similar locales that had never had this change before. Whether this behaviour is desirable or not is contentious and GNU Awk has this to say on the topic: https://www.gnu.org/software/gawk/manual/html_node/Ranges-and-Locales.html While the POSIX standard also has this further to say: "RE Bracket Expression": http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xbd_chap09.html "The current standard leaves unspecified the behavior of a range expression outside the POSIX locale. ... As noted above, efforts were made to resolve the differences, but no solution has been found that would be specific enough to allow for portable software while not invalidating existing implementations." In glibc we implement the requirement of ISO POSIX-2:1993 and use collation element order (CEO) to construct the range expression, the API internally is __collseq_table_lookup(). The fact that we use CEO and also have 4-level weights on each collation rule means that we can in practice reorder the collation rules in iso14651_t1_common (the new data) to provide consistent range expression resolution *and* the weights should maintain the expected total order. Therefore this patch does three things: * Reorder the collation rules for the LATIN script in iso14651_t1_common to deinterlace uppercase and lowercase letters in the collation element orders. * Adds new test data en_US.UTF-8.in for sort-test.sh which exercises strcoll* and strxfrm* and ensures the ISO 14651 collation remains. * Add back tests to tst-fnmatch.input and tst-regexloc.c which exercise that [a-z] does not match A or Z. The reordering of the ISO 14651 data is done in an entirely mechanical fashion using the following program attached to the bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23393#c28 It is up for discussion if the iso14651_t1_common data should be refined further to have 3 very tight collation element ranges that include only a-z, A-Z, and 0-9, which would implement the solution sought after in: https://sourceware.org/bugzilla/show_bug.cgi?id=23393#c12 and implemented here: https://www.sourceware.org/ml/libc-alpha/2018-07/msg00854.html No regressions on x86_64. Verified that removal of the iso14651_t1_common change causes tst-fnmatch to regress with: 422: fnmatch ("[a-z]", "A", 0) = 0 (FAIL, expected FNM_NOMATCH) *** ... 425: fnmatch ("[A-Z]", "z", 0) = 0 (FAIL, expected FNM_NOMATCH) ***
2018-07-25ia64: Work around incorrect type of IA64 uc_sigmaskH.J. Lu
Work around: https://sourceware.org/bugzilla/show_bug.cgi?id=21634 * sysdeps/unix/sysv/linux/ia64/tst-setcontext4.c: New file.
2018-07-25Fix ISO C threads installed header and HURD assumptionAdhemerval Zanella
Set installed NPTL header as the expected one (instead of an internal one for glibc testsuite) and add a hurd specific stdc-predef with __STDC_NO_THREADS__. Checked on both i686-linux-gnu and i686-gnu that both threads.h and stdc-predef.h are the expected ones. * nptl/threads.h: Move to ... * sysdeps/nptl/threads.h: ... here. * sysdeps/hurd/stdc-predef.h: New file.
2018-07-25x86/CET: Add a setcontext test for CETH.J. Lu
Verify that setcontext works with gaps above and below the newly allocated shadow stack. * sysdeps/unix/sysv/linux/x86/Makefile (tests): Add tst-cet-setcontext-1 if CET is enabled. (CFLAGS-tst-cet-setcontext-1.c): Add -mshstk. * sysdeps/unix/sysv/linux/x86/tst-cet-setcontext-1.c: New file.
2018-07-25Fix C11 conformance issuesAdhemerval Zanella
Remove conformace assumption of NPTL implementation for ISO C threads and revert wrong libcrypt addition on linknamespace-libs-XPG4. The i686-gnu target now shows two new conformance failures: FAIL: conform/ISO11/threads.h/conform FAIL: conform/ISO11/threads.h/linknamespace It is expected due missing HTL ISO C threads support and both conformance .out files indicates the reason ("#error "HTL does not implement ISO C threads"). Checked on i686-linux-gnu and i686-gnu. * include/threads.h: Move to ... * sysdeps/nptl/threads.h: ... here. * sysdeps/htl/threads.h: New file. * conform/Makefile (linknamespace-libs-ISO11): Use static-thread-library instead of linking libpthread. (linknamespace-libs-XPG4): Revert wrong libcrypt.a addition.
2018-07-25C11 threads: Fix timeout and locking issuesFlorian Weimer
2018-07-25x86-64/CET: Extend ucontext_t to save shadow stackH.J. Lu
This patch adds a field to ucontext_t to save shadow stack: 1. getcontext and swapcontext are updated to save the caller's shadow stack pointer and return addresses. 2. setcontext and swapcontext are updated to restore shadow stack and jump to new context directly. 3. makecontext is updated to allocate a new shadow stack and set the caller's return address to __start_context. Since makecontext allocates a new shadow stack when making a new context and kernel allocates a new shadow stack for clone/fork/vfork syscalls, we track the current shadow stack base. In setcontext and swapcontext, if the target shadow stack base is the same as the current shadow stack base, we unwind the shadow stack. Otherwise it is a stack switch and we look for a restore token. We enable shadow stack at run-time only if program and all used shared objects, including dlopened ones, are shadow stack enabled, which means that they must be compiled with GCC 8 or above and glibc 2.28 or above. We need to save and restore shadow stack only if shadow stack is enabled. When caller of getcontext, setcontext, swapcontext and makecontext is compiled with smaller ucontext_t, shadow stack won't be enabled at run-time. We check if shadow stack is enabled before accessing the extended field in ucontext_t. Reviewed-by: Carlos O'Donell <carlos@redhat.com> * sysdeps/unix/sysv/linux/x86/sys/ucontext.h (ucontext_t): Add __ssp. * sysdeps/unix/sysv/linux/x86_64/__start_context.S: Include <asm/prctl.h> and "ucontext_i.h" when shadow stack is enabled. (__push___start_context): New. * sysdeps/unix/sysv/linux/x86_64/getcontext.S: Include <asm/prctl.h>. (__getcontext): Record the current shadow stack base. Save the caller's shadow stack pointer and base. * sysdeps/unix/sysv/linux/x86_64/makecontext.c: Include <pthread.h>, <libc-pointer-arith.h> and <sys/prctl.h>. (__push___start_context): New prototype. (__makecontext): Call __push___start_context to allocate a new shadow stack, push __start_context onto the new stack as well as the new shadow stack. * sysdeps/unix/sysv/linux/x86_64/setcontext.S: Include <asm/prctl.h>. (__setcontext): Restore the target shadow stack. * sysdeps/unix/sysv/linux/x86_64/swapcontext.S: Include <asm/prctl.h>. (__swapcontext): Record the current shadow stack base. Save the caller's shadow stack pointer and base. Restore the target shadow stack. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (STACK_SIZE_TO_SHADOW_STACK_SIZE_SHIFT): New. * sysdeps/unix/sysv/linux/x86_64/ucontext_i.sym (oSSP): New.
2018-07-25Add tests for setcontext on the context from makecontextH.J. Lu
Reviewed-by: Carlos O'Donell <carlos@redhat.com> * stdlib/Makefile ((tests): Add tst-setcontext6, tst-setcontext7, tst-setcontext8 and tst-setcontext9. * stdlib/tst-setcontext6.c: New file. * stdlib/tst-setcontext7.c: Likewise. * stdlib/tst-setcontext8.c: Likewise. * stdlib/tst-setcontext9.c: Likewise.
2018-07-25Add a test for multiple setcontext callsH.J. Lu
Check multiple setcontext calls. Reviewed-by: Carlos O'Donell <carlos@redhat.com>. * stdlib/Makefile ((tests): Add tst-setcontext5. * stdlib/tst-setcontext5.c: New file.
2018-07-25Add another test for setcontextH.J. Lu
Reviewed-by: Carlos O'Donell <carlos@redhat.com> * stdlib/Makefile (tests): Add tst-setcontext4. * stdlib/tst-setcontext4.c: New file.
2018-07-25Add a test for multiple makecontext callsH.J. Lu
Check multiple makecontext calls. * stdlib/Makefile (tests): Add tst-swapcontext1. * stdlib/tst-swapcontext1.c: New test.