[cfe-dev] build issues with c++ code on OpenBSD

Vladimir Kirillov proger at uaoug.org.ua
Mon Jul 26 22:45:11 PDT 2010


On 15:21 Mon 26 Jul, John McCall wrote:
> On Jul 26, 2010, at 3:11 PM, Vladimir Kirillov wrote:
> > Hello, cfe-dev!
> > 
> > I've been playing around with clang apis for some time lately
> > both on Mac OS X (built with usual ./configure && make) and OpenBSD
> > (built system g++ (4.2.1) with linker version scripts turned off
> > (binutils 2.15) and --enable-targets=host,cbe,cpp).
> > 
> > While clang++ builds example C++ code (using some stl) just fine
> > (using includes and libstdc++ from gcc 4.2.4), it bails out with a
> > bunch of 'undefined references' at link time on OpenBSD (OS X is just
> > fine with same flags)
> 
> I would guess that you need to properly sort your link line. 
> The Darwin linker doesn't require -l options to be topologically sorted by dependence, but most other linkers do.

That was it! GNU ld manuals say I have to sort libraries in order of
depedence, in my case the compiled object needed to go first (it was the
last on the command line).



More information about the cfe-dev mailing list