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

David Raynor draynor at sourcefire.com
Tue Mar 18 17:49:03 EDT 2014


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.

-- 
---
Dave Raynor
Vulnerability Research Team



More information about the clamav-devel mailing list