summaryrefslogtreecommitdiff
path: root/configure.ac
AgeCommit message (Collapse)Author
2025-11-21configure: Only use -fno-fp-int-builtin-inexact if compiler supports itAdhemerval Zanella
Checked on x86_64-linux-gnu. Reviewed-by: Sam James <sam@gentoo.org>
2025-11-20Check if linker supports -Wl,--undefined-versionAdhemerval Zanella
Although binutils has supported --no-undefined-version for a long timei (319416359200 back in 2002), --undefined-version was only added more recently (27fb6a1a7fcd on 2.40). Reviewed-by: Sam James <sam@gentoo.org>
2025-11-17configure: Remove for redirection of built-in functionsAdhemerval Zanella
The check was initially used to define HAVE_BUILTIN_REDIRECTION, which enables or not libc_hidden_builtin_proto support. It was later removed with 3ce1f2959437e952b9db4eaeed2407424f11a4d1, making the feature mandatory. The configure check was kept as a transition knob. Current minimum gcc/linker always supports this, as well as clang with some extra care. Also, missing hidden_proto/hidden_def support is already flagged in the check-localplt test. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-14Revert __HAVE_64B_ATOMICS configure checkAdhemerval Zanella
The 53807741fb44edb8e7c094cb5e7d4ff4e92a6ec1 added a configure check for 64-bit atomic operations that were not previously enabled on some 32-bit ABIs. However, the NPTL semaphore code casts a sem_t to a new_sem and issues a 64-bit atomic operation for __HAVE_64B_ATOMICS. Since sem_t has 32-bit alignment on 32-bit architectures, this prevents the use of 64-bit atomics even if the ABI supports them. Assume 64-bit atomic support from __WORDSIZE, which maps to how glibc defines it before the broken change. Also rename __HAVE_64B_ATOMICS to USE_64B_ATOMICS to define better the flag meaning. Checked on x86_64-linux-gnu and i686-linux-gnu. Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-11-10Filter out internal abort during ld.so buildAdhemerval Zanella
clang might generate an abort call when cleanup functions (set by __attribute__ ((cleanup)) calls functions not marked as nothrow. The hurd already provides abort for the loader at sysdeps/mach/hurd/dl-sysdep.c, and adding it rtld-stubbed-symbols triggers duplicate symbols. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-10string: Check if attribute can declared after function declarationAdhemerval Zanella
Some symbols that might be auto-generated by the compiler are redefined to internal alias (for instance mempcpy to __mempcpy). However, if fortify is enabled, the fortify wrapper is define before the alias re-defined and clang warns attribute declaration must precede definition. Use an asm alias if compiler does not support it, instead of an attribute. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2025-11-04Define __HAVE_64B_ATOMICS from compiler supportWilco Dijkstra
Now that atomic builtins are used by default, we can rely on the compiler to define when to use 64-bit atomic operations. It allows the use of 64-bit atomic operations on some 32-bit ABIs where they were not previously enabled due to missing pre-processor handling: hppa, mips64n32, s390, and sparcv9. Co-authored-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Uros Bizjak <ubizjak@gmail.com> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
2025-10-21gmon: Only used -fno-tree-loop-distribute-patterns if compiler supports itAdhemerval Zanella
Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-10-21configure: Use -Wno-maybe-uninitialized iff compiler supports itAdhemerval Zanella
clang does not support the flag. Reviewed-by: Sam James <sam@gentoo.org>
2025-10-20Fix -Wno-ignored-attributes configure checkAdhemerval Zanella
The configure check always fail with clang: conftest.c:5:58: error: expected string literal as argument of 'alias' attribute 5 | extern __typeof (__foo) foo __attribute__ ((weak, alias (__foo))); | ^ conftest.c:6:58: error: expected string literal as argument of 'alias' attribute 6 | extern __typeof (__foo) bar __attribute__ ((weak, alias (foo))); | ^ Reviewed-by: Sam James <sam@gentoo.org>
2025-08-23Don't pass -c to LIBC_TRY_TEST_CC_OPTIONH.J. Lu
LIBC_TRY_TEST_CC_OPTION is defined with LIBC_TRY_CC_OPTION: dnl Test a compiler option or options with an empty input file. dnl LIBC_TRY_CC_OPTION([options], [action-if-true], [action-if-false]) AC_DEFUN([LIBC_TRY_CC_OPTION], [AS_IF([AC_TRY_COMMAND([${CC-cc} $1 -xc /dev/null -S -o /dev/null])], [$2], [$3])]) which passes -S to compiler. Unlike gcc, when -c is also passed to clang 20, we get configure:7838: clang -c -Werror -fsemantic-interposition -xc /dev/null -S -o /dev/null clang: error: argument unused during compilation: '-c' [-Werror,-Wunused-command-line-argument] Don't pass -c to LIBC_TRY_TEST_CC_OPTION since -c isn't needed. This fixes BZ #33318. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-08-23Remove test-have-mamx-tile from Makefile.inH.J. Lu
Since have-mamx-tile is for TEST_CC only as shown in sysdeps/x86_64/configure.ac: LIBC_CONFIG_VAR([have-mamx-tile], [$libc_cv_test_x86_have_amx_tile]) remove test-have-mamx-tile from Makefile.in. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-08-22Revert "Don't use -Wfree-labels/-Wmissing-parameter-name if unsupported"H.J. Lu
This reverts commit ee06d98c5b9161fcaa03c562860d6ec4a8700cd2.
2025-08-22Don't use -Wfree-labels/-Wmissing-parameter-name if unsupportedH.J. Lu
Don't use -Wfree-labels/-Wmissing-parameter-name for "make check" if they are unsupported by TEST_CC. This fixes BZ #33310. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-08-22Disable -Wimplicit-fallthrough when clang is in useH.J. Lu
Clang's -Wimplicit-fallthrough warning, which flags unannotated fall-through in switch statements, does not recognize specific comments like /* FALLTHROUGH */ for suppressing the warning, unlike GCC. Since fall through comments are used extensively in glibc, disable -Wimplicit-fallthrough when clang is in use. This fixes BZ #33312. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Collin Funk <collin.funk1@gmail.com>
2025-07-28configure.ac: fix bashisms in SFrame checksSam James
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-07-24Disable SFrame support by defaultAdhemerval Zanella
And add extra checks to enable for binutils 2.45 and if the architecture explicitly enables it. When SFrame is disabled, all the related code is also not enabled for backtrace() and _dl_find_object(), so SFrame backtracking is not used even if the binary has the SFrame segment. This patch also adds some other related fixes: * Fixed an issue with AC_CHECK_PROG_VER, where the READELF_SFRAME usage prevented specifying a different readelf through READELF environment variable at configure time. * Add an extra arch-specific internal definition, libc_cv_support_sframe, to disable --enable-sframe on architectures that have binutils but not glibc support (s390x). * Renamed the tests without the .sframe segment and move the tst-backtrace1 from pthread to debug. * Use the built compiler strip to remove the .sframe segment, instead of the system one (which might not support SFrame). Checked on x86_64-linux-gnu and aarch64-linux-gnu. Reviewed-by: Sam James <sam@gentoo.org>
2025-07-14configure: Add --enable-sframe optionClaudiu Zissulescu
Enable SFrame stack track information. The --enable-sframe option allows the glibc build to compile with SFrame stack track information. Thus, enabling glibc's backtrace to work within glibc. Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com> Reviewed-by: DJ Delorie <dj@redhat.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-06-19i386: Update ___tls_get_addr to preserve vector registersH.J. Lu
Compiler generates the following instruction sequence for dynamic TLS access: leal tls_var@tlsgd(,%ebx,1), %eax call ___tls_get_addr@PLT CALL instruction is transparent to compiler which assumes all registers, except for EFLAGS, AX, CX, and DX, are unchanged after CALL. But ___tls_get_addr is a normal function which doesn't preserve any vector registers. 1. Rename the generic __tls_get_addr function to ___tls_get_addr_internal. 2. Change ___tls_get_addr to a wrapper function with implementations for FNSAVE, FXSAVE, XSAVE and XSAVEC to save and restore all vector registers. 3. dl-tlsdesc-dynamic.h has: _dl_tlsdesc_dynamic: /* Like all TLS resolvers, preserve call-clobbered registers. We need two scratch regs anyway. */ subl $32, %esp cfi_adjust_cfa_offset (32) It is wrong to use movl %ebx, -28(%esp) movl %esp, %ebx cfi_def_cfa_register(%ebx) ... mov %ebx, %esp cfi_def_cfa_register(%esp) movl -28(%esp), %ebx to preserve EBX on stack. Fix it with: movl %ebx, 28(%esp) movl %esp, %ebx cfi_def_cfa_register(%ebx) ... mov %ebx, %esp cfi_def_cfa_register(%esp) movl 28(%esp), %ebx 4. Update _dl_tlsdesc_dynamic to call ___tls_get_addr_internal directly. 5. Add have-test-mtls-traditional to compile tst-tls23-mod.c with traditional TLS variant to verify the fix. 6. Define DL_RUNTIME_RESOLVE_REALIGN_STACK in sysdeps/x86/sysdep.h. This fixes BZ #32996. Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org> Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-05-27Turn on -Wmissing-parameter-name by default if availableFlorian Weimer
This flags another hazard for backporting changes to earlier branches. Reviewed-by: Sam James <sam@gentoo.org>
2025-05-26Turn on -Wfree-labels by default if availableFlorian Weimer
This flags a hazard for backporting changes to earlier branches. Reviewed-by: Sam James <sam@gentoo.org>
2025-05-14Raise the minimum binutils version to 2.39Stefan Liebler
The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum GCC version to 12.1 which was released in 2022. The current minimum bintuils version 2.25 was released end of 2014. This patch now raises the minimum binutils version to 2.39 which was also released in 2022. The hint for ARC is not needed anymore. In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment: PIE builds fail on binutils 2.37 and earlier, see: https://sourceware.org/bugzilla/show_bug.cgi?id=28672 This patch keeps PIE unsupported and let the machine maintainers test and enable it later. In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends are assembled correctly, which is known to be broken in binutils 2.24 and 2.25. See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383 This patch keeps the check as is and let the machine maintainers check if it still required. According to Florian Weimer: Having at least binutils 2.38 will allow us to assume that this linker bug is fixed: Bug 28743 - -z relro creats holes in the process image on GNU/Linux <https://sourceware.org/bugzilla/show_bug.cgi?id=28743> Reviewed-by: Florian Weimer <fweimer@redhat.com>
2025-03-31Raise the minimum GCC version to 12.1 [BZ #32539]H.J. Lu
For all Linux distros with glibc 2.40 which I can find, GCC 14.2 is used to compile glibc 2.40: OS GCC URL AOSC 14.2.0 https://aosc.io/ Arch Linux 14.2.0 https://archlinux.org/ ArchPOWER 14.2.0 https://archlinuxpower.org/ Artix 14.2.0 https://artixlinux.org/ Debian 14.2.0 https://www.debian.org/ Devuan 14.2.0 https://www.devuan.org/ Exherbo 14.2.0 https://www.exherbolinux.org/ Fedora 14.2.1 https://fedoraproject.org/ Gentoo 14.2.1 https://gentoo.org/ Kali Linux 14.2.0 https://www.kali.org/ KaOS 14.2.0 https://kaosx.us/ LiGurOS 14.2.0 https://liguros.gitlab.io/ Mageia 14.2.0 https://www.mageia.org/en/ Manjaro 14.2.0 https://manjaro.org/ NixOS 14.2.0 https://nixos.org/ openmamba 14.2.0 https://openmamba.org/ OpenMandriva 14.2.0 https://openmandriva.org/ openSUSE 14.2.0 https://www.opensuse.org/ Parabola 14.2.0 https://www.parabola.nu/ PLD Linux 14.2.0 https://pld-linux.org/ PureOS 14.2.0 https://pureos.net/ Raspbian 14.2.0 http://raspbian.org/ Slackware 14.2.0 http://www.slackware.com/ Solus 14.2.0 https://getsol.us/ T2 SDE 14.2.0 http://t2sde.org/ Ubuntu 14.2.0 https://www.ubuntu.com/ Wikidata 14.2.0 https://wikidata.org/ Support older versions of GCC to build glibc 2.42: 1. Need to work around bugs in older versions of GCC. 2. Can't use the new features in newer versions of GCC, which may be required for new features, like _Float16 which requires GCC 12.1 or above, in glibc, The main benefit of supporting older versions of GCC is easier backport of bug fixes to the older releases of glibc, which can be mitigated by avoiding incompatible features in newer versions of GCC for critical bug fixes. Require GCC 12.1 or newer to build. Remove GCC version check for PowerPC and s390x. TEST_CC and TEST_CXX can be used to test the glibc build with the older versions of GCC. For glibc developers who are using Linux OSes which don't come with GCC 12.1 or newer, they should build and install GCC 12.1 or newer to work on glibc. This fixes BZ #32539. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-03-21support: Link links-dso-program-c with libgcc_s only if availableFlorian Weimer
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-07configure: Fix spelling of -Wl,--no-error-execstack optionFlorian Weimer
BFD ld recognizes all -no-* options (with a single leading dash) unconditionally. Fixes commit a2bd5008a99032830add3e4005c25b61e3207112 ("Pass -Wl,--no-error-execstack for tests where -Wl,-z,execstack is used [PR32717]").
2025-03-07elf: Check if __attribute__ ((aligned (65536))) is supportedH.J. Lu
The BZ #32763 tests fail to build for MicroBlaze (which defines MAX_OFILE_ALIGNMENT to (32768*8) in GCC, so __attribute__ ((aligned (65536))) is unsupported). Add a configure-time check to enable BZ #32763 tests only if __attribute__ ((aligned (65536))) is supported. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-03-04Pass -Wl,--no-error-execstack for tests where -Wl,-z,execstack is used [PR32717]Sam James
When GNU Binutils is configured with --enable-error-execstack=yes, a handful of our tests which rely on -Wl,-z,execstack fail. Pass --Wl,--no-error-execstack to override the behaviour and get a warning instead. Bug: https://sourceware.org/PR32717 Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-02-21aarch64: Add configure checks for GCS supportYury Khrustalev
- Add check that linker supports -z gcs=... - Add checks that main and test compiler support -mbranch-protection=gcs Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
2025-01-10configure: Clear libc_cv_cc_wimplicit_fallthrough if not supportedH.J. Lu
Clear libc_cv_cc_wimplicit_fallthrough if -Wimplicit-fallthrough isn't supported. Tested with GCC 6.4.1 on x86-64. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2025-01-04Rename have-mtls-descriptor to have-test-mtls-descriptorH.J. Lu
Since have-mtls-descriptor is only used for glibc testing, rename it to have-test-mtls-descriptor. Also enable tst-gnu2-tls2-amx only if $(have-test-mtls-descriptor) == gnu2. Tested with GCC 14 and Clang 19/18/17 on x86-64. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-24stdio-common: Use clang with bugfix for bug28Dmitry Chestnykh
The issue that was the cause of hang was fixed in upstream. Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
2024-12-23configure: Improve configure output for C++ CompilerH.J. Lu
Change configure output for C++ Compiler from ... checking -finput-charset=ascii in testing... -finput-charset=ascii checking -finput-charset=ascii in testing... -finput-charset=ascii ... to ... checking -finput-charset=ascii in testing... -finput-charset=ascii checking g++ -finput-charset=ascii in testing... -finput-charset=ascii ... Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23string: Suppress Clang warnings on tester.cH.J. Lu
Add a configure check for -Wno-fortify-source to suppress Clang warnings on string/tester.c, like: tester.c:385:10: error: 'strncat' size argument is too large; destination buffer has size 50, but size argument is 99 [-Werror,-Wfortify-source] 385 | check (strncat (one, "lmn", 99) == one, 1); /* Returned value. */ Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-23Check if TEST_CC supports -Wno-restrict before using itAdhemerval Zanella
Check if TEST_CC supports -Wno-restrict before using it to avoid Clang error: error: unknown warning option '-Wno-restrict' [-Werror,-Wunknown-warning-option] Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22elf: Enable tst-dlopen-nodelete-reloc if TEST_CXX supports STB_GNU_UNIQUEH.J. Lu
tst-dlopen-nodelete-reloc requires STB_GNU_UNIQUE support so that NODELETE is propagated by do_lookup_unique. Enable it only if TEST_CXX supports STB_GNU_UNIQUE, Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22elf: Check PDE load address with non-empty text sectionH.J. Lu
Check PDE load address with non-empty text section: .globl _start _start: .globl __start .byte 0 Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22elf: Compile test modules with -fsemantic-interpositionH.J. Lu
Compiler may default to -fno-semantic-interposition. But some elf test modules must be compiled with -fsemantic-interposition to function properly. Add a TEST_CC check for -fsemantic-interposition and use it on elf test modules. This fixed FAIL: elf/tst-dlclose-lazy FAIL: elf/tst-pie1 FAIL: elf/tst-plt-rewrite1 FAIL: elf/unload4 when Clang 19 is used to test glibc. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22Add include/libc-misc.hH.J. Lu
Add include/libc-misc.h to provide miscellaneous definitions for both glibc build and test: 1. Move inhibit_stack_protector to libc-misc.h and add Clang support. 2. Add test_inhibit_stack_protector for glibc testing. 3. Move inhibit_loop_to_libcall to libc-misc.h. 4. Add test_cc_inhibit_loop_to_libcall to handle TEST_CC != CC and replace inhibit_loop_to_libcall with test_cc_inhibit_loop_to_libcall in glibc tests. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Co-Authored-By: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22Add test-config-cflags-float-store for -ffloat-storeH.J. Lu
Clang doesn't support -ffloat-store: clang: error: optimization flag '-ffloat-store' is not supported [-Werror,-Wignored-optimization-argument] Define test-config-cflags-float-store for -ffloat-store and use it in math/Makefile for testing. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22Enable execstack tests only if compiler supports trampolineH.J. Lu
Since trampoline is required to test execstack, enable execstack tests only if compiler supports trampoline. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-22Use -finput-charset=ascii only if supportedH.J. Lu
Check if -finput-charset=ascii is supported before using it in check-installed-headers.sh. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-18Check if clang and clang++ are used to test glibcH.J. Lu
Set have-test-clang to yes if clang is used to test glibc. Set have-test-clangxx to yes if clang++ is used to test glibc. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-14Don't use TEST_CXX as CXX for buildH.J. Lu
Since the C++ compiler is also used to compile links-dso-program.cc in libsupport, use TEST_CXX to get C++ headers for testing, but don't use TEST_CXX as CXX for build. Tested for m68k-linux-gnu-coldfire build and native build on x86-64. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-12Clear CXX and TEST_CXX if C++ link test failsH.J. Lu
Since the C++ compiler is used only for testing, use TEST_CXX as the C++ compiler if available. If C++ link test fails, clear both CXX and TEST_CXX so that the C++ compiler isn't used for glibc build nor test. Tested for m68k-linux-gnu-coldfire build and native build on x86-64. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-11Add TEST_CC and TEST_CXX supportH.J. Lu
Support testing glibc build with a different C compiler or a different C++ compiler with $ ../glibc-VERSION/configure TEST_CC="gcc-6.4.1" TEST_CXX="g++-6.4.1" 1. Add LIBC_TRY_CC_AND_TEST_CC_OPTION, LIBC_TRY_CC_AND_TEST_CC_COMMAND and LIBC_TRY_CC_AND_TEST_LINK to test both CC and TEST_CC. 2. Add check and xcheck targets to Makefile.in and override build compiler options with ones from TEST_CC and TEST_CXX. Tested on Fedora 41/x86-64: 1. Building with GCC 14.2.1 and testing with GCC 6.4.1 and GCC 11.2.1. 2. Building with GCC 15 and testing with GCC 6.4.1. Support for GCC versions older than GCC 6.2 may need to change the test sources. Other targets may need to update configure.ac under sysdeps and modify Makefile.in to override target build compiler options. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-12-06Remove AC_SUBST(libc_cv_mtls_descriptor)H.J. Lu
Remove AC_SUBST(libc_cv_mtls_descriptor) since there is no @libc_cv_mtls_descriptor@ and there is LIBC_CONFIG_VAR([have-mtls-descriptor], [$libc_cv_mtls_descriptor]) Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
2024-11-22elf: Handle static PIE with non-zero load address [BZ #31799]H.J. Lu
For a static PIE with non-zero load address, its PT_DYNAMIC segment entries contain the relocated values for the load address in static PIE. Since static PIE usually doesn't have PT_PHDR segment, use p_vaddr of the PT_LOAD segment with offset == 0 as the load address in static PIE and adjust the entries of PT_DYNAMIC segment in static PIE by properly setting the l_addr field for static PIE. This fixes BZ #31799. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
2024-10-01Disable _TIME_BITS if the compiler defaults to itAdhemerval Zanella
Even though building glibc with 64 bit time_t flags is not supported, and the usual way is to patch the build system to avoid it; some systems do enable it by default, and it increases the requirements to build glibc in such cases (it also does not help newcomers when trying to build glibc). The conform namespace and linknamespace tests also do not expect that flag to be set by default, so disable it as well. Checked with a build/check for major ABI and some (i386, arm, mipsel, hppa) with a toolchain that has LFS flags by default. Reviewed-by: DJ Delorie <dj@redhat.com>
2024-10-01Disable _FILE_OFFSET_BITS if the compiler defaults to itAdhemerval Zanella
Even though building glibc with LFS flags is not supported, and the the usual way is to patch the build system to avoid it [1]; some system do enable it by default, and it increases the requirements to build glibc in such cases (it also does not help newcomers when trying to build glibc). The conform namespace and linknamespace tests also do not expect that flag to be set by default, so disable it as well. Checked with a build/check for major ABI and some (i386, arm, mipsel, hppa) with a toolchain that has LFS flags by default. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=31624 Reviewed-by: DJ Delorie <dj@redhat.com>
2024-10-01Do not use -Wp to disable fortify (BZ 31928)Adhemerval Zanella
The -Wp does not work properly if the compiler is configured to enable fortify by default, since it bypasses the compiler driver (which defines the fortify flags in this case). This patch is similar to the one used on Ubuntu [1]. I checked with a build for x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu, s390x-linux-gnu, and riscv64-linux-gnu with gcc-13 that enables the fortify by default. Co-authored-by: Matthias Klose <matthias.klose@canonical.com> [1] https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/glibc/tree/debian/patches/ubuntu/fix-fortify-source.patch Reviewed-by: DJ Delorie <dj@redhat.com>