LINBIT / csync2

file synchronization tool using librsync and current state databases
GNU General Public License v2.0
145 stars 39 forks source link

fix build on Alpine Linux ppc64le #6

Closed rgdoliveira closed 6 years ago

rgdoliveira commented 6 years ago

Build is failing on Alpine ppc64le with error: rsync.c:52:15: error: static declaration of 'strlcpy' follows non-static declaration static size_t strlcpy(char d, const char s, size_t bufsize)

Alpine defines strlcpy in /usr/include/string.h (provided by musl libc) as: size_t strlcpy (char , const char , size_t);

Said that, I'm removing the 'static' modifier from strlcpy function in rsync.c file.

rgdoliveira commented 6 years ago

I tested this change on x86_64 and ppc64le and seems it didn't break anything.

rck commented 6 years ago

No sorry, that is not a real fix. The real fix is to check if strlcpy() exists in "./configure", and then conditionally disable this "compat function" via #ifdef. Are you willing to provide such a patch? Otherwise I'm afraid this has to wait till there is more time on our side.

rgdoliveira commented 6 years ago

Not sure if I can provide a patch with the properly fix soon, but if I have some time I can give it a shot

rck commented 6 years ago

This should be fixed on current master. Thanks.

rgdoliveira commented 6 years ago

Thanks for the fix. The package is now enabled on Alpine ppc64le: https://git.alpinelinux.org/cgit/aports/commit/?id=c83c8958