From 3f1932ed2e6b643848ea7a42f9f15ed80552befb Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Tue, 10 Sep 2024 09:22:18 -0300 Subject: Disable _FILE_OFFSET_BITS if the compiler defaults to it 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 --- configure.ac | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5af742ce41..160c863416 100644 --- a/configure.ac +++ b/configure.ac @@ -1564,6 +1564,19 @@ AC_SUBST(no_fortify_source) AC_SUBST(fortify_source) LIBC_CONFIG_VAR([supported-fortify], [$libc_cv_supported_fortify_source]) +dnl Check if compiler define _FILE_OFFSET_BITS by default +AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[ +#ifndef _FILE_OFFSET_BITS +# error _FILE_OFFSET_BITS not defined +#endif]])], + [libc_cv_compiler_default_file_offset_bits=yes], + [libc_cv_compiler_default_file_offset_bits=no]) +AS_IF([test "$libc_cv_compiler_default_file_offset_bits" = yes], + [no_file_offset_bits_source="-U_FILE_OFFSET_BITS"]) +AC_SUBST(no_file_offset_bits_source) +LIBC_CONFIG_VAR([no-file-offset-bits-source], [$no_file_offset_bits_source]) + + dnl Starting with binutils 2.35, GAS can attach multiple symbol versions dnl to one symbol (PR 23840). AC_CACHE_CHECK(whether the assembler requires one version per symbol, -- cgit v1.2.3