]> git.tdb.fi Git - builder.git/blobdiff - source/gnulinker.cpp
Support source generators that combine multiple files into one
[builder.git] / source / gnulinker.cpp
index 2ec4c048d613372205f0a48421c2dcc24d19eff4..cc0a50d3ace1ef23db89835b4ad240bce64e4956 100644 (file)
@@ -27,6 +27,8 @@ GnuLinker::GnuLinker(Builder &b, const Architecture &a, const FS::Path &sysroot)
        input_suffixes.push_back(".o");
        input_suffixes.push_back(".a");
 
+       processing_unit = COMPONENT;
+
        if(!sysroot.empty())
        {
                build_info.sysroot = sysroot;
@@ -223,8 +225,14 @@ Task *GnuLinker::Linker::run(const Target &target) const
        argv.push_back("-o");
        argv.push_back(relative(bin.get_path(), work_dir).str());
 
+       for(BuildInfo::WordList::const_iterator i=binfo.keep_symbols.begin(); i!=binfo.keep_symbols.end(); ++i)
+               argv.push_back("-u"+*i);
+
        bool static_link_ok = (binfo.libmode<=BuildInfo::STATIC);
 
+       if(architecture->get_system()=="windows" && architecture->get_cross_prefix().find("mingw")!=string::npos)
+               argv.push_back("-lmingw32");
+
        const Target::Dependencies &depends = target.get_dependencies();
        for(Target::Dependencies::const_iterator i=depends.begin(); i!=depends.end(); ++i)
        {