Bug 1599252

Summary: casync: FTBFS in Fedora rawhide
Product: [Fedora] Fedora Reporter: Igor Raits <igor.raits>
Component: casyncAssignee: Igor Raits <igor.raits>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: igor.raits, james.hogarth, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: http://apps.fedoraproject.org/koschei/package/casync
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-09 10:52:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Igor Raits 2018-07-09 10:21:00 UTC
Description of problem:
Package casync fails to build from source in Fedora rawhide.

Version-Release number of selected component (if applicable):
2-6.fc29

Steps to Reproduce:
koji build --scratch f29 casync-2-6.fc29.src.rpm

Additional info:
This package is tracked by Koschei. See:
http://apps.fedoraproject.org/koschei/package/casync

---

FAILED: src/src@@shared@sta/caformat-util.c.o 
cc -Isrc/src@@shared@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 -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 -ffast-math -fno-common -fdiagnostics-show-option -fno-strict-aliasing -fvisibility=hidden -fstack-protector -fstack-protector-strong -fPIE --param=ssp-buffer-size=4 -include config.h -O2 -g -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC  -MD -MQ 'src/src@@shared@sta/caformat-util.c.o' -MF 'src/src@@shared@sta/caformat-util.c.o.d' -o 'src/src@@shared@sta/caformat-util.c.o' -c ../src/caformat-util.c
In file included from ../src/caformat.h:8,
                 from ../src/caformat-util.c:4:
../src/util.h:526: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:10,
                 from ../src/caformat.h:8,
                 from ../src/caformat-util.c:4:
/usr/include/stdio.h:164:12: note: previous declaration of 'renameat2' was here
 extern int renameat2 (int __oldfd, const char *__old, int __newfd,
            ^~~~~~~~~

---

Looking into the problem:
Command line:  cc /tmp/tmpmoruwu8j/testfile.c -pipe -D_FILE_OFFSET_BITS=64 -o /tmp/tmpmoruwu8j/output.exe -O0 -std=gnu99 

Code:
 #include <stdio.h>
        int main() {
        #ifdef __has_builtin
            #if !__has_builtin(__builtin_renameat2)
                #error "__builtin_renameat2 not found"
            #endif
        #elif ! defined(renameat2)
            /* Check for __builtin_renameat2 only if no includes were added to the
             * prefix above, which means no definition of renameat2 can be found.
             * We would always check for this, but we get false positives on
             * MSYS2 if we do. Their toolchain is broken, but we can at least
             * give them a workaround. */
            #if 0
                __builtin_renameat2;
            #else
                #error "No definition for __builtin_renameat2 found in the prefix"
            #endif
        #endif
        }
Compiler stdout:
 
Compiler stderr:
 /tmp/tmpmoruwu8j/testfile.c: In function ‘main’:
/tmp/tmpmoruwu8j/testfile.c:16:18: error: #error "No definition for __builtin_renameat2 found in the prefix"
                 #error "No definition for __builtin_renameat2 found in the prefix"
                  ^~~~~

Checking for function "renameat2": NO