Menu

#19 librsync doesn't export functions defined inline with clang

open
nobody
Portability (5)
5
2011-12-23
2011-12-23
Anonymous
No

Hi,

when compiled with clang, which defaults to compiling C99, the inline keyword is interpreted different from what GCC does (which by default compiles GNU89). This leads to a librsync library where the functions declared inline from delta.c are unresolved symbols, breaking software which links against this library.

See http://clang.llvm.org/compatibility.html#inline for a description of this problem. We have fixed this downstream at MacPorts by dropping the inline keyword when compiling with clang. For reference see https://trac.macports.org/ticket/31742, and the patch we apply https://trac.macports.org/browser/trunk/dports/net/librsync/files/patch-delta.c.diff (raw download at the bottom of the page).

One could probably #ifdef this for clang only, but since somebody already stated that removing the inline functions might be a better idea than adding a special case to autoconfigure.ac in #1466496, I'd suggest to apply the patch linked.

Discussion


Log in to post a comment.