File tree Expand file tree Collapse file tree 3 files changed +22
-1
lines changed
Expand file tree Collapse file tree 3 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -121,6 +121,7 @@ check_symbol_exists(pthread_setaffinity_np pthread.h HAVE_DECL_PTHREAD_SETAFFINI
121121set (CMK_HAS_PTHREAD_SETAFFINITY ${HAVE_DECL_PTHREAD_SETAFFINITY_NP} )
122122check_symbol_exists(pthread_spin_lock pthread.h CMK_HAS_SPINLOCK)
123123check_symbol_exists(pvalloc malloc.h CMK_HAS_PVALLOC)
124+ check_symbol_exists(RTLD_DEEPBIND dlfcn.h CMK_HAS_RTLD_DEEPBIND)
124125check_symbol_exists(RTLD_DEFAULT dlfcn.h CMK_HAS_RTLD_DEFAULT)
125126check_symbol_exists(RTLD_NEXT dlfcn.h CMK_HAS_RTLD_NEXT)
126127check_function_exists(readlink CMK_HAS_READLINK)
Original file line number Diff line number Diff line change @@ -39,7 +39,10 @@ void AMPI_Node_Setup(int numranks)
3939 for (int myrank = 0 ; myrank < numranks ; ++ myrank )
4040 {
4141 const Lmid_t lmid = LM_ID_NEWLM ;
42- const int flags = RTLD_NOW |RTLD_LOCAL |RTLD_DEEPBIND ;
42+ int flags = RTLD_NOW |RTLD_LOCAL ;
43+ #if CMK_HAS_RTLD_DEEPBIND
44+ flags |= RTLD_DEEPBIND ;
45+ #endif
4346 SharedObject myexe = dlmopen (lmid , binary_path .c_str (), flags );
4447
4548 if (myexe == nullptr )
Original file line number Diff line number Diff line change @@ -2177,6 +2177,23 @@ then
21772177 AC_DEFINE_UNQUOTED ( CMK_DLL_USE_DLOPEN , 1 , [ dlopen] )
21782178fi
21792179
2180+ cat > $tc <<EOT
2181+ # ifndef _GNU_SOURCE
2182+ # define _GNU_SOURCE
2183+ # endif
2184+ # ifndef __USE_GNU
2185+ # define __USE_GNU
2186+ # endif
2187+ # include <dlfcn.h>
2188+ # include <stddef.h>
2189+ int main()
2190+ {
2191+ return dlopen("", RTLD_DEEPBIND) == NULL;
2192+ }
2193+ EOT
2194+ test_cc "whether has RTLD_DEEPBIND" "yes" "no" ""
2195+ AC_DEFINE_UNQUOTED ( CMK_HAS_RTLD_DEEPBIND , $pass , [ whether has RTLD_DEEPBIND] )
2196+
21802197cat > $tc <<EOT
21812198# ifndef _GNU_SOURCE
21822199# define _GNU_SOURCE
You can’t perform that action at this time.
0 commit comments