Source: purelibc
Version: 0.4.1-2
Severity: important
Tags: patch upstream

purelibc fails to build from source with glibc 2.31:

| /bin/bash ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.   
-Wdate-time -D_FORTIFY_SOURCE=2 -g -ggdb -D_GNU_SOURCE -g -Wall -O0 -c -o 
libpurelibc_la-syscalls.lo `test -f 'syscalls.c' || echo './'`syscalls.c
| libtool: compile:  gcc -DHAVE_CONFIG_H -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g 
-ggdb -D_GNU_SOURCE -g -Wall -O0 -c syscalls.c  -fPIC -DPIC -o 
.libs/libpurelibc_la-syscalls.o
| syscalls.c:864:5: error: conflicting types for ‘gettimeofday’
|   864 | int gettimeofday(struct timeval *tv, struct timezone *tz){
|       |     ^~~~~~~~~~~~
| In file included from syscalls.c:33:
| /usr/include/x86_64-linux-gnu/sys/time.h:66:12: note: previous declaration of 
‘gettimeofday’ was here
|    66 | extern int gettimeofday (struct timeval *__restrict __tv,
|       |            ^~~~~~~~~~~~
| syscalls.c:65:12: warning: ‘_pageshift’ defined but not used 
[-Wunused-function]
|    65 | static int _pageshift()
|       |            ^~~~~~~~~~
| make[2]: *** [Makefile:390: libpurelibc_la-syscalls.lo] Error 1
| make[2]: Leaving directory '/<<PKGBUILDDIR>>'
| make[1]: *** [Makefile:235: all] Error 2
| make[1]: Leaving directory '/<<PKGBUILDDIR>>'
| make: *** [/usr/share/cdbs/1/class/makefile.mk:77: 
debian/stamp-makefile-build] Error 2
| dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2

The full build log is available there:
http://qa-logs.debian.net/2020/06/24/purelibc_0.4.1-2_unstable_glibc-exp.log

The support for timezones in gettimeofday has been removed in glibc
2.31. As a result the second argument of the gettimeofday prototype has
been changed from struct timezone * to void *. The same change needs to
be done in datefudge.

You will find attached a patch fixing that. It would be nice if it can
be fixed relatively soon so that we can start the transition.

Regards,
Aurelien
diff -u purelibc-0.4.1/syscalls.c purelibc-0.4.1/syscalls.c
--- purelibc-0.4.1/syscalls.c
+++ purelibc-0.4.1/syscalls.c
@@ -861,7 +861,7 @@
        return _pure_syscall(__NR_getrusage,usage);
 }
 
-int gettimeofday(struct timeval *tv, struct timezone *tz){
+int gettimeofday(struct timeval *tv, void *tz){
        return _pure_syscall(__NR_gettimeofday, tv, tz);
 }
 

Reply via email to