Mailing List Archive

0.98.1 not compiling on OS/X Mavericks
Hello,
The build is broken for 0.98.1 when compiling on OS/X 10.9.2 and Xcode 5.
Below are the errors...
BTW I also did a fresh git clone from the latest code and that is broken
too.
Thanks for any help.

In file included from llvm/lib/Analysis/LoopInfo.cpp:17:
./llvm/include/llvm/Analysis/LoopInfo.h:817:19: error: no matching
member function for call to 'insert'
TodoStack.insert(TodoStack.end(), InvBlockTraits::child_begin(X),
~~~~~~~~~~^~~~~~
./llvm/include/llvm/Analysis/LoopInfo.h:755:22: note: in instantiation
of member function
'llvm::LoopInfoBase<llvm::BasicBlock,
llvm::Loop>::ConsiderForLoop' requested here
if (LoopT *L = ConsiderForLoop(*NI, DT))
^
llvm/lib/Analysis/LoopInfo.cpp:384:6: note: in instantiation of member
function 'llvm::LoopInfoBase<llvm::BasicBlock,
llvm::Loop>::Calculate' requested here
LI.Calculate(getAnalysis<DominatorTree>().getBase()); // Update
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:718:14:
note:
candidate function not viable: no known conversion from
'ChildIteratorType' (aka 'PredIterator<llvm::BasicBlock,
Value::use_iterator>') to 'size_type' (aka 'unsigned long') for
2nd argument
iterator insert(const_iterator __position, size_type __n,
const_reference __x);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:722:14:
note:
candidate template ignored: disabled by 'enable_if' [with
_InputIterator = llvm::PredIterator<llvm::BasicBlock,
llvm::value_use_iterator<llvm::User> >]
__is_input_iterator <_InputIterator>::value &&
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:733:13:
note:
candidate template ignored: disabled by 'enable_if' [with
_ForwardIterator = llvm::PredIterator<llvm::BasicBlock,
llvm::value_use_iterator<llvm::User> >]
__is_forward_iterator<_ForwardIterator>::value &&
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:710:14:
note:
candidate function not viable: requires 2 arguments, but 3 were
provided
iterator insert(const_iterator __position, const_reference __x);
^

Here is my compiler info:

gcc -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
I believe that is actually clang, not gcc. Not sure if clang is supported.


On Mon, Mar 17, 2014 at 8:38 PM, zck900 <zck900@comcast.net> wrote:

> Hello,
> The build is broken for 0.98.1 when compiling on OS/X 10.9.2 and Xcode 5.
> Below are the errors...
> BTW I also did a fresh git clone from the latest code and that is broken
> too.
> Thanks for any help.
>
> In file included from llvm/lib/Analysis/LoopInfo.cpp:17:
> ./llvm/include/llvm/Analysis/LoopInfo.h:817:19: error: no matching member
> function for call to 'insert'
> TodoStack.insert(TodoStack.end(), InvBlockTraits::child_begin(X),
> ~~~~~~~~~~^~~~~~
> ./llvm/include/llvm/Analysis/LoopInfo.h:755:22: note: in instantiation of
> member function
> 'llvm::LoopInfoBase<llvm::BasicBlock, llvm::Loop>::ConsiderForLoop'
> requested here
> if (LoopT *L = ConsiderForLoop(*NI, DT))
> ^
> llvm/lib/Analysis/LoopInfo.cpp:384:6: note: in instantiation of member
> function 'llvm::LoopInfoBase<llvm::BasicBlock,
> llvm::Loop>::Calculate' requested here
> LI.Calculate(getAnalysis<DominatorTree>().getBase()); // Update
> ^
> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:718:14: note:
> candidate function not viable: no known conversion from
> 'ChildIteratorType' (aka 'PredIterator<llvm::BasicBlock,
> Value::use_iterator>') to 'size_type' (aka 'unsigned long') for 2nd
> argument
> iterator insert(const_iterator __position, size_type __n,
> const_reference __x);
> ^
> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:722:14: note:
> candidate template ignored: disabled by 'enable_if' [with
> _InputIterator = llvm::PredIterator<llvm::BasicBlock,
> llvm::value_use_iterator<llvm::User> >]
> __is_input_iterator <_InputIterator>::value &&
> ^
> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:733:13: note:
> candidate template ignored: disabled by 'enable_if' [with
> _ForwardIterator = llvm::PredIterator<llvm::BasicBlock,
> llvm::value_use_iterator<llvm::User> >]
> __is_forward_iterator<_ForwardIterator>::value &&
> ^
> /Applications/Xcode.app/Contents/Developer/Toolchains/
> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:710:14: note:
> candidate function not viable: requires 2 arguments, but 3 were
> provided
> iterator insert(const_iterator __position, const_reference __x);
> ^
>
> Here is my compiler info:
>
> gcc -v
> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
> --with-gxx-include-dir=/usr/include/c++/4.2.1
> Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
> Target: x86_64-apple-darwin13.1.0
> Thread model: posix
>
> _______________________________________________
> http://lurker.clamav.net/list/clamav-devel.html
> Please submit your patches to our Bugzilla: http://bugs.clamav.net
>



--
http://volatile-minds.blogspot.com -- blog
http://www.volatileminds.net -- website
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
It used to compile on OSX just fine as recently as a month ago.

> On Mar 17, 2014, at 8:01 PM, Brandon Perry <bperry.volatile@gmail.com> wrote:
>
> I believe that is actually clang, not gcc. Not sure if clang is supported.
>
>
>> On Mon, Mar 17, 2014 at 8:38 PM, zck900 <zck900@comcast.net> wrote:
>>
>> Hello,
>> The build is broken for 0.98.1 when compiling on OS/X 10.9.2 and Xcode 5.
>> Below are the errors...
>> BTW I also did a fresh git clone from the latest code and that is broken
>> too.
>> Thanks for any help.
>>
>> In file included from llvm/lib/Analysis/LoopInfo.cpp:17:
>> ./llvm/include/llvm/Analysis/LoopInfo.h:817:19: error: no matching member
>> function for call to 'insert'
>> TodoStack.insert(TodoStack.end(), InvBlockTraits::child_begin(X),
>> ~~~~~~~~~~^~~~~~
>> ./llvm/include/llvm/Analysis/LoopInfo.h:755:22: note: in instantiation of
>> member function
>> 'llvm::LoopInfoBase<llvm::BasicBlock, llvm::Loop>::ConsiderForLoop'
>> requested here
>> if (LoopT *L = ConsiderForLoop(*NI, DT))
>> ^
>> llvm/lib/Analysis/LoopInfo.cpp:384:6: note: in instantiation of member
>> function 'llvm::LoopInfoBase<llvm::BasicBlock,
>> llvm::Loop>::Calculate' requested here
>> LI.Calculate(getAnalysis<DominatorTree>().getBase()); // Update
>> ^
>> /Applications/Xcode.app/Contents/Developer/Toolchains/
>> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:718:14: note:
>> candidate function not viable: no known conversion from
>> 'ChildIteratorType' (aka 'PredIterator<llvm::BasicBlock,
>> Value::use_iterator>') to 'size_type' (aka 'unsigned long') for 2nd
>> argument
>> iterator insert(const_iterator __position, size_type __n,
>> const_reference __x);
>> ^
>> /Applications/Xcode.app/Contents/Developer/Toolchains/
>> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:722:14: note:
>> candidate template ignored: disabled by 'enable_if' [with
>> _InputIterator = llvm::PredIterator<llvm::BasicBlock,
>> llvm::value_use_iterator<llvm::User> >]
>> __is_input_iterator <_InputIterator>::value &&
>> ^
>> /Applications/Xcode.app/Contents/Developer/Toolchains/
>> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:733:13: note:
>> candidate template ignored: disabled by 'enable_if' [with
>> _ForwardIterator = llvm::PredIterator<llvm::BasicBlock,
>> llvm::value_use_iterator<llvm::User> >]
>> __is_forward_iterator<_ForwardIterator>::value &&
>> ^
>> /Applications/Xcode.app/Contents/Developer/Toolchains/
>> XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/vector:710:14: note:
>> candidate function not viable: requires 2 arguments, but 3 were
>> provided
>> iterator insert(const_iterator __position, const_reference __x);
>> ^
>>
>> Here is my compiler info:
>>
>> gcc -v
>> Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr
>> --with-gxx-include-dir=/usr/include/c++/4.2.1
>> Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
>> Target: x86_64-apple-darwin13.1.0
>> Thread model: posix
>>
>> _______________________________________________
>> http://lurker.clamav.net/list/clamav-devel.html
>> Please submit your patches to our Bugzilla: http://bugs.clamav.net
>
>
>
> --
> http://volatile-minds.blogspot.com -- blog
> http://www.volatileminds.net -- website
> _______________________________________________
> http://lurker.clamav.net/list/clamav-devel.html
> Please submit your patches to our Bugzilla: http://bugs.clamav.net
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
On Mar 18, 2014, at 6:05 AM, Zack <zck900@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.
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
Hi,

On 18 Mar 2014, at 07:12, Brian Reiter <breiter@wolfereiter.com> wrote:

>
> On Mar 18, 2014, at 6:05 AM, Zack <zck900@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
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
On Tue, Mar 18, 2014 at 4:39 AM, Remi Mommsen <Remigius.Mommsen@cern.ch>wrote:

> Hi,
>
> On 18 Mar 2014, at 07:12, Brian Reiter <breiter@wolfereiter.com> wrote:
>
> >
> > On Mar 18, 2014, at 6:05 AM, Zack <zck900@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
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
On Tue, Mar 18, 2014 at 10:36 AM, David Raynor <draynor@sourcefire.com>wrote:

>
> On Tue, Mar 18, 2014 at 4:39 AM, Remi Mommsen <Remigius.Mommsen@cern.ch>wrote:
>
>> Hi,
>>
>> On 18 Mar 2014, at 07:12, Brian Reiter <breiter@wolfereiter.com> wrote:
>>
>> >
>> > On Mar 18, 2014, at 6:05 AM, Zack <zck900@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
_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
Hi Dave,

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

> On Tue, Mar 18, 2014 at 10:36 AM, David Raynor <draynor@sourcefire.com>wrote:
>
>>
>> On Tue, Mar 18, 2014 at 4:39 AM, Remi Mommsen <Remigius.Mommsen@cern.ch>wrote:
>>
>>> Hi,
>>>
>>> On 18 Mar 2014, at 07:12, Brian Reiter <breiter@wolfereiter.com> wrote:
>>>
>>>>
>>>> On Mar 18, 2014, at 6:05 AM, Zack <zck900@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
Re: 0.98.1 not compiling on OS/X Mavericks [ In reply to ]
>>>>> 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.

Another workaround is to compile with support for older versions of OS X. I routinely compile with support for OSX 10.6+ and was confused when I saw the original email as I compiled under 10.9.2 and Xcode 5.1 a couple of days ago without any issue.

Here's what I use to configure the build:

CFLAGS="-O2 -g -D_FILE_OFFSET_BITS=64 -mmacosx-version-min=10.6 -arch x86_64" CXXFLAGS="-O2 -g -D_FILE_OFFSET_BITS=64 -mmacosx-version-min=10.6 -arch x86_64" ./configure --disable-dependency-tracking --enable-llvm --enable-clamdtop --with-user=_clamav --with-group=_clamav --enable-all-jit-targets

If I get rid of mmacosx-version flag, the build fails. If I set it to any valid value (e.g. 10.8), it works.

Mark

_______________________________________________
http://lurker.clamav.net/list/clamav-devel.html
Please submit your patches to our Bugzilla: http://bugs.clamav.net