X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgnulinker.cpp;h=19313336473a2ac92b6f26e80e05824f94371347;hb=d2df46cb44da788af02fa163a2ecb288e6ef15dc;hp=2416449d63c5654a6f6dce62d6a620a6af1420c7;hpb=7780df0b9a760327a9ad9ff80fc6b5d9a273db96;p=builder.git diff --git a/source/gnulinker.cpp b/source/gnulinker.cpp index 2416449..1931333 100644 --- a/source/gnulinker.cpp +++ b/source/gnulinker.cpp @@ -29,7 +29,7 @@ GnuLinker::GnuLinker(Builder &b, const Architecture &a): processing_unit = COMPONENT; - set_command("gcc"); + set_command("gcc", true); set_run(_run); } @@ -98,15 +98,17 @@ string GnuLinker::create_build_signature(const BuildInfo &binfo) const return result; } -void GnuLinker::do_prepare() +void GnuLinker::do_prepare(ToolData &tool) const { bool path_found = false; - const FS::Path &sysroot = build_info.sysroot; + const FS::Path &sysroot = tool.build_info.sysroot; + const std::string &tool_tag = static_cast(tool).get_tag(); - if(executable) + const FileTarget *exe = static_cast(tool).get_executable(); + if(exe) { ExternalTask::Arguments argv; - argv.push_back(executable->get_path().str()); + argv.push_back(exe->get_path().str()); argv.push_back("-Wl,--verbose"); argv.push_back("-nostdlib"); if(!sysroot.empty()) @@ -139,8 +141,8 @@ void GnuLinker::do_prepare() } path /= output.substr(search_dir, end-search_dir); - builder.get_logger().log("tools", "Got %s system path: %s", tag, path); - system_path.push_back(path); + builder.get_logger().log("tools", "Got %s system path: %s", tool_tag, path); + tool.system_path.push_back(path); path_found = true; start = end+3; @@ -152,26 +154,26 @@ void GnuLinker::do_prepare() if(!path_found) { - builder.get_logger().log("tools", "No %s system path found, using defaults", tag); + builder.get_logger().log("tools", "No %s system path found, using defaults", tool_tag); if(!sysroot.empty()) - system_path.push_back(sysroot/"usr/lib"); + tool.system_path.push_back(sysroot/"usr/lib"); else if(architecture->is_native()) { - system_path.push_back("/lib"); - system_path.push_back("/usr/lib"); + tool.system_path.push_back("/lib"); + tool.system_path.push_back("/usr/lib"); if(architecture->match_name("pc-32-linux")) { - system_path.push_back("/lib/i386-linux-gnu"); - system_path.push_back("/usr/lib/i386-linux-gnu"); + tool.system_path.push_back("/lib/i386-linux-gnu"); + tool.system_path.push_back("/usr/lib/i386-linux-gnu"); } else if(architecture->match_name("pc-64-linux")) { - system_path.push_back("/lib/x86_64-linux-gnu"); - system_path.push_back("/usr/lib/x86_64-linux-gnu"); + tool.system_path.push_back("/lib/x86_64-linux-gnu"); + tool.system_path.push_back("/usr/lib/x86_64-linux-gnu"); } } else - system_path.push_back(format("/usr/%s/lib", architecture->get_cross_prefix())); + tool.system_path.push_back(format("/usr/%s/lib", architecture->get_cross_prefix())); } }