From: Mikko Rasa Date: Tue, 27 Dec 2022 20:41:22 +0000 (+0200) Subject: Add gcc's private library directory to ClangLinker's system path X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e2c9c3fffcc61a0c102ccf6a7924e2de709092ad;p=builder.git Add gcc's private library directory to ClangLinker's system path It's needed for libstdc++. --- diff --git a/source/clanglinker.cpp b/source/clanglinker.cpp index 9d39979..5089028 100644 --- a/source/clanglinker.cpp +++ b/source/clanglinker.cpp @@ -1,7 +1,24 @@ +#include +#include "builder.h" #include "clanglinker.h" +using namespace Msp; + ClangLinker::ClangLinker(Builder &b, const Architecture &a): CustomizedTool(b, "LINK", a) { set_command("clang", true); } + +void ClangLinker::do_prepare(ToolData &tool) const +{ + parent.prepare(); + CustomizedTool::do_prepare(tool); + for(const FS::Path &p: parent.get_system_path()) + if(FS::exists(p/"libstdc++.so")) + { + builder.get_logger().log("tools", "Got %s gcc system path: %s", static_cast(tool).get_tag(), p); + tool.system_path.push_back(p); + break; + } +} diff --git a/source/clanglinker.h b/source/clanglinker.h index fd7e264..de65e64 100644 --- a/source/clanglinker.h +++ b/source/clanglinker.h @@ -7,6 +7,9 @@ class ClangLinker: public CustomizedTool { public: ClangLinker(Builder &, const Architecture &); + +protected: + void do_prepare(ToolData &) const override; }; #endif