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

tools: Propagate -l arguments to the native linker (lld) in divcc.

parent 7c9f3550
No related branches found
No related tags found
No related merge requests found
...@@ -191,6 +191,8 @@ int compile( cc::ParsedOpts& po, cc::CC1& clang, PairedFiles& objFiles ) ...@@ -191,6 +191,8 @@ int compile( cc::ParsedOpts& po, cc::CC1& clang, PairedFiles& objFiles )
{ {
for ( auto file : objFiles ) for ( auto file : objFiles )
{ {
if ( file.first == "lib" )
continue;
if ( is_object_type( file.first ) ) if ( is_object_type( file.first ) )
continue; continue;
auto mod = clang.compile( file.first, po.opts ); auto mod = clang.compile( file.first, po.opts );
...@@ -215,6 +217,12 @@ std::vector< std::string > ld_args( cc::ParsedOpts& po, PairedFiles& objFiles ) ...@@ -215,6 +217,12 @@ std::vector< std::string > ld_args( cc::ParsedOpts& po, PairedFiles& objFiles )
for ( auto file : objFiles ) for ( auto file : objFiles )
{ {
if ( file.first == "lib" )
{
args.push_back( "-l" + file.second );
continue;
}
if ( is_object_type( file.first ) ) if ( is_object_type( file.first ) )
args.push_back( file.first ); args.push_back( file.first );
else else
...@@ -331,6 +339,11 @@ int main( int argc, char **argv ) ...@@ -331,6 +339,11 @@ int main( int argc, char **argv )
ofn = ifn; ofn = ifn;
objFiles.emplace_back( ifn, ofn ); objFiles.emplace_back( ifn, ofn );
} }
else
{
assert( srcFile.is< cc::Lib >() );
objFiles.emplace_back( "lib", srcFile.get< cc::Lib >().name );
}
} }
if ( po.toObjectOnly ) if ( po.toObjectOnly )
......
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