GNU bug report logs -
#71993
[core-updates] gnu: libfaketime: Support compilation with glibc 2.39 on i686-linux.
Previous Next
Reported by: Christopher Baines <mail <at> cbaines.net>
Date: Mon, 8 Jul 2024 08:48:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #14 received at 71993 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello!
Christopher Baines <mail <at> cbaines.net> skribis:
> gnu: nss: Don't use libfaketime on 32bit systems.
> gnu: python-pyopenssl: Don't use libfaketime on 32bit systems.
Here’s an alternate solution: getting closer to fixing libfaketime.
After this patch, there are still issues with the
‘pthread_cond_timedwait’ tests that would probably need investigation or
just plain skipping.
[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index bc341943f02..8714086be89 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -3477,6 +3477,24 @@ (define-public libfaketime
(substitute* "src/faketime.c"
(("\"date\"")
(format #f "~s" (search-input-file inputs "bin/date"))))))
+
+ #$@(if (target-64bit?)
+ #~()
+ #~((add-after 'unpack 'switch-libc-call
+ (lambda _
+ (substitute* "src/libfaketime.c"
+ (("#define _GNU_SOURCE")
+ ;; Make sure to use the 64-bit 'struct timespec' in
+ ;; replacement functions.
+ (string-append "#define _GNU_SOURCE\n"
+ "#define _FILE_OFFSET_BITS 64\n"
+ "#define _TIME_BITS 64\n"))
+ (("\"__clock_gettime\"")
+ ;; Replace '__clock_gettime64' rather than
+ ;; '__clock_gettime64' since this is what
+ ;; newly-built applications use.
+ "\"__clock_gettime64\""))))))
+
(replace 'configure
(lambda* (#:key outputs #:allow-other-keys)
(setenv "CC" #$(cc-for-target))
@@ -3495,8 +3513,14 @@ (define-public libfaketime
(add-before 'check 'pre-check
(lambda _
(substitute* "test/functests/test_exclude_mono.sh"
- (("/bin/bash") (which "bash"))))))))
- (native-inputs (list perl)) ;for tests
+ (("/bin/bash") (which "bash")))
+ #$@(if (target-64bit?)
+ #~()
+ ;; This test uses Perl to call 'clock_gettime' and fails
+ ;; for unclear reasons on i686-linux.
+ #~((delete-file
+ "test/functests/test_exclude_mono.sh"))))))))
+ (native-inputs (list perl)) ;for tests
(inputs (list coreutils-minimal))
(synopsis "Fake the system time for single applications")
(description
[Message part 3 (text/plain, inline)]
Another option: use ‘datefudge’ rather than ‘libfaketime’ for those
packages.
Ludo’.
This bug report was last modified 276 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.