tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: conflicting libstdc++?



On Sun, 8 Mar 2015 21:14:18 +0100
Tobias Nygren <tnn%NetBSD.org@localhost> wrote:

> On Sun, 8 Mar 2015 20:52:30 +0000
> Niclas Rosenvik <nros%NetBSD.org@localhost> wrote:
> 
> > I tried to build devel/cppcheck on NetBSD 6 and it fails due to that
> > gcc 4.5 is missing c++ nullptr. gcc 4.6 and above is needed for
> > this. Well I add GCC_REQD+=4.6 to Makefile and then it builds. But
> > at the end ld mentions that libstdc++.so.6 might conflict with
> > libstdc++.so.7 that is needed by tinyxml2.so.2 . Is there any way
> > to fix this? Or can it just be ignored?
> 
> It is a hairy topic. In this particular instance I would prefer to fix
> the build with the old compiler. As long at it is just missing nullptr
> and has no other problems, try this:
> 
> .include "../../mk/compiler.mk"
> .if !empty(CC_VERSION:Mgcc-4.[05]*)
> CXXFLAGS+=	-Dnullptr=0
> .endif
> 
> Kind regards,
> -Tobias

I have fixed this. 
The cppcheck Makefile adds -include lib/cxx11emu.h
if CXXFLAGS is not set.

I used a modified variant of Tobias solution:
.include "../../mk/compiler.mk"
.if !empty(CC_VERSION:Mgcc-4.[05]*)
CXXFLAGS+=-include lib/cxx11emu.h
.endif

With this nullptr is emulated with gcc < 4.6 like 
the cppcheck creators want it.
Thanks for your replies anyway.

Regards,
Niclas


Home | Main Index | Thread Index | Old Index