Skip to content
Snippets Groups Projects
Commit f7c56c08 authored by Zuzana Baranová's avatar Zuzana Baranová
Browse files

RT: Only check for missing symbols and link in DIVINE libs with executables.

parent a2acf773
No related branches found
No related tags found
No related merge requests found
...@@ -100,18 +100,22 @@ std::unique_ptr< llvm::Module > NativeDiosCC::link_bitcode() ...@@ -100,18 +100,22 @@ std::unique_ptr< llvm::Module > NativeDiosCC::link_bitcode()
auto drv = std::make_unique< DiosCC >( _clang.context() ); auto drv = std::make_unique< DiosCC >( _clang.context() );
std::unique_ptr< llvm::Module > m = Native::do_link_bitcode< rt::DiosCC >(); std::unique_ptr< llvm::Module > m = Native::do_link_bitcode< rt::DiosCC >();
drv->link( std::move( m ) ); drv->link( std::move( m ) );
drv->linkLibs( DiosCC::defaultDIVINELibs ); if ( !_po.shared )
drv->linkLibs( DiosCC::defaultDIVINELibs );
m = drv->takeLinked(); m = drv->takeLinked();
for ( auto& func : *m ) if ( !_po.shared )
if ( func.isDeclaration() && !whitelisted( func ) ) {
throw cc::CompileError( "Symbol undefined (function): " + func.getName().str() ); for ( auto& func : *m )
if ( func.isDeclaration() && !whitelisted( func ) )
for ( auto& val : m->globals() ) throw cc::CompileError( "Symbol undefined (function): " + func.getName().str() );
if ( auto G = dyn_cast< llvm::GlobalVariable >( &val ) )
if ( !G->hasInitializer() && !whitelisted( *G ) ) for ( auto& val : m->globals() )
throw cc::CompileError( "Symbol undefined (global variable): " + G->getName().str() ); if ( auto G = dyn_cast< llvm::GlobalVariable >( &val ) )
if ( !G->hasInitializer() && !whitelisted( *G ) )
throw cc::CompileError( "Symbol undefined (global variable): " + G->getName().str() );
}
verifyModule( *m ); verifyModule( *m );
return m; return m;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment