summaryrefslogtreecommitdiff
path: root/lang/intel-compute-runtime/files/patch-rtld
blob: 624554e2c6161ff03a3ca5803a5b81685fcdd0aa (plain) (blame)
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
RTLD_DEEPBIND isn't available on non-Linux

shared/source/os_interface/linux/os_library_helper.cpp:17:24: error: use of undeclared identifier 'RTLD_DEEPBIND'
        dlopenFlag &= ~RTLD_DEEPBIND;
                       ^
shared/source/os_interface/linux/os_library_linux.cpp:41:39: error: use of undeclared identifier 'RTLD_DEEPBIND'
        auto dlopenFlag = RTLD_LAZY | RTLD_DEEPBIND;
                                      ^

--- shared/source/os_interface/linux/os_library_helper.cpp.orig	2021-03-01 17:17:25 UTC
+++ shared/source/os_interface/linux/os_library_helper.cpp
@@ -14,7 +14,9 @@ namespace NEO {
 namespace Linux {
 void adjustLibraryFlags(int &dlopenFlag) {
     if (DebugManager.flags.DisableDeepBind.get()) {
+#ifdef RTLD_DEEPBIND
         dlopenFlag &= ~RTLD_DEEPBIND;
+#endif
     }
 }
 } // namespace Linux
--- shared/source/os_interface/linux/os_library_linux.cpp.orig	2021-03-01 17:17:25 UTC
+++ shared/source/os_interface/linux/os_library_linux.cpp
@@ -35,7 +35,7 @@ OsLibrary::OsLibrary(const std::string &name) {
     if (name.empty()) {
         this->handle = SysCalls::dlopen(0, RTLD_LAZY);
     } else {
-#ifdef SANITIZER_BUILD
+#if defined(SANITIZER_BUILD) || !defined(RTLD_DEEPBIND)
         auto dlopenFlag = RTLD_LAZY;
 #else
         auto dlopenFlag = RTLD_LAZY | RTLD_DEEPBIND;