error: use of unknown builtin '__builtin_bswap16'
freetype 2.13.2 does not build on Mac OS X 10.7 with its version of clang, which is "Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)".
The error is:
src/pcf/pcfutil.c:100:12: error: use of unknown builtin '__builtin_bswap16' [-Wimplicit-function-declaration]
*b = BSWAP16( *b );
^
src/pcf/pcfutil.c:64:23: note: expanded from macro 'BSWAP16'
#define BSWAP16( x ) __builtin_bswap16( x )
^
1 error generated.
The problem is that freetype uses __builtin_bswap16
on all versions of clang without verifying whether that functionality exists:
Here is the MacPorts bug report tracking this problem: https://trac.macports.org/ticket/68448
See https://github.com/python/cpython/issues/85783 for discussion of how this was fixed in another project (Python).