File: 0011-module_loader.cpp-Change-modules-path-to-multiarch.patch

package info (click to toggle)
xrt 202210.2.13.466%2Bdfsg-8.2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 81,372 kB
  • sloc: cpp: 410,114; ansic: 134,206; sh: 6,503; python: 5,564; lisp: 1,345; makefile: 901; xml: 256; csh: 220; perl: 48; tcl: 5
file content (32 lines) | stat: -rw-r--r-- 1,157 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From 46c3ca855ea9e38ac48b8ccae314426f554a108d Mon Sep 17 00:00:00 2001
From: Nobuhiro Iwamatsu <iwamatsu@debian.org>
Date: Tue, 28 Feb 2023 05:49:52 +0900
Subject: [PATCH] module_loader.cpp: Change modules path to multiarch

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@debian.org>
---
 src/runtime_src/core/common/module_loader.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/runtime_src/core/common/module_loader.cpp b/src/runtime_src/core/common/module_loader.cpp
index b4c7e4996..0d078b90b 100644
--- a/src/runtime_src/core/common/module_loader.cpp
+++ b/src/runtime_src/core/common/module_loader.cpp
@@ -116,7 +116,13 @@ module_path(const std::string& module)
 #ifdef _WIN32
   path /= "bin/" + module + ".dll";
 #else
-  path /= "lib/xrt/module/lib" + module + ".so";
+#if defined (__aarch64__)
+  path = "/usr/lib/aarch64-linux-gnu/xrt/module/lib" + module + ".so";
+#elif defined (__x86_64__)
+  path = "/usr/lib/x86_64-linux-gnu/xrt/module/lib" + module + ".so";
+#else
+  throw std::runtime_error("Not support architecture");
+#endif
 #endif
 
   if (!bfs::exists(path) || !bfs::is_regular_file(path))
-- 
2.36.1