[MacPorts] #40541: clamav-0.98 build fails with redefinition of typedef 'Byte'
#40541: clamav-0.98 build fails with redefinition of typedef 'Byte' ----------------------+-------------------------------- Reporter: gnwiii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Keywords: | Port: clamav ----------------------+-------------------------------- I have Snow Leopard. The relevant section of the log is: {{{ :info:build CC libclamav_la-htmlnorm.lo :info:build In file included from 7z/LzmaDec.h:7, :info:build from lzma_iface.h:26, :info:build from upx.c:59: :info:build 7z/Types.h:58: error: redefinition of typedef 'Byte' :info:build /opt/local/include/zconf.h:368: error: previous declaration of 'Byte' was here }}} from `7z/Types.h:58`: {{{ typedef unsigned char Byte; }}} from `/opt/local/include/zconf.h:367-369`: {{{ #if !defined(__MACTYPES__) typedef unsigned char Byte; /* 8 bits */ #endif }}} Workaround: replace {{{Byte}}} with {{{SZByte}}} in the 7z directory: {{{ for f in $(port dir clamav)/work/clamav-0.98/libclamav/7z/*.[ch] ; do sudo sed -i -e 's/Byte/SZByte/g' $f done }}} With this change, the build completes and clamscan is able to process .7z archives. -- Ticket URL: <https://trac.macports.org/ticket/40541> MacPorts <http://www.macports.org/> Ports system for OS X
#40541: clamav-0.98 build fails with redefinition of typedef 'Byte' -----------------------+-------------------------------- Reporter: gnwiii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: clamav | -----------------------+-------------------------------- Comment (by dluke@…): Yeah, I mentioned this on the macports-dev mailing list just to see if anyone had other thoughts on it. If you can provide a patch for the libclamav/7z/*.[ch] files, that's probably what we'll want to do (for now). Otherwise I'll try to generate one as soon as I can. It would probably be worthwhile to report this upstream as well (and if you do so, please make a note of it here and include a link or the bug number if possible). Thanks! -- Ticket URL: <https://trac.macports.org/ticket/40541#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
#40541: clamav-0.98 build fails with redefinition of typedef 'Byte' -----------------------+-------------------------------- Reporter: gnwiii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: clamav | -----------------------+-------------------------------- Comment (by gnwiii@…): I gather that the zlib typedef for Byte isn't causing problems for other ports. C11 allows multiple (consistent!) typedefs, so this issue is really with Apple's old gcc version. Unless clamav builds on other platforms encounter the problem, macports should try to use clamav-0.98 "as is". I tried building clamav-0.98 in a "stand-alone" configuration. 1) using Apple gcc and zlib: the build did not encounter the problem, so it is macports' zlib that conflicts with clamav's libclamav/7z. I didn't run the check for this build and some further investigation is needed to determine why the multiple typedef doesn't occur (, and run checks to make sure the build actually works!). 2) using macports' clang and zlib: The clamav-0.98 configure script uses {{{-Wl,-rpath=...}}} so needs editing to support zlib in /opt/local. With this configuration the build succeeds with a warning: {{{ $ CC=/opt/local/bin/clang CXX=/opt/local/bin/clang++ \ CPPFLAGS='-I/opt/local/include' \ LDFLAGS='-L/opt/local/lib' \ ./configure --prefix=/opt/clamav.net --with-zlib=/opt/local --enable- check [...] configure: Summary of detected features follows OS : darwin10.8.0 pthreads : yes () configure: Summary of miscellaneous features check : -L/opt/local/lib -lcheck -R/opt/local/lib fanotify : yes fdpassing : 1 IPv6 : yes configure: Summary of optional tools clamdtop : -L/opt/local/lib -lncurses -R/opt/local/lib (auto) milter : yes (disabled) configure: Summary of engine performance features) release mode: yes jit : yes (auto) mempool : yes configure: Summary of engine detection features autoit_ea06 : yes bzip2 : ok zlib : /opt/local unrar : yes }}} This build fails some checks: {{{ 3 of 12 tests failed (1 test was not run) See unit_tests/test-suite.log Please report to http://bugs.clamav.net/ }}} The log has: {{{ CC libclamav_la-upx.lo In file included from upx.c:59: In file included from ./lzma_iface.h:26: In file included from ./7z/LzmaDec.h:7: ./7z/Types.h:58:23: warning: redefinition of typedef 'Byte' is a C11 feature [-Wtype def-redefinition] typedef unsigned char Byte; ^ /opt/local/include/zconf.h:368:24: note: previous definition is here typedef unsigned char Byte; /* 8 bits */ ^ 1 warning generated. }}} The checks that fail: {{{ ============================================= ClamAV devel: unit_tests/test-suite.log ============================================= 3 of 12 tests failed. (1 test was not run). .. contents:: :depth: 2 FAIL: check5_clamd_vg.sh (exit: 109) ==================================== Killing stuck clamd! FAIL: check6_clamd_vg.sh (exit: 109) ==================================== Running suite(s): clamd 100%: Checks: 77, Failures: 0, Errors: 0 Killing stuck clamd! SKIP: check7_clamd_hg.sh (exit: 77) =================================== FAIL: check8_clamd_hg.sh (exit: 42) =================================== }}} -- Ticket URL: <https://trac.macports.org/ticket/40541#comment:4> MacPorts <http://www.macports.org/> Ports system for OS X
#40541: clamav-0.98 build fails with redefinition of typedef 'Byte' -----------------------+-------------------------------- Reporter: gnwiii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: | Keywords: Port: clamav | -----------------------+-------------------------------- Comment (by dluke@…): Yes, you should address some of that (failing tests) with upstream, probably. The macports port fixes the bad rpath syntax (and I filed a bug report upstream about it). It looks like 10.7 and newer (with clang) don't have a problem building without modifying one of the Byte typdefs, so we can conditionally apply a patch on Darwin 8/9 (10.5 and 10.6). Really - the best thing you can do to make this faster is to upload a patch with your clamav 7z Byte typedef renames [or you can wait for me to make a patch and update the port]. -- Ticket URL: <https://trac.macports.org/ticket/40541#comment:5> MacPorts <http://www.macports.org/> Ports system for OS X
#40541: clamav-0.98 build fails with redefinition of typedef 'Byte' -----------------------+-------------------------------- Reporter: gnwiii@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: fixed | Keywords: Port: clamav | -----------------------+-------------------------------- Changes (by dluke@…): * status: new => closed * resolution: => fixed Comment: patched in r111554 -- Ticket URL: <https://trac.macports.org/ticket/40541#comment:6> MacPorts <http://www.macports.org/> Ports system for OS X
#40541: clamav-0.98 build fails with redefinition of typedef 'Byte' -----------------------+-------------------------------- Reporter: gnwiii@… | Owner: macports-tickets@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 2.2.0 Resolution: fixed | Keywords: Port: clamav | -----------------------+-------------------------------- Comment (by dluke@…): and r111557 (missed darwin10 block before since I was testing on 10.5/darwin9) -- Ticket URL: <https://trac.macports.org/ticket/40541#comment:7> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts