[MacPorts] #51750: libarchive @3.2.1_0 fails building on 10.5.8 PPC
#51750: libarchive @3.2.1_0 fails building on 10.5.8 PPC ------------------------+-------------------------------- Reporter: braumann@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Keywords: | Port: libarchive ------------------------+-------------------------------- While upgrading `libarchive` from `3.1.2_2` to `3.2.1_0` I run into this trouble: {{{ :info:build libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I/opt/local/include -I/opt/local/include/libxml2 -pipe -Os -arch ppc -Wall -Wformat -Wformat-security -MT libarchive/archive_read_support_format_lha.lo -MD -MP -MF libarchive/.deps/archive_read_support_format_lha.Tpo -c libarchive/archive_read_support_format_lha.c -fno-common -DPIC -o libarchive/.libs/archive_read_support_format_lha.o :info:build libarchive/archive_read_support_format_lha.c:1718:46: error: missing binary operator before token "(" :info:build make[1]: *** [libarchive/archive_read_support_format_lha.lo] Error 1 }}} -- Ticket URL: <https://trac.macports.org/ticket/51750> MacPorts <https://www.macports.org/> Ports system for OS X
#51750: libarchive @3.2.1_0 fails building on 10.5.8 PPC -------------------------+-------------------- Reporter: braumann@… | Owner: toby@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: libarchive | -------------------------+-------------------- Changes (by mf2k@…): * cc: toby@… (removed) * owner: macports-tickets@… => toby@… -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:1> MacPorts <https://www.macports.org/> Ports system for OS X
#51750: libarchive @3.2.1_0 fails building on 10.5.8 PPC -------------------------+-------------------- Reporter: braumann@… | Owner: toby@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.3.4 Resolution: | Keywords: Port: libarchive | -------------------------+-------------------- Comment (by toby@…): 10.5.8 PPC, wtf -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:2> MacPorts <https://www.macports.org/> Ports system for OS X
#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 | -------------------------+-------------------- Changes (by toby@…): * status: new => closed * resolution: => fixed Comment: r149889 ''might'' fix it. I obviously cannot test on 10.5.8, let alone PPC. -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:3> MacPorts <https://www.macports.org/> Ports system for OS X
#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
#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 toby@…): If I'm interpreting your comment correctly, you're saying that the preprocessor evaluates everything, unlike the compiler? -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:5> MacPorts <https://www.macports.org/> Ports system for OS X
#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 toby@…): As for "the programmer of libarchive" - they didn't even use __has_builtin, that was my first attempt at fixing it - which does work fine on non-ancient compilers. -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:6> MacPorts <https://www.macports.org/> Ports system for OS X
#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 toby@…): Anyway, r149937. -- Ticket URL: <https://trac.macports.org/ticket/51750#comment:7> MacPorts <https://www.macports.org/> Ports system for OS X
#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:5 toby@…]:
If I'm interpreting your comment correctly, you're saying that the preprocessor evaluates everything, unlike the compiler? There is no other way to interpret the effect we have observed.
-- Ticket URL: <https://trac.macports.org/ticket/51750#comment:8> MacPorts <https://www.macports.org/> Ports system for OS X
#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:6 toby@…]:
As for "the programmer of libarchive" - they didn't even use __has_builtin, that was my first attempt at fixing it - which does work fine on non-ancient compilers. Well, `gcc5` is not too ancient so far, but it also failed at that point, not only the good old `gcc42`.
-- Ticket URL: <https://trac.macports.org/ticket/51750#comment:9> MacPorts <https://www.macports.org/> Ports system for OS X
#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:7 toby@…]:
Anyway, r149937. Thanks for the fix!
-- Ticket URL: <https://trac.macports.org/ticket/51750#comment:10> MacPorts <https://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts