[Clamav-devel] 0.98.1 not compiling on OS/X Mavericks

Remi Mommsen Remigius.Mommsen at cern.ch
Wed Mar 19 05:01:25 EDT 2014


Hi Dave,

On 18 Mar 2014, at 22:49, David Raynor <draynor at sourcefire.com> wrote:

> On Tue, Mar 18, 2014 at 10:36 AM, David Raynor <draynor at sourcefire.com>wrote:
> 
>> 
>> On Tue, Mar 18, 2014 at 4:39 AM, Remi Mommsen <Remigius.Mommsen at cern.ch>wrote:
>> 
>>> Hi,
>>> 
>>> On 18 Mar 2014, at 07:12, Brian Reiter <breiter at wolfereiter.com> wrote:
>>> 
>>>> 
>>>> On Mar 18, 2014, at 6:05 AM, Zack <zck900 at comcast.net> wrote:
>>>> 
>>>>> It used to compile on OSX just fine as recently as a month ago.
>>>> 
>>>> I haven't built from source manually in a while but it does 0.98.1 did
>>> build for me using MacPorts on Mavericks back in January. That was XCode 5
>>> but not 5.1. MacPorts builds with CFLAGS -O0.
>>> 
>>> I can confirm that the update from xcode 5 to 5.1 broke the compilation
>>> on Mac OS X.
>>> 
>>> Remi
>>> _______________________________________________
>>> http://lurker.clamav.net/list/clamav-devel.html
>>> Please submit your patches to our Bugzilla: http://bugs.clamav.net
>>> 
>> 
>> Thanks for the research on this problem. I added this to our Bugzilla as
>> bug # 10757 so we can track it.
>> 
>> Dave R.
>> 
>> --
>> ---
>> Dave Raynor
>> Vulnerability Research Team
>> 
> 
> This error is reported from upstream LLVM code. The LLVM team has made
> bigger changes to this header since this file was included in ClamAV, so I
> cannot simply apply changes from them or the patch impact increases beyond
> this file.
> 
> The root problem is the handling of the iterators and templates in this one
> spot. In short, clang is checking something earlier than gcc, even though
> the type should be available in the end.
> 
> Please try this candidate patch to the LoopInfo.h header.
> 
> --- a/libclamav/c++/llvm/include/llvm/Analysis/LoopInfo.h
> +++ b/libclamav/c++/llvm/include/llvm/Analysis/LoopInfo.h
> @@ -814,8 +814,12 @@ public:
>         typedef GraphTraits<Inverse<BlockT*> > InvBlockTraits;
> 
>         // Add all of the predecessors of X to the end of the work stack...
> -        TodoStack.insert(TodoStack.end(), InvBlockTraits::child_begin(X),
> -                         InvBlockTraits::child_end(X));
> +        for (typename InvBlockTraits::ChildIteratorType PI =
> +              InvBlockTraits::child_begin(X), PE =
> InvBlockTraits::child_end(X);
> +              PI != PE; ++PI) {
> +          typename InvBlockTraits::NodeType *N = *PI;
> +          TodoStack.push_back(N);
> +        }
>       }
>     }
> 
> Dealing with a larger LLVM upgrade is a task for a future release, but this
> should let you move forward under Xcode 5.1 in the near term.
> 
> Let us know how it goes,
> 
> Dave R.

This workaround fixes the issue on Mac OS X 10.9.2 with Xcode 5.1.

BTW: I poked a bit around in the LLVM code to understand why their iterator is not copy assignable or constructible. This is the root cause that the enable_if disables the range insert. However, I failed to figure it out.

Remi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2729 bytes
Desc: not available
URL: <http://lists.clamav.net/pipermail/clamav-devel/attachments/20140319/b707bb5a/attachment.bin>


More information about the clamav-devel mailing list