[Beignet] [PATCH 3/3] add CMAKE option ENABLE_RTTI for some stl version

Zhigang Gong zhigang.gong at linux.intel.com
Tue Jan 6 21:03:51 PST 2015


Sure, let's try our best to reduce the cmake build options as much as possible.

On Wed, Jan 07, 2015 at 05:59:30AM +0000, Guo, Yejun wrote:
> Ok, it is also a practical method. 
> 
> -----Original Message-----
> From: Zhigang Gong [mailto:zhigang.gong at linux.intel.com] 
> Sent: Wednesday, January 07, 2015 12:56 PM
> To: Guo, Yejun
> Cc: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH 3/3] add CMAKE option ENABLE_RTTI for some stl version
> 
> 
> Right, I also found this error. The root cause is that we mixed rtti(beignet backend) and no-rtti(llvm) library.
> 
> Considering this issue only exists with old system such as
> CentOS6.5 and we will never try to link LLVM on that system.
> 
> We can just simply remove no-rtti if USE_STANDALONE_GBE_COMPILER set, otherwise we always have no-rtti.
> 
> Then the user always don't need to be away of it.
> 
> On Wed, Jan 07, 2015 at 05:27:13AM +0000, Guo, Yejun wrote:
> > Sure, I tried to remove -fno-rtti and it failed to build libgbe.so.
> > 
> > Just did it again to get the detail log, see below.
> > Linking CXX shared library libgbe.so
> > CMakeFiles/gbe.dir/llvm/llvm_sampler_fix.cpp.o:(.data.rel.ro._ZTIN3gbe10SamplerFixE[_ZTIN3gbe10SamplerFixE]+0x10): undefined reference to `typeinfo for llvm::FunctionPass'
> > CMakeFiles/gbe.dir/llvm/llvm_gen_backend.cpp.o:(.data.rel.ro._ZTIN3gbe9GenWriterE[_ZTIN3gbe9GenWriterE]+0x18): undefined reference to `typeinfo for llvm::FunctionPass'
> > CMakeFiles/gbe.dir/llvm/llvm_passes.cpp.o:(.data.rel.ro._ZTIN3gbe17GenRemoveGEPPasssE[_ZTIN3gbe17GenRemoveGEPPasssE]+0x10): undefined reference to `typeinfo for llvm::BasicBlockPass'
> > CMakeFiles/gbe.dir/llvm/llvm_scalarize.cpp.o:(.data.rel.ro._ZTIN3gbe9ScalarizeE[_ZTIN3gbe9ScalarizeE]+0x10): undefined reference to `typeinfo for llvm::FunctionPass'
> > CMakeFiles/gbe.dir/llvm/llvm_legalize.cpp.o:(.data.rel.ro._ZTIN3gbe8LegalizeE[_ZTIN3gbe8LegalizeE]+0x10): undefined reference to `typeinfo for llvm::FunctionPass'
> > CMakeFiles/gbe.dir/llvm/llvm_intrinsic_lowering.cpp.o:(.data.rel.ro._ZTIN3gbe18InstrinsicLoweringE[_ZTIN3gbe18InstrinsicLoweringE]+0x10): undefined reference to `typeinfo for llvm::BasicBlockPass'
> > CMakeFiles/gbe.dir/llvm/llvm_printf_parser.cpp.o:(.data.rel.ro._ZTIN3gbe12PrintfParserE[_ZTIN3gbe12PrintfParserE]+0x10): undefined reference to `typeinfo for llvm::FunctionPass'
> > CMakeFiles/gbe.dir/llvm/llvm_loadstore_optimization.cpp.o:(.data.rel.ro._ZTIN3gbe24GenLoadStoreOptimizationE[_ZTIN3gbe24GenLoadStoreOptimizationE]+0x10): undefined reference to `typeinfo for llvm::BasicBlockPass'
> > CMakeFiles/gbe.dir/llvm/llvm_unroll.cpp.o:(.data.rel.ro._ZTIN3gbe16CustomLoopUnrollE[_ZTIN3gbe16CustomLoopUnrollE]+0x10): undefined reference to `typeinfo for llvm::LoopPass'
> > CMakeFiles/gbe.dir/llvm/llvm_barrier_nodup.cpp.o:(.data.rel.ro._ZTIN3gbe12BarrierNodupE[_ZTIN3gbe12BarrierNodupE]+0x10): undefined reference to `typeinfo for llvm::ModulePass'
> > collect2: error: ld returned 1 exit status
> > make[2]: *** [backend/src/libgbe.so] Error 1
> > 
> > -----Original Message-----
> > From: Zhigang Gong [mailto:zhigang.gong at linux.intel.com]
> > Sent: Wednesday, January 07, 2015 12:13 PM
> > To: Guo, Yejun
> > Cc: beignet at lists.freedesktop.org
> > Subject: Re: [Beignet] [PATCH 3/3] add CMAKE option ENABLE_RTTI for 
> > some stl version
> > 
> > Can we just remove -fno-rtti? Did you try it?
> > 
> > On Wed, Jan 07, 2015 at 04:33:16AM +0000, Guo, Yejun wrote:
> > > I did not find a good way to get the STL version, except checking the file name of libstdc++.so.version. From another perspective, what we know is that the default STL version inside CentOS6.5 requires RTTI, we do not know if any other version requires RTTI, imho, it is better to export this option instead of checking a specific version number in cmake. Otherwise, users need to modify CMakeLists to add another version number when he meets the case.
> > > 
> > > -----Original Message-----
> > > From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On 
> > > Behalf Of Zhigang Gong
> > > Sent: Wednesday, January 07, 2015 10:26 AM
> > > To: Guo, Yejun
> > > Cc: beignet at lists.freedesktop.org
> > > Subject: Re: [Beignet] [PATCH 3/3] add CMAKE option ENABLE_RTTI for 
> > > some stl version
> > > 
> > > Could you find out the specified STL version? And do some checking at configuration time and remove or add fno-rtti according to the checking resul?
> > > 
> > > Thanks.
> > > 
> > > On Wed, Dec 31, 2014 at 03:36:24PM +0800, Guo Yejun wrote:
> > > > for some STL version, unable to build with -fno-rtti, have to enable it.
> > > > 
> > > > Signed-off-by: Guo Yejun <yejun.guo at intel.com>
> > > > ---
> > > >  CMakeLists.txt | 8 +++++++-
> > > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/CMakeLists.txt b/CMakeLists.txt index 
> > > > 5cb31c2..9b9c9ea
> > > > 100644
> > > > --- a/CMakeLists.txt
> > > > +++ b/CMakeLists.txt
> > > > @@ -65,7 +65,13 @@ elseif (COMPILER STREQUAL "CLANG")  elseif 
> > > > (COMPILER STREQUAL "ICC")
> > > >    set (CMAKE_C_CXX_FLAGS "${CMAKE_C_CXX_FLAGS}  -wd2928 -Wall 
> > > > -fPIC -fstrict-aliasing -fp-model fast -msse4.1 -Wl,-E")  endif () 
> > > > -set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -std=c++0x 
> > > > -Wno-invalid-offsetof -fno-rtti")
> > > > +
> > > > +set (CMAKE_CXX_FLAGS "${CMAKE_C_CXX_FLAGS} -std=c++0x
> > > > +-Wno-invalid-offsetof")
> > > > +
> > > > +if (NOT ENABLE_RTTI)
> > > > +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") endif ()
> > > > +
> > > >  set (CMAKE_C_FLAGS "${CMAKE_C_CXX_FLAGS}")
> > > >  set (CMAKE_CXX_FLAGS_DEBUG          "-O0 -g -DGBE_DEBUG=1")
> > > >  set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DGBE_DEBUG=1")
> > > > --
> > > > 1.9.1
> > > > 
> > > > _______________________________________________
> > > > Beignet mailing list
> > > > Beignet at lists.freedesktop.org
> > > > http://lists.freedesktop.org/mailman/listinfo/beignet
> > > _______________________________________________
> > > Beignet mailing list
> > > Beignet at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/beignet
> > > _______________________________________________
> > > Beignet mailing list
> > > Beignet at lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/beignet
> > _______________________________________________
> > Beignet mailing list
> > Beignet at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/beignet
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list