blob: 0264aeab52f51e5ae9f347cd64de4e550b906748 (
plain)
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
|
# RTLD_DI_ORIGIN is not defined in musl as a result hpx fails to build.
# Closes: https://bugs.gentoo.org/829242
#
# With this PR https://github.com/STEllAR-GROUP/hpx/pull/5947 merged, from
# 1.8.1 we can drop these patches
--- a/libs/core/plugin/include/hpx/plugin/detail/dll_dlopen.hpp
+++ b/libs/core/plugin/include/hpx/plugin/detail/dll_dlopen.hpp
@@ -319,6 +319,7 @@ namespace hpx { namespace util { namespace plugin {
std::string result;
#if !defined(__ANDROID__) && !defined(ANDROID) && !defined(__APPLE__)
+#if defined(RTLD_DI_ORIGIN)
char directory[PATH_MAX] = {'\0'};
const_cast<dll&>(*this).LoadLibrary(ec);
if (!ec && ::dlinfo(dll_handle, RTLD_DI_ORIGIN, directory) < 0)
@@ -333,6 +334,9 @@ namespace hpx { namespace util { namespace plugin {
}
result = directory;
::dlerror(); // Clear the error state.
+#else
+ result = path(dll_name).parent_path().string();
+#endif
#elif defined(__APPLE__)
// SO staticfloat's solution
const_cast<dll&>(*this).LoadLibrary(ec);
|