]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: try to always use 64bit time support on glibc
authorThomas Weißschuh <thomas@t-8ch.de>
Sat, 15 Apr 2023 08:57:02 +0000 (10:57 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 22 Dec 2023 20:23:22 +0000 (21:23 +0100)
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
configure.ac
tools/oss-fuzz.sh

index 752d995d1b830bdd95a09b7df75d4056f2b5a255..a03f3c4428f5b362993c97c20134422f5dfc9cf7 100644 (file)
@@ -280,6 +280,8 @@ UL_SET_ARCH([HPPA], [hppa*|parisc*])
 AC_SYS_LARGEFILE
 AC_HEADER_ASSERT
 AC_STRUCT_TIMEZONE
+UL_YEAR2038_INIT
+AC_SYS_YEAR2038_RECOMMENDED
 
 dnl Don't forget to maintain alternatively allowed versions in autogen.sh!
 AM_GNU_GETTEXT_VERSION([0.18.3])
index 4aa7f23b09a898b86c6d3380bb0da4a3a9ca6535..c94a5f94df3ea91af71c57cc40c4cbea9ae25438 100755 (executable)
@@ -24,8 +24,17 @@ if [[ "$SANITIZER" == undefined ]]; then
     CXXFLAGS+=" $UBSAN_FLAGS"
 fi
 
+CONFIGURE_ARGS="--disable-all-programs --enable-libuuid --enable-libfdisk --enable-last --enable-fuzzing-engine --enable-libmount --enable-libblkid"
+
+LIBC_VERSION="$(dpkg -s libc6 | grep Version | cut -d' ' -f2)"
+
+# Ubuntu focal uses glibc 2.31 but 2.34 is necessary
+if dpkg --compare-versions "$LIBC_VERSION" 'lt' '2.34'; then
+       CONFIGURE_ARGS="$CONFIGURE_ARGS --disable-year2038"
+fi
+
 ./autogen.sh
-./configure --disable-all-programs --enable-libuuid --enable-libfdisk --enable-last --enable-fuzzing-engine --enable-libmount --enable-libblkid
+./configure $CONFIGURE_ARGS
 make -j$(nproc) V=1 check-programs
 
 for d in "$(dirname $0)"/../tests/ts/fuzzers/test_*_fuzz_files; do