[Llvm-bgq-discuss] Linker error: undefined reference to `vtable for std::nested_exception'

Hal Finkel hfinkel at anl.gov
Thu Jul 17 12:24:46 CDT 2014


----- Original Message -----
> From: "Rob Latham" <robl at mcs.anl.gov>
> To: llvm-bgq-discuss at lists.alcf.anl.gov
> Sent: Thursday, July 17, 2014 11:30:35 AM
> Subject: Re: [Llvm-bgq-discuss] Linker error: undefined reference to `vtable for std::nested_exception'
> 
> See http://www.alcf.anl.gov/user-guides/bgclang-compiler#faq, which I
> myself was just staring at last night:
> 
> Linking code compiled with bgclang++ together with code compiled with
> bgclang++11 does not work, why?
> 
> Code compiled using bgclang++ uses the same libstdc++ standard
> template
> library (STL) implementation as the system-default GNU
> powerpc64-bgq-linux-g++ compiler. This provides compatibility with
> C++
> libraries, including some system libraries, compiled with the GNU
> toolchain. This STL implementation, however, cannot provide a
> conforming
> C++11 programming environment, and so bgclang++11 uses an up-to-date
> STL
> implementation derived from LLVM's libc++. Unfortunately, this STL
> implementation is incompatible with libstdc++, and so linking errors
> will result for functions that use STL objects as part of their
> signatures (i.e. parameter or return types).

Exactly, but... the exceptions in std:: are a special exception... they actually come from the underlying libstdc++ (and, in fact, are the whole reason why the layering scheme is so complicated). However, you need the 4.7.2 libstdc++ for this to work.

 -Hal

> 
> ==rob
> 
> 
> On 07/17/2014 08:48 AM, Michael Schlottke wrote:
> > Hi Hal,
> >
> > We tried to install the new version of clang on the BG/Q @ FZ
> > Juelich
> > from your rpms, which worked like a breeze (thanks again for your
> > effors!). However, with the new installation we are not able to
> > link
> > even simple problems against libcxx, as all attempts end with the
> > following error:
> >
> > /bgsys/local/clang/r209570-20140527/libc++/lib/libc++.a(exception.cpp.o):(.toc+0x0):
> > undefined reference to `vtable for std::nested_exception'
> > clang: error: linker command failed with exit code 1 (use -v to see
> > invocation)
> >
> > It happens as soon as we try to compile & link a dummy program that
> > has
> > at least one std library include file. If we use bgclang++, the
> > error
> > does not occur, but it does when using either -stdlib=libc++ or
> > bgclang++11.
> >
> > Do you have any idea what the source of the problem could be? I
> > attached
> > a MWE and the output of running bgclang++11 with -v.
> >
> > Regards,
> >
> > Michael
> >
> > P.S.: We had a driver/toolchain upgrade on JUQUEEN and thus our old
> > clang installations are not working anymore. Maybe this could be
> > related
> > to the problem?
> >
> >
> > ------------------------------------------------------------------------------------------------
> > ------------------------------------------------------------------------------------------------
> > Forschungszentrum Juelich GmbH
> > 52425 Juelich
> > Sitz der Gesellschaft: Juelich
> > Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B
> > 3498
> > Vorsitzender des Aufsichtsrats: MinDir Dr. Karl Eugen Huthmacher
> > Geschaeftsfuehrung: Prof. Dr.-Ing. Wolfgang Marquardt
> > (Vorsitzender),
> > Karsten Beneke (stellv. Vorsitzender), Prof. Dr.-Ing. Harald Bolt,
> > Prof. Dr. Sebastian M. Schmidt
> > ------------------------------------------------------------------------------------------------
> > ------------------------------------------------------------------------------------------------
> >
> >
> >
> > _______________________________________________
> > llvm-bgq-discuss mailing list
> > llvm-bgq-discuss at lists.alcf.anl.gov
> > https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> >
> 
> --
> Rob Latham
> Mathematics and Computer Science Division
> Argonne National Lab, IL USA
> _______________________________________________
> llvm-bgq-discuss mailing list
> llvm-bgq-discuss at lists.alcf.anl.gov
> https://lists.alcf.anl.gov/mailman/listinfo/llvm-bgq-discuss
> 

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory


More information about the llvm-bgq-discuss mailing list