aboutsummaryrefslogtreecommitdiff
path: root/support/Makefile
AgeCommit message (Collapse)AuthorFilesLines
2025-04-01add ptmx support to test-containerDJ Delorie1-0/+5
2025-03-26support: Use unwinder in links-dso-program-c only with libgcc_sFlorian Weimer1-1/+1
Do not build links-dso-program-c with exception (unwinding) support if libgcc_s is not available. In this case, the unwinder may be part of libgcc.a or libgcc_eh.a, depending on how GCC was built. If the unwinder is in libgcc_eh.a only, linking links-dso-program-c failed before this change. After this change, the exception handling landing pad is only generated if libgcc_s available, avoiding an undefined _Unwind_Resume (or equivalent) symbol reference in the non-libgcc_s case. Fixes commit ffd36cc27407003a6f9efcb9c16370e3435c5b1d ("support: Use unwinder in links-dso-program-c only with libgcc_s") and commit 5dfbc3c43ecc1bcfc760a032c91bb002660051bc ("support: Link links-dso-program-c with libgcc_s only if available").
2025-03-21support: Link links-dso-program-c with libgcc_s only if availableFlorian Weimer1-1/+4
Add a configure check to detect bootstrapping builds that do not have libgcc_s. Fixes commit 3e2be87832781a29ed67f38f87c1ce3dd4c1b866 ("support: Link links-dso-program-c against libgcc_s"). Reviewed-by: Sam James <sam@gentoo.org>
2025-03-21support: Link links-dso-program-c against libgcc_sFlorian Weimer1-0/+2
If C++ support is not available, links-dso-program-c is used instead of the C++ version. The C version was not linked against libgcc_s, which meant that thread cancellation and the backtrace function did not work in containers tests in that situation. Reviewed-by: Sam James <sam@gentoo.org>
2025-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert1-1/+1
2024-11-12support: Add xdupSiddhesh Poyarekar1-0/+1
Add xdup as the error-checking version of dup for test cases. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-09-12support: Add <support/readdir.h>Florian Weimer1-0/+2
It allows to read directories using the six readdir variants without writing type-specific code or using skeleton files that are compiled four times. The readdir_r subtest for support_readdir_expect_error revealed bug 32124. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-09-05support: Add FUSE-based file system test framework to support/Florian Weimer1-0/+2
This allows to monitor the exact file system operations performed by glibc and inject errors. Hurd does not have <sys/mount.h>. To get the sources to compile at least, the same approach as in support/test-container.c is used. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-09-05support: Add <support/xdirent.h>Florian Weimer1-0/+6
Use static functions for readdir/readdir_r, so that -D_FILE_OFFSET_BITS=64 does not improperly redirect calls to the wrong implementation. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-09-03Add support/ code for checking file contentsJoseph Myers1-0/+4
For use in freopen tests, add various support/ helper interfaces for use in checking file contents. Tested for x86_64.
2024-08-16support: Use macros for *stat wrappersFlorian Weimer1-6/+2
Macros will automatically use the correct types, without having to fiddle with internal glibc macros. It's also impossible to get the types wrong due to aliasing because support_check_stat_fd and support_check_stat_path do not depend on the struct stat* types. The changes reveal some inconsistencies in tests. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-08-16support: Add the xstatx functionFlorian Weimer1-0/+1
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2024-04-10libsupport: Add xgetpeernameSergey Kolosov1-0/+1
The patch adds redirections for getpeername. Reviewed-by: Arjun Shankar <arjun@redhat.com>
2024-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert1-1/+1
2023-11-07support: Add support_set_vma_nameAdhemerval Zanella1-0/+1
Check if kernel supports prctl (PR_SET_VMA, PR_SET_VMA_ANON_NAME, ...). Reviewed-by: DJ Delorie <dj@redhat.com>
2023-07-01support: Build with exceptions and asynchronous unwind tables [BZ #30587]John David Anglin1-0/+3
Changing tst-cleanup4.c to use xread instead of read caused the nptl/tst-cleanupx4 test to fail. The routines in libsupport.a need to be built with exception handling and asynchronous unwind table support. v2: Use "CFLAGS-.oS" instead of "override CFLAGS".
2023-06-19tests: replace system by xsystemFrédéric Bérat1-0/+1
With fortification enabled, system calls return result needs to be checked, has it gets the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-06-19tests: replace read by xreadFrédéric Bérat1-0/+1
With fortification enabled, read calls return result needs to be checked, has it gets the __wur macro enabled. Note on read call removal from sysdeps/pthread/tst-cancel20.c and sysdeps/pthread/tst-cancel21.c: It is assumed that this second read call was there to overcome the race condition between pipe closure and thread cancellation that could happen in the original code. Since this race condition got fixed by d0e3ffb7a58854248f1d5e737610d50cd0a60f46 the second call seems superfluous. Hence, instead of checking for the return value of read, it looks reasonable to simply remove it. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-06-13tests: replace fgets by xfgetsFrederic Berat1-0/+1
With fortification enabled, fgets calls return result needs to be checked, has it gets the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-06-13tests: replace fread by xfreadFrederic Berat1-0/+1
With fortification enabled, fread calls return result needs to be checked, has it gets the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2023-06-02Fix all the remaining misspellings -- BZ 25337Paul Pluzhnikov1-1/+1
2023-05-23support: Reformat Makefile.Carlos O'Donell1-14/+24
Add list end markers. Sort text using scripts/sort-makefile-lines.py. No code generation changes observed in non-test binary artifacts. No regressions on x86_64 and i686.
2023-03-27support: introduce support_sysconfdir_prefixRomain Geissler1-1/+2
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-03-07posix: Fix system blocks SIGCHLD erroneously [BZ #30163]Adam Yi1-0/+2
Fix bug that SIGCHLD is erroneously blocked forever in the following scenario: 1. Thread A calls system but hasn't returned yet 2. Thread B calls another system but returns SIGCHLD would be blocked forever in thread B after its system() returns, even after the system() in thread A returns. Although POSIX does not require, glibc system implementation aims to be thread and cancellation safe. This bug was introduced in 5fb7fc96350575c9adb1316833e48ca11553be49 when we moved reverting signal mask to happen when the last concurrently running system returns, despite that signal mask is per thread. This commit reverts this logic and adds a test. Signed-off-by: Adam Yi <ayi@janestreet.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2023-03-02C2x scanf binary constant handlingJoseph Myers1-0/+1
C2x adds binary integer constants starting with 0b or 0B, and supports those constants for the %i scanf format (in addition to the %b format, which isn't yet implemented for scanf in glibc). Implement that scanf support for glibc. As with the strtol support, this is incompatible with previous C standard versions, in that such an input string starting with 0b or 0B was previously required to be parsed as 0 (with the rest of the input potentially matching subsequent parts of the scanf format string). Thus this patch adds 12 new __isoc23_* functions per long double format (12, 24 or 36 depending on how many long double formats the glibc configuration supports), with appropriate header redirection support (generally very closely following that for the __isoc99_* scanf functions - note that __GLIBC_USE (DEPRECATED_SCANF) takes precedence over __GLIBC_USE (C2X_STRTOL), so the case of GNU extensions to C89 continues to get old-style GNU %a and does not get this new feature). The function names would remain as __isoc23_* even if C2x ends up published in 2024 rather than 2023. When scanf %b support is added, I think it will be appropriate for all versions of scanf to follow C2x rules for inputs to the %b format (given that there are no compatibility concerns for a new format). Tested for x86_64 (full glibc testsuite). The first version was also tested for powerpc (32-bit) and powerpc64le (stdio-common/ and wcsmbs/ tests), and with build-many-glibcs.py.
2023-03-02support: use 64-bit time_t (bug 30111)Andreas Schwab1-0/+18
Ensure to use 64-bit time_t in the test infrastructure.
2023-01-06Update copyright dates with scripts/update-copyrightsJoseph Myers1-1/+1
2022-10-03support: Add xpthread_cond_signal wrapperYu Chien Peter Lin1-0/+1
Signed-off-by: Yu Chien Peter Lin <peterlin@andestech.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2022-09-22scripts: Enhance glibcpp to do basic macro processingFlorian Weimer1-2/+8
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-04-15support: Add xmkfifoAdhemerval Zanella1-0/+1
Wrapper support mkfifo.
2022-04-04Allow for unpriviledged nested containersDJ Delorie1-0/+1
If the build itself is run in a container, we may not be able to fully set up a nested container for test-container testing. Notably is the mounting of /proc, since it's critical that it be mounted from within the same PID namespace as its users, and thus cannot be bind mounted from outside the container like other mounts. This patch defaults to using the parent's PID namespace instead of creating a new one, as this is more likely to be allowed. If the test needs an isolated PID namespace, it should add the "pidns" command to its init script. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2022-01-28support: Add support_socket_so_timestamp_time64Adhemerval Zanella1-0/+1
Check if the socket support 64-bit network packages timestamps (SO_TIMESTAMP and SO_TIMESTAMPNS). This will be used on recvmsg and recvmmsg tests to check if the timestamp should be generated. Reviewed-by: Florian Weimer <fweimer@redhat.com>
2022-01-12Revert "support: Add support_socket_so_timestamp_time64"Adhemerval Zanella1-1/+0
This reverts commit a4cf12360fb7a8eae4fa4923763309b7f10797c3.
2022-01-12support: Add support_socket_so_timestamp_time64Adhemerval Zanella1-0/+1
Check if the socket support 64-bit network packages timestamps (SO_TIMESTAMP and SO_TIMESTAMPNS). This will be used on recvmsg and recvmmsg tests to check if the timestamp should be generated.
2022-01-01Update copyright dates with scripts/update-copyrightsPaul Eggert1-1/+1
I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
2021-10-21elf: Testing infrastructure for ld.so DSO sorting (BZ #17645)Chung-Lin Tang1-0/+6
This is the first of a 2-part patch set that fixes slow DSO sorting behavior in the dynamic loader, as reported in BZ #17645. In order to facilitate such a large modification to the dynamic loader, this first patch implements a testing framework for validating shared object sorting behavior, to enable comparison between old/new sorting algorithms, and any later enhancements. This testing infrastructure consists of a Python script scripts/dso-ordering-test.py' which takes in a description language, consisting of strings that describe a set of link dependency relations between DSOs, and generates testcase programs and Makefile fragments to automatically test the described situation, for example: a->b->c->d # four objects linked one after another a->[bc]->d;b->c # a depends on b and c, which both depend on d, # b depends on c (b,c linked to object a in fixed order) a->b->c;{+a;%a;-a} # a, b, c serially dependent, main program uses # dlopen/dlsym/dlclose on object a a->b->c;{}!->[abc] # a, b, c serially dependent; multiple tests generated # to test all permutations of a, b, c ordering linked # to main program (Above is just a short description of what the script can do, more documentation is in the script comments.) Two files containing several new tests, elf/dso-sort-tests-[12].def are added, including test scenarios for BZ #15311 and Redhat issue #1162810 [1]. Due to the nature of dynamic loader tests, where the sorting behavior and test output occurs before/after main(), generating testcases to use support/test-driver.c does not suffice to control meaningful timeout for ld.so. Therefore a new utility program 'support/test-run-command', based on test-driver.c/support_test_main.c has been added. This does the same testcase control, but for a program specified through a command-line rather than at the source code level. This utility is used to run the dynamic loader testcases generated by dso-ordering-test.py. [1] https://bugzilla.redhat.com/show_bug.cgi?id=1162810 Signed-off-by: Chung-Lin Tang <cltang@codesourcery.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-10-12Add TEST_COMPARE_STRING_WIDE to support/check.hJoseph Myers1-0/+4
I'd like to be able to test narrow and wide string interfaces, with the narrow string tests using TEST_COMPARE_STRING and the wide string tests using something analogous (possibly generated using macros from a common test template for both the narrow and wide string tests where appropriate). Add such a TEST_COMPARE_STRING_WIDE, along with functions support_quote_blob_wide and support_test_compare_string_wide that it builds on. Those functions are built using macros from common templates shared by the narrow and wide string implementations, though I didn't do that for the tests of test functions. In support_quote_blob_wide, I chose to use the \x{} delimited escape sequence syntax proposed for C2X in N2785, rather than e.g. trying to generate the end of a string and the start of a new string when ambiguity would result from undelimited \x (when the next character after such an escape sequence is valid hex) or forcing an escape sequence to be used for the next character in the case of such ambiguity. Tested for x86_64.
2021-10-01support: Add support_mutex_pi_monotonicAdhemerval Zanella1-0/+1
Returns true if Priority Inheritance support CLOCK_MONOTONIC.
2021-08-30support: Add support_wait_for_thread_exitFlorian Weimer1-1/+2
2021-08-26support: Add support_open_dev_null_rangeAdhemerval Zanella1-0/+2
It returns a range of file descriptor referring to the '/dev/null' pathname. The function takes care of restarting the open range if a file descriptor is found within the specified range and also increases RLIMIT_NOFILE if required. Checked on x86_64-linux-gnu.
2021-07-08support: Add support_stack_allocAdhemerval Zanella1-0/+1
The code to allocate a stack from xsigstack is refactored so it can be more generic. The new support_stack_alloc() also set PROT_EXEC if DEFAULT_STACK_PERMS has PF_X. This is required on some architectures (hppa for instance) and trying to access the rtld global from testsuite will require more intrusive refactoring in the ldsodefs.h header. Checked on x86_64-linux-gnu and i686-linux-gnu. I also ran tst-xsigstack on both hppa and ia64.
2021-06-24support: Add xcloneAdhemerval Zanella1-0/+1
It is a wrapper for Linux clone syscall, to simplify the call to the use only the most common arguments and remove architecture specific handling (such as ia64 different name and signature).
2021-06-22support: Add support_create_timerAdhemerval Zanella1-0/+1
It is a simple wrapper over timer_create, timer_settime, and sigaction. It will be used to check for large timeout to trigger an EINTR and to avoid use a large timeout (as for alarm()). Reviewed-by: Lukasz Majewski <lukma@denx.de>
2021-06-15libsupport: Add 64-bit time_t support for stat functionsAdhemerval Zanella1-0/+3
The patch adds redirections for xstat, xlstat, and xfstat when _TIME_BITS=64 is defined. Reviewed-by: Lukasz Majewski <lukma@denx.de> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-06-15libsupport: Add 64-bit time_t support for time functionsAdhemerval Zanella1-0/+6
The patch adds redirections for xclock_gettime, xclock_settime, timespec_add, timespec_sub, test_timespec_before_impl, test_timespec_equal_or_after_impl, support_timespec_ns, support_timespec_normalize, and support_timespec_check_in_range when _TIME_BITS=64 is defined. Co-authored-by: Lukasz Majewski <lukma@denx.de> Tested-by: Carlos O'Donell <carlos@redhat.com>
2021-05-27support: Add xpthread_attr_setaffinity_np wrapperAdhemerval Zanella1-0/+1
2021-04-12libsupport: Add support_select_normalizes_timeoutAdhemerval Zanella1-0/+1
It will be used on a select() test.
2021-04-12libsupport: Add support_select_modifies_timeoutAdhemerval Zanella1-0/+1
It will be used on a select() test.
2021-03-26S390: Don't test nanoseconds in io/tst-stat.cStefan Liebler1-0/+1
Both new tests io/tst-stat and io/tst-stat-lfs (_FILE_OFFSET_BITS=64) are comparing the nanosecond fields with the statx result. Unfortunately on s390(31bit) those fields are always zero if old KABI with non-LFS support is used. With _FILE_OFFSET_BITS=64 stat is using statx internally. As suggested by Adhemerval this patch disables the nanosecond check for s390(31bit). Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2021-03-12support: Add xpthread_killAdhemerval Zanella1-0/+1
Checked on x86_64-linux-gnu.