On 2020-07-13 23:42, Aurelien Jarno wrote:
> control: severity -1 serious
> 
> On 2020-07-03 23:47, Aurelien Jarno wrote:
> > Package: faketime
> > Version: 0.9.7-3
> > Severity: important
> > Tags: patch upstream
> > 
> > faketime fails to build from source with glibc 2.31:
> > 
> > | gcc -c -std=gnu99 -Wall -DFAKE_STAT -Werror -Wextra timetest.c
> > | ./testframe.sh functests
> > | # Begin Test Suites in functests
> > | 
> > | # Begin functests/test_exclude_mono.sh
> > | # PLATFORM=linuxlike
> > | timetest.c: In function ‘main’:
> > | timetest.c:143:5: error: ‘ftime’ is deprecated 
> > [-Werror=deprecated-declarations]
> > |   143 |     ftime(&tb);
> > |       |     ^~~~~
> > | In file included from timetest.c:25:
> > | /usr/include/x86_64-linux-gnu/sys/timeb.h:39:12: note: declared here
> > |    39 | extern int ftime (struct timeb *__timebuf)
> > |       |            ^~~~~
> > | cc1: all warnings being treated as errors
> > | make[2]: *** [Makefile:12: timetest.o] Error 1
> > | make[2]: *** Waiting for unfinished jobs....
> > 
> > 
> > The full build log is available there:
> >  
> > http://qa-logs.debian.net/2020/06/24/faketime_0.9.7-3_unstable_glibc-exp.log
> > 
> > In glibc 2.31, the ftime function has been marked as deprecated, though
> > it's still usable. however the tests are run with -Wall -Wextra -Werror,
> > turning causing this deprecation into an error.
> > 
> > Upstream already has a fix for this issue, although the issue is wrongly
> > attributed to gcc 9 instead of glibc 2.31:
> > 
> > https://github.com/wolfcw/libfaketime/commit/f19d68ea3231f1af7a6e3913dc6d3c46f73947b2
> > 
> > This patch applies cleanly to the version in debian and correctly fixes
> > the issue. It would be nice if you can apply it relatively soon so that
> > we can start the transition.
> 
> Note that glibc 2.31 is now in unstable. I am therefore increasing the
> severity to serious.

I have prepared an NMU for faketime (versioned as 0.9.7-3.1), fixing the
build issue with glibc 2.31. You will find the diff attached. I have
uploaded it to DELAYED/7. Please feel free to tell me if I should delay
it longer or cancel it altogether.

Regards,
Aurelien

-- 
Aurelien Jarno                          GPG: 4096R/1DDD8C9B
aurel...@aurel32.net                 http://www.aurel32.net
diff -Nru faketime-0.9.7/debian/changelog faketime-0.9.7/debian/changelog
--- faketime-0.9.7/debian/changelog	2018-10-07 00:00:03.000000000 +0000
+++ faketime-0.9.7/debian/changelog	2020-07-26 11:36:15.000000000 +0000
@@ -1,3 +1,11 @@
+faketime (0.9.7-3.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Cherry-Pick fixes for the FTBFS with glibc 2.31 from upstream git
+    repository. (Closes: #964231)
+
+ -- Aurelien Jarno <aure...@debian.org>  Sun, 26 Jul 2020 13:36:15 +0200
+
 faketime (0.9.7-3) unstable; urgency=medium
 
   * Acknowledge NMU (thanks, Tobias!)
diff -Nru faketime-0.9.7/debian/patches/0007-Fix-make-test-build-failure-on-gcc-9.3.patch faketime-0.9.7/debian/patches/0007-Fix-make-test-build-failure-on-gcc-9.3.patch
--- faketime-0.9.7/debian/patches/0007-Fix-make-test-build-failure-on-gcc-9.3.patch	1970-01-01 00:00:00.000000000 +0000
+++ faketime-0.9.7/debian/patches/0007-Fix-make-test-build-failure-on-gcc-9.3.patch	2020-07-26 11:35:03.000000000 +0000
@@ -0,0 +1,31 @@
+From: Robin Linden <d...@robinlinden.eu>
+Date: Thu, 28 May 2020 23:09:07 +0200
+Subject: [PATCH] Fix make test build failure on gcc 9.3
+
+On Ubuntu 20.04 using gcc 9.3, make test fails due to a deprecated
+function (ftime) warning in combination with -Werror in timetest.c.
+Since the warning is from a test testing that the deprecated function
+can be replaced using LD_PRELOAD, I think it's reasonable to just
+silence the warning in that case.
+---
+ test/timetest.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/test/timetest.c b/test/timetest.c
+index e9aa837..c33368c 100644
+--- a/test/timetest.c
++++ b/test/timetest.c
+@@ -216,7 +216,10 @@ printf("%s", 0 == 1 ? argv[0] : "");
+     printf("time()         : Current date and time: %s", ctime(&now));
+     printf("time(NULL)     : Seconds since Epoch  : %u\n", (unsigned int)time(NULL));
+ 
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+     ftime(&tb);
++#pragma GCC diagnostic pop
+     printf("ftime()        : Current date and time: %s", ctime(&tb.time));
+ 
+     printf("(Intentionally sleeping 2 seconds...)\n");
+-- 
+2.27.0
+
diff -Nru faketime-0.9.7/debian/patches/series faketime-0.9.7/debian/patches/series
--- faketime-0.9.7/debian/patches/series	2018-10-06 23:53:11.000000000 +0000
+++ faketime-0.9.7/debian/patches/series	2020-07-26 11:35:16.000000000 +0000
@@ -4,3 +4,4 @@
 0004-libfaketime.c-fix-strncpy-issues-raised-by-gcc-8.x.patch
 0005-libfaketime.c-fix-pthread_cleanup_push-build-failure.patch
 0006-faketime.c-fix-shared_objs-array-size.patch
+0007-Fix-make-test-build-failure-on-gcc-9.3.patch

Attachment: signature.asc
Description: PGP signature

Reply via email to