#51750: libarchive @3.2.1_0 fails building on 10.5.8 PPC -------------------------+-------------------- Reporter: braumann@… | Owner: toby@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: fixed | Keywords: Port: libarchive | -------------------------+-------------------- Comment (by braumann@…): Replying to [comment:3 toby@…]:
r149889 ''might'' fix it. I obviously cannot test on 10.5.8, let alone PPC. Sorry, your solution cannot work, as your introduced check whether `__has_builtin` is defined does not prevent from applying it anyway.
What the programmer of libarchive/archive_read_support_format_lha.c obviously has forgotten is to consider the case that `__has_builtin` is not defined at all, so as this is missing in all kinds of gcc (AFAIK), the present code ''only'' supports newer `clang` (probably newer than 3.2). Somewhere in the `clang` documentation I found a simple work-around to add this ''feature checking macro'': {{{ #ifndef __has_builtin // Optional of course #define __has_builtin(x) 0 // Compatibility with non-clang compilers #endif }}} So please add these three lines above somewhere before line 1715 in libarchive/archive_read_support_format_lha.c, and please revert your patch affecting line 1718 {{{ || (defined(__clang__) && defined(__has_builtin) && __has_builtin(__builtin_bswap16)) }}} back to {{{ || (defined(__clang__) && __has_builtin(__builtin_bswap16)) }}} I think gcc now again can be used to build `libarchive`. As you might have heard, `clang` unfortunately is not functional on PPC so far (even though macports-clang-3.4 can be built). Thanks! -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:4> MacPorts <https://www.macports.org/> Ports system for OS X