about summary refs log tree commit diff
path: root/scripts
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates not handled by scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
| | | | | | I've updated copyright dates in glibc for 2024. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files.
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-0136-36/+36
|
* Move CVE information into advisories directorySiddhesh Poyarekar2023-12-071-0/+41
| | | | | | | | | | | | | | | | | | | One of the requirements to becoming a CVE Numbering Authority (CNA) is to publish advisories. Do this by maintaining a file for each CVE fixed in the advisories directory in the source tree. Links to the advisories can then be shared as: https://sourceware.org/git/?p=glibc.git;a=blob_plain;f=advisories/GLIBC-SA-YYYY-NNNN The file format at the moment is rudimentary and derives from the git commit format, i.e. a subject line and a potentially multi-paragraph description and then tags to describe some meta information. This is a loose format at the moment and could change as we evolve this. Also add a script process-fixed-cves.sh that processes these advisories and generates a list to add to NEWS at release time. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* elf: Add a way to check if tunable is set (BZ 27069)Adhemerval Zanella2023-11-291-2/+2
| | | | | | | | | | | The patch adds two new macros, TUNABLE_GET_DEFAULT and TUNABLE_IS_INITIALIZED, here the former get the default value with a signature similar to TUNABLE_GET, while the later returns whether the tunable was set by the environment variable. Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com> Tested-by: Zhangfei Gao <zhangfei.gao@linaro.org>
* elf: Ignore GLIBC_TUNABLES for setuid/setgid binariesAdhemerval Zanella2023-11-211-16/+2
| | | | | | | | | | | | | | | | | | | | The tunable privilege levels were a retrofit to try and keep the malloc tunable environment variables' behavior unchanged across security boundaries. However, CVE-2023-4911 shows how tricky can be tunable parsing in a security-sensitive environment. Not only parsing, but the malloc tunable essentially changes some semantics on setuid/setgid processes. Although it is not a direct security issue, allowing users to change setuid/setgid semantics is not a good security practice, and requires extra code and analysis to check if each tunable is safe to use on all security boundaries. It also means that security opt-in features, like aarch64 MTE, would need to be explicit enabled by an administrator with a wrapper script or with a possible future system-wide tunable setting. Co-authored-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: DJ Delorie <dj@redhat.com>
* Format test results closer to what DejaGnu doesMaxim Kuvyrkov2023-11-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The years of dealing with Binutils, GCC and GDB test results made the community create good tools for comparison and analysis of DejaGnu test results. This change allows to use those tools for Glibc's test results as well. The motivation for this change is Linaro's pre-commit testers, which use a modified version of GCC's validate_failures.py to create test xfail lists with baseline failures and known flaky tests. See below links for an example xfails file (only one link is supposed to work at any given time): - https://ci.linaro.org/job/tcwg_glibc_check--master-arm-build/lastSuccessfulBuild/artifact/artifacts/artifacts.precommit/sumfiles/xfails.xfail/*view*/ - https://ci.linaro.org/job/tcwg_glibc_check--master-arm-build/lastSuccessfulBuild/artifact/artifacts/sumfiles/xfails.xfail/*view*/ Specifacally, this patch changes format of glibc's .sum files from ... <cut> FAIL: elf/test1 PASS: string/test2 </cut> ... to ... <cut> === glibc tests === Running elf ... FAIL: elf/test1 Running string ... PASS: string/test2 </cut>. And output of "make check" from ... <cut> FAIL: elf/test1 </cut> ... to ... <cut> FAIL: elf/test1 === Summary of results === 1 FAIL 1 PASS </cut>. Signed-off-by: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* Use Linux 6.6 in build-many-glibcs.pyJoseph Myers2023-10-311-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.6. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* crypt: Remove libcrypt supportAdhemerval Zanella2023-10-302-5/+2
| | | | | | | | | | | | | | | | | | All the crypt related functions, cryptographic algorithms, and make requirements are removed, with only the exception of md5 implementation which is moved to locale folder since it is required by localedef for integrity protection (libc's locale-reading code does not check these, but localedef does generate them). Besides thec code itself, both internal documentation and the manual is also adjusted. This allows to remove both --enable-crypt and --enable-nss-crypt configure options. Checked with a build for all affected ABIs. Co-authored-by: Zack Weinberg <zack@owlfolio.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* sparc: Remove optimize md5, sha256, and sha512Adhemerval Zanella2023-10-301-3/+1
| | | | | | | | | | The libcrypt was maked to be phase out on 2.38, and a better project already exist that provide both compatibility and better API (libxcrypt). The sparc optimizations add the burden to extra build-many-glibcs.py configurations. Checked on sparc64 and sparcv9. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* build-many-glibcs: Fix traililing whitespaceAdhemerval Zanella2023-10-301-3/+3
| | | | From commit d846c2838942297c9644f2f38bdad0fb88f42245.
* Remove 'grp' and merge into 'nss' and 'posix'Arjun Shankar2023-10-241-1/+1
| | | | | | | | | | | | | | The majority of grp routines are entry points for nss functionality. This commit removes the 'grp' subdirectory and moves all nss-relevant functionality and all tests to 'nss', and the 'setgroups' stub into 'posix' (alongside the 'getgroups' stub). References to grp/ are accordingly changed. In addition, compat-initgroups.c, a fallback implementation of initgroups is renamed to initgroups-fallback.c so that the build system does not confuse it for nss_compat/compat-initgroups.c. Build time improves very slightly; e.g. down from an average of 45.5s to 44.5s on an 8-thread mobile x86_64 CPU. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* build-many-glibcs: Check for required system toolsDJ Delorie2023-10-091-0/+96
| | | | | | | | | | | Notes for future devs: * Add tools as you find they're needed, with version 0,0 * Bump version when you find an old tool that doesn't work * Don't add a version just because you know it works Co-authored-by: Lukasz Majewski <lukma@denx.de> Co-authored-by: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
* Use Linux 6.5 in build-many-glibcs.pyJoseph Myers2023-09-081-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.5. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Use GMP 6.3.0, MPFR 4.2.1 in build-many-glibcs.pyJoseph Myers2023-08-291-2/+2
| | | | | | | | This patch makes build-many-glibcs.py use the new GMP 6.3.0 and MPFR 4.2.1 releases. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Use binutils 2.41 branch in build-many-glibcs.pyJoseph Myers2023-08-081-1/+1
| | | | | | | This patch makes build-many-glibcs.py use binutils 2.41 branch. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* scripts: Fix fortify checks if compiler does not support _FORTIFY_SOURCE=3Adhemerval Zanella2023-07-201-4/+7
| | | | | | | | | | | | The 30379efad1 added _FORTIFY_SOURCE checks without check if compiler does support all used fortify levels. This patch fixes it by first checking at configure time the maximum support fortify level and using it instead of a pre-defined one. Checked on x86_64 with gcc 11, 12, and 13. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Tested-by: Florian Weimer <fweimer@redhat.com>
* configure: Disable building libcrypt by defaultSiddhesh Poyarekar2023-07-201-2/+6
| | | | | | | | | | | | We mentioned eventual dropping of libcrypt in the 2.28 NEWS. Actually put that plan in motion by first disabling building libcrypt by default. note in NEWS that the library will be dropped completely in a future release. Also add a couple of builds into build-many-glibcs.py. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Andreas K. Hüttel <dilfridge@gentoo.org>
* scripts: Add fortify checks on installed headersAdhemerval Zanella2023-07-191-13/+23
| | | | | | | | | | The _FORTIFY_SOURCE is used as default by some system compilers, and there is no way to check if some fortify extension does not trigger any conformance issue. Checked on x86_64-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Allow glibc to be built with _FORTIFY_SOURCEFrédéric Bérat2023-07-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add --enable-fortify-source option. It is now possible to enable fortification through a configure option. The level may be given as parameter, if none is provided, the configure script will determine what is the highest level possible that can be set considering GCC built-ins availability and set it. If level is explicitly set to 3, configure checks if the compiler supports the built-in function necessary for it or raise an error if it isn't. If the configure option isn't explicitly enabled, it _FORTIFY_SOURCE is forcibly undefined (and therefore disabled). The result of the configure checks are new variables, ${fortify_source} and ${no_fortify_source} that can be used to appropriately populate CFLAGS. A dedicated patch will follow to make use of this variable in Makefiles when necessary. Updated NEWS and INSTALL. Adding dedicated x86_64 variant that enables the configuration. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Use Linux 6.4 in build-many-glibcs.pyJoseph Myers2023-06-271-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.4. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Add lint-makefiles Makefile linting test.Carlos O'Donell2023-06-021-0/+74
| | | | | | | | | | | | | | We add a 'make check' test that lints all Makefiles in the source directory of the glibc build. This linting test ensures that the lines in all Makefiles will be sorted correctly as developers creates patches. It is added to 'make check' because it is light-weight and supports the existing developer workflow The test adds ~3s to a 'make check' execution. No regressions on x86_64 and i686. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* Fix a few more typos I missed in previous round -- BZ 25337Paul Pluzhnikov2023-06-021-3/+3
|
* Fix all the remaining misspellings -- BZ 25337Paul Pluzhnikov2023-06-024-6/+6
|
* scripts: sort-makefile-lines.pyCarlos O'Donell2023-05-181-1/+4
| | | | | | | We must return < 0, 0, or > 0 as the result of the comparison function for cmp_to_key() to work correctly across all comparisons. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* scripts: Add sort-makefile-lines.py to sort Makefile variables.Carlos O'Donell2023-05-101-0/+160
| | | | | | | | | | | | The scripts/sort-makefile-lines.py script sorts Makefile variables according to project expected order. The script can be used like this: $ scripts/sort-makefile-lines.py < elf/Makefile > elf/Makefile.tmp $ mv elf/Makefile.tmp elf/Makefile Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* hurd: Enable x86_64 build scriptSamuel Thibault2023-05-021-0/+3
| | | | This now passes crossbuilds.
* Use GCC 13 branch, Linux 6.3 in build-many-glibcs.pyJoseph Myers2023-05-021-2/+2
| | | | | | | | This patch updates build-many-glibcs.py to use Linux 6.3 and GCC 13 branch by default. Tested with build-many-glibcs.py (host-libraries, compilers and glibc builds).
* mach: Disable 32bit compatibility modeSamuel Thibault2023-05-011-0/+1
| | | | | 32bit compatibility is the default for now with 64bit gnumach, until 64bit userland is ready. Here we however want native 64bit userland anyway.
* build-many-glibcs.py: --disable-gcov for gcc-firstJan-Benedict Glaw2023-04-191-0/+1
| | | | | | | | This is also being tracked n GCC [1]. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100289
* Remove --enable-tunables configure optionAdhemerval Zanella Netto2023-03-291-1/+0
| | | | | | | | | | | | And make always supported. The configure option was added on glibc 2.25 and some features require it (such as hwcap mask, huge pages support, and lock elisition tuning). It also simplifies the build permutations. Changes from v1: * Remove glibc.rtld.dynamic_sort changes, it is orthogonal and needs more discussion. * Cleanup more code. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Remove --disable-experimental-malloc optionAdhemerval Zanella2023-03-291-1/+0
| | | | | | | | | | | | | | | | | | | It is the default since 2.26 and it has bitrotten over the years, By using it multiple malloc tests fails: FAIL: malloc/tst-memalign-2 FAIL: malloc/tst-memalign-2-malloc-hugetlb1 FAIL: malloc/tst-memalign-2-malloc-hugetlb2 FAIL: malloc/tst-memalign-2-mcheck FAIL: malloc/tst-mxfast-malloc-hugetlb1 FAIL: malloc/tst-mxfast-malloc-hugetlb2 FAIL: malloc/tst-tcfree2 FAIL: malloc/tst-tcfree2-malloc-hugetlb1 FAIL: malloc/tst-tcfree2-malloc-hugetlb2 Checked on x86_64-linux-gnu. Reviewed-by: DJ Delorie <dj@redhat.com>
* Use Linux 6.2 in build-many-glibcs.pyJoseph Myers2023-02-221-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.2. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Use binutils 2.40 branch in build-many-glibcs.pyJoseph Myers2023-01-271-1/+1
| | | | | | | This patch makes build-many-glibcs.py use binutils 2.40 branch. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* Use MPFR 4.2.0, MPC 1.3.1 in build-many-glibcs.pyJoseph Myers2023-01-271-2/+2
| | | | | | | | This patch makes build-many-glibcs.py use the new MPFR 4.2.0 and MPC 1.3.1 releases. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* scripts/build-many-glibcs.py: Remove unused RANLIB and STRIP optionAdhemerval Zanella2023-01-121-2/+0
| | | | Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* configure: Move nm, objdump, and readelf to LIBC_PROG_BINUTILSAdhemerval Zanella2023-01-121-3/+0
| | | | | | Allow the variables to be overriden or have the defaults come from the compiler currently in use. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* configure: Allow user override LD, AR, OBJCOPY, and GPROFAdhemerval Zanella2023-01-111-3/+0
| | | | | | | | | | | | The only way to override LD, AR, OBJCOPY, and GPROF is through --with-binutils (setting the environments variables on configure is overridden by LIBC_PROG_BINUTILS). The build-many-glibcs.py (bmg) glibcs option generates a working config, but not fully concise (some tools will be set from environment variable, while other will be set from $CC --print-prog-name). So remove the environment variable set to always use the "$CC --print-prog-name". Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates not handled by scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
| | | | | | I've updated copyright dates in glibc for 2023. This is the patch for the changes not generated by scripts/update-copyrights and subsequent build / regeneration of generated files.
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-0634-34/+34
|
* Simplify scripts/cross-test-ssh.sh configuration.Carlos O'Donell2022-12-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | With modern ssh clients and daemons it is required to use AcceptEnv and SendEnv configuration options to correctly support testing the DSO sort ordering tests. This requirement is present because scripts/dso-ordering-test.py injects GLIBC_TUNABLES to the left of the ${test_wrapper_env} and so it must both be sent by the ssh client and accepted by the ssh daemon. This requirement is removed in this change and the injected GLIBC_TUNABLES is placed after ${run_program_env} and so still correctly provides the override that the test requires. This is similar to existing tests like elf/tst-pathopt.sh, elf/tst-rtld-load-self.sh, and locale/tst-locale-locpath.sh. Tested that it fixes two failures when cross-testing on aarch64 with scripts/cross-test-ssh.sh and an ssh client and daemon that do not pass GLIBC_TUNABLES. Without this fix such a configuration will report the following failures (since the GLIBC_TUNABLES not preserved): FAIL: elf/tst-bz15311 FAIL: elf/tst-bz28937 Tested without regression on native x86_64 and aarch64 builds. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* Use Linux 6.1 in build-many-glibcs.pyJoseph Myers2022-12-191-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.1. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* configure: Remove AS checkAdhemerval Zanella2022-12-061-1/+0
| | | | | | The assembler is not issued directly, but rather always through CC wrapper. The binutils version check if done with LD instead. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* ARC: update definitions in elf/elf.hShahab Vahedi2022-11-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While porting ARCv2 to elfutils [1], it was brought up that the necessary changes to the project's libelf/elf.h must come from glibc, because they sync it from glibc [2]. Therefore, this patch is to update ARC entries in elf/elf.h. The majority of the update is about adding new definitions, specially for the relocations. However, there is one rename, one deletion, and one change: - R_ARC_JUMP_SLOT renamed to R_ARC_JMP_SLOT to match binutils. - R_ARC_B26 removed because it is unused and deprecated. - R_ARC_TLS_DTPOFF_S9 changed from 0x4a to the correct value 0x49. Finally, a specific SHT class for ARC has been added to glibcelf.py. Else, it would result in a collision: _register_elf_h(Sht, ranges=True, File "/src/glibc/scripts/glibcelf.py", line x, in _register_elf_h raise ValueError('duplicate value {}: {}, {}'.format( ValueError: duplicate value 1879048193: SHT_ARC_ATTRIBUTES, SHT_X86_64_UNWIND [1] https://sourceware.org/pipermail/elfutils-devel/2022q4/005530.html [2] https://sourceware.org/pipermail/elfutils-devel/2022q4/005548.html No regression has been observed after applying this patch. Below follows the result: UNSUPPORTED: crypt/cert UNSUPPORTED: elf/tst-audit22 FAIL: elf/tst-audit25a FAIL: elf/tst-audit25b FAIL: elf/tst-bz15311 FAIL: elf/tst-bz28937 FAIL: elf/tst-dlmopen4 UNSUPPORTED: elf/tst-dlopen-self-container UNSUPPORTED: elf/tst-dlopen-tlsmodid-container UNSUPPORTED: elf/tst-glibc-hwcaps-prepend-cache UNSUPPORTED: elf/tst-ldconfig-bad-aux-cache UNSUPPORTED: elf/tst-ldconfig-ld_so_conf-update UNSUPPORTED: elf/tst-pldd UNSUPPORTED: elf/tst-preload-pthread-libc XPASS: elf/tst-protected1a XPASS: elf/tst-protected1b FAIL: elf/tst-tls-allocation-failure-static-patched FAIL: elf/tst-tls1 FAIL: elf/tst-tls3 FAIL: elf/tst-tlsalign-extern UNSUPPORTED: elf/tst-valgrind-smoke UNSUPPORTED: grp/tst-initgroups1 UNSUPPORTED: grp/tst-initgroups2 UNSUPPORTED: io/tst-getcwd-smallbuff UNSUPPORTED: locale/tst-localedef-path-norm FAIL: localedata/sort-test UNSUPPORTED: localedata/tst-localedef-hardlinks FAIL: malloc/tst-malloc-thread-fail-malloc-check FAIL: malloc/tst-malloc_info-malloc-check UNSUPPORTED: math/test-fesetexcept-traps UNSUPPORTED: math/test-fexcept-traps UNSUPPORTED: math/test-nearbyint-except UNSUPPORTED: math/test-nearbyint-except-2 UNSUPPORTED: misc/tst-adjtimex UNSUPPORTED: misc/tst-clock_adjtime FAIL: misc/tst-misalign-clone FAIL: misc/tst-misalign-clone-internal UNSUPPORTED: misc/tst-ntp_adjtime UNSUPPORTED: misc/tst-pkey UNSUPPORTED: misc/tst-rseq UNSUPPORTED: misc/tst-rseq-disable UNSUPPORTED: misc/tst-syslog UNSUPPORTED: misc/tst-ttyname FAIL: nptl/test-cond-printers FAIL: nptl/test-condattr-printers FAIL: nptl/test-mutex-printers FAIL: nptl/test-mutexattr-printers FAIL: nptl/test-rwlock-printers FAIL: nptl/test-rwlockattr-printers UNSUPPORTED: nptl/tst-pthread-gdb-attach UNSUPPORTED: nptl/tst-pthread-gdb-attach-static UNSUPPORTED: nptl/tst-pthread-getattr UNSUPPORTED: nptl/tst-rseq-nptl UNSUPPORTED: nss/tst-nss-compat1 UNSUPPORTED: nss/tst-nss-db-endgrent UNSUPPORTED: nss/tst-nss-db-endpwent UNSUPPORTED: nss/tst-nss-files-hosts-long UNSUPPORTED: nss/tst-nss-gai-actions UNSUPPORTED: nss/tst-nss-test3 UNSUPPORTED: nss/tst-reload1 UNSUPPORTED: nss/tst-reload2 UNSUPPORTED: posix/bug-ga2 UNSUPPORTED: posix/bug-ga2-mem FAIL: posix/globtest UNSUPPORTED: posix/tst-vfork3 UNSUPPORTED: posix/tst-vfork3-mem UNSUPPORTED: resolv/mtrace-tst-leaks2 UNSUPPORTED: resolv/tst-leaks2 UNSUPPORTED: resolv/tst-resolv-ai_idn UNSUPPORTED: resolv/tst-resolv-ai_idn-latin1 UNSUPPORTED: resolv/tst-resolv-res_init UNSUPPORTED: resolv/tst-resolv-res_init-thread UNSUPPORTED: rt/tst-bz28213 UNSUPPORTED: rt/tst-mqueue1 UNSUPPORTED: rt/tst-mqueue10 UNSUPPORTED: rt/tst-mqueue2 UNSUPPORTED: rt/tst-mqueue3 UNSUPPORTED: rt/tst-mqueue4 UNSUPPORTED: rt/tst-mqueue5 UNSUPPORTED: rt/tst-mqueue6 UNSUPPORTED: rt/tst-mqueue8 UNSUPPORTED: rt/tst-mqueue8x UNSUPPORTED: rt/tst-mqueue9 UNSUPPORTED: stdlib/test-bz22786 UNSUPPORTED: stdlib/tst-system UNSUPPORTED: string/test-bcopy UNSUPPORTED: string/test-memmove UNSUPPORTED: string/tst-memmove-overflow UNSUPPORTED: string/tst-strerror UNSUPPORTED: string/tst-strsignal UNSUPPORTED: time/tst-clock_settime UNSUPPORTED: time/tst-settimeofday Summary of test results: 21 FAIL 4184 PASS 69 UNSUPPORTED 16 XFAIL 2 XPASS Signed-off-by: Shahab Vahedi <shahab@synopsys.com> Signed-off-by: Vineet Gupta <vineet.gupta@linux.dev>
* scripts: Add "|" operator support to glibcpp's parsingShahab Vahedi2022-11-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | From the tests point of view, this is a necessary step for another patch [1] and allows parsing macros such as "#define A | B". Without it, a few tests [2] choke when the other patch [1] is applied: /src/glibc/scripts/../elf/elf.h:4167: error: uninterpretable macro token sequence: ( EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK ) Traceback (most recent call last): File "/src/glibc/elf/tst-glibcelf.py", line 23, in <module> import glibcelf File "/src/glibc/scripts/glibcelf.py", line 226, in <module> _elf_h = _parse_elf_h() ^^^^^^^^^^^^^^ File "/src/glibc/scripts/glibcelf.py", line 223, in _parse_elf_h raise IOError('parse error in elf.h') OSError: parse error in elf.h [1] ARC: update definitions in elf/elf.h https://sourceware.org/pipermail/libc-alpha/2022-November/143503.html [2] tst-glibcelf, tst-relro-ldso, and tst-relro-libc Reviewed-by: Florian Weimer <fweimer@redhat.com> Signed-off-by: Shahab Vahedi <shahab@synopsys.com>
* scripts/glibcelf.py: Properly report <elf.h> parsing failuresFlorian Weimer2022-11-031-1/+1
| | | | | | | | | | | | | | | | | Without this change, parse failures result in an exception: Traceback (most recent call last): File "tst-glibcelf.py", line 23, in <module> import glibcelf File "/path/to/git/scripts/glibcelf.py", line 226, in <module> _elf_h = _parse_elf_h() File "/path/to/git/scripts/glibcelf.py", line 221, in _parse_elf_h result = glibcpp.macro_eval(glibcpp.macro_definitions(tokens), reporter) File "/path/to/git/scripts/glibcpp.py", line 379, in macro_eval reporter.error(md.line, 'macro {} redefined'.format(md.name)) File "/path/to/git/scripts/glibcelf.py", line 214, in error errors += 1 UnboundLocalError: local variable 'errors' referenced before assignment
* scripts: Use bool in tunables initializerSzabolcs Nagy2022-10-281-1/+1
| | | | | | | The initializer for a tunable_t set the bool initialized flag to NULL. This causes a build failure when pointer to bool conversion warns. Reviewed-by: Florian Weimer <fweimer@redhat.com>
* scripts/localplt.awk: Handle DT_JMPREL with empty PLT (for C-SKY)Florian Weimer2022-10-271-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On csky-linux-gnuabiv2, binutils 2.33 produces a DT_JMPREL entry for the dynamic loader if it does not contain any PLT relocations: Dynamic section at offset 0x1df48 contains 19 entries: Tag Type Name/Value 0x0000000e (SONAME) Library soname: [ld-linux-cskyv2-hf.so.1] 0x00000004 (HASH) 0xd4 0x6ffffef5 (GNU_HASH) 0x1a8 0x00000005 (STRTAB) 0x4ac 0x00000006 (SYMTAB) 0x28c 0x0000000a (STRSZ) 527 (bytes) 0x0000000b (SYMENT) 16 (bytes) 0x00000003 (PLTGOT) 0x1f000 0x00000002 (PLTRELSZ) 0 (bytes) 0x00000014 (PLTREL) RELA 0x00000017 (JMPREL) 0xaa4 0x00000007 (RELA) 0x75c 0x00000008 (RELASZ) 840 (bytes) 0x00000009 (RELAENT) 12 (bytes) 0x6ffffffc (VERDEF) 0x700 0x6ffffffd (VERDEFNUM) 3 0x6ffffff0 (VERSYM) 0x6bc 0x6ffffff9 (RELACOUNT) 68 0x00000000 (NULL) 0x0 This confuses the script: Unexpected output from check-localplt: …/elf/ld.so.jmprel: *** DT_JMPREL does not match any section's address This commit changes the script to record the DT_PLTRELSZ value and reject DT_JMPREL values not a section boundary only if DT_PLTRELSZ is present with a non-zero value. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* Use Linux 6.0 in build-many-glibcs.pyJoseph Myers2022-10-041-1/+1
| | | | | | | This patch makes build-many-glibcs.py use Linux 6.0. Tested with build-many-glibcs.py (host-libraries, compilers and glibcs builds).
* elf: Extract glibcelf constants from <elf.h>Florian Weimer2022-09-221-641/+375
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The need to maintain elf/elf.h and scripts/glibcelf.py in parallel results in a backporting hazard: they need to be kept in sync to avoid elf/tst-glibcelf consistency check failures. glibcelf (unlike tst-glibcelf) does not use the C implementation to extract constants. This applies the additional glibcpp syntax checks to <elf.h>. This changereplaces the types derived from Python enum types with custom types _TypedConstant, _IntConstant, and _FlagConstant. These types have fewer safeguards, but this also allows incremental construction and greater flexibility for grouping constants among the types. Architectures-specific named constants are now added as members into their superclasses (but value-based lookup is still restricted to generic constants only). Consequently, check_duplicates in elf/tst-glibcelf has been adjusted to accept differently-named constants of the same value if their subtypes are distinct. The ordering check for named constants has been dropped because they are no longer strictly ordered. Further test adjustments: Some of the type names are different. The new types do not support iteration (because it is unclear whether iteration should cover the all named values (including architecture-specific constants), or only the generic named values), so elf/tst-glibcelf now uses by_name explicit (to get all constants). PF_HP_SBP and PF_PARISC_SBP are now of distinct types (PfHP and PfPARISC), so they are how both present on the Python side. EM_NUM and PT_NUM are filtered (which was an oversight in the old conversion). The new version of glibcelf should also be compatible with earlier Python versions because it no longer depends on the enum module and its advanced features. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
* scripts: Enhance glibcpp to do basic macro processingFlorian Weimer2022-09-221-0/+317
| | | | Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>