Bug#907409: casync: FTBFS with glibc 2.28, header mismatch wih new renameat2()

Steve Langasek steve.langasek at canonical.com
Mon Aug 27 18:00:25 BST 2018

Package: casync
Version: 2+20180321-2
Severity: normal
Tags: patch
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu cosmic ubuntu-patch

Dear maintainers,

casync fails to build from source against glibc 2.28, as seen in the Ubuntu

cc -Isrc/src@@shared at sta -Isrc -I../src -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=gnu99 -Wextra -Werror=undef -Werror=format=2 -Wformat-security -Wformat-nonliteral -Wlogical-op -Wmissing-include-dirs -Werror=old-style-definition -Werror=pointer-arith -Winit-self -Wdeclaration-after-statement -Wfloat-equal -Wsuggest-attribute=noreturn -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=missing-declarations -Werror=return-type -Werror=incompatible-pointer-types -Werror=shadow -Werror=int-conversion -Wstrict-prototypes -Wredundant-decls -Wmissing-noreturn -Wendif-labels -Wstrict-aliasing=2 -Wwrite-strings -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-result -Werror=overflow -Werror=sign-compare -Wdate-time -Wnested-externs -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -include config.h -g -O2 -fdebug-prefix-map=/tmp/autopkgtest.iBt8c8/build.W5z/src=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC  -MD -MQ 'src/src@@shared at sta/cacache.c.o' -MF 'src/src@@shared at sta/cacache.c.o.d' -o 'src/src@@shared at sta/cacache.c.o' -c ../src/cacache.c
In file included from ../src/canametable.h:9,
                 from ../src/calocation.h:12,
                 from ../src/cacache.h:7,
                 from ../src/cacache.c:9:
../src/util.h:532:19: error: static declaration of ‘renameat2’ follows non-static declaration
 static inline int renameat2(int oldfd, const char *oldname, int newfd, const char *newname, unsigned flags) {
In file included from ../src/util.h:12,
                 from ../src/canametable.h:9,
                 from ../src/calocation.h:12,
                 from ../src/cacache.h:7,
                 from ../src/cacache.c:9:
/usr/include/stdio.h:164:12: note: previous declaration of ‘renameat2’ was here
 extern int renameat2 (int __oldfd, const char *__old, int __newfd,
ninja: build stopped: subcommand failed.


The casync build system does include a check for a system-provided
renameat2() implementation, however, the new renameat2 in
/usr/include/stdio.h in glibc 2.28 is guarded with __USE_GNU which means its
availability is conditional on features.h selections - and while _GNU_SOURCE
winds up being defined in meson.build for the actual software build, it is
NOT defined while meson itself is doing feature detection.

Perhaps adding -D_GNU_SOURCE to c_args would fix the build failure, but I
used the larger hammer of defining it as

Please consider the attached patch to fix this bug, which will become a
serious bug once glibc 2.28 is uploaded to Debian.

Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slangasek at ubuntu.com                                     vorlon at debian.org
-------------- next part --------------
diff -Nru casync-2+20180321/debian/rules casync-2+20180321/debian/rules
--- casync-2+20180321/debian/rules	2018-05-03 06:12:33.000000000 -0700
+++ casync-2+20180321/debian/rules	2018-08-27 09:50:17.000000000 -0700
@@ -1,6 +1,7 @@
 #! /usr/bin/make -f
 export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 export LC_ALL=C.UTF-8

More information about the Pkg-systemd-maintainers mailing list