]> git.tdb.fi Git - builder.git/commitdiff
Add gcc's private library directory to ClangLinker's system path
authorMikko Rasa <tdb@tdb.fi>
Tue, 27 Dec 2022 20:41:22 +0000 (22:41 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 27 Dec 2022 20:41:22 +0000 (22:41 +0200)
It's needed for libstdc++.

source/clanglinker.cpp
source/clanglinker.h

index 9d39979835fe5c7c1a5eb01b1804a38cbf16700c..508902804af2d58a8b89c29edf40ce0474745bdb 100644 (file)
@@ -1,7 +1,24 @@
+#include <msp/fs/stat.h>
+#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<const Tool &>(tool).get_tag(), p);
+                       tool.system_path.push_back(p);
+                       break;
+               }
+}
index fd7e264f7ef9ed99568d422d746e79eb008c89e8..de65e645b4ed407f62d829f7049ae7feaeb88f22 100644 (file)
@@ -7,6 +7,9 @@ class ClangLinker: public CustomizedTool
 {
 public:
        ClangLinker(Builder &, const Architecture &);
+
+protected:
+       void do_prepare(ToolData &) const override;
 };
 
 #endif