freebsd-ports/lang/intel-compute-runtime/files/patch-rtld

32 lines
1.3 KiB
Text

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;