diff options
-rw-r--r-- | src/ToolBox/SOS/Strike/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/dlls/mscordbi/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/dlls/mscoree/coreclr/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/pal/src/CMakeLists.txt | 16 | ||||
-rw-r--r-- | src/pal/src/loader/module.cpp | 12 |
5 files changed, 23 insertions, 13 deletions
diff --git a/src/ToolBox/SOS/Strike/CMakeLists.txt b/src/ToolBox/SOS/Strike/CMakeLists.txt index 9c05c3044b..8040f5b7b7 100644 --- a/src/ToolBox/SOS/Strike/CMakeLists.txt +++ b/src/ToolBox/SOS/Strike/CMakeLists.txt @@ -89,10 +89,11 @@ else(WIN32) ) set(SOS_LIBRARY + CoreClrPal corguids - mscordaccore debugshim dbgutil + palrt ) endif(WIN32) diff --git a/src/dlls/mscordbi/CMakeLists.txt b/src/dlls/mscordbi/CMakeLists.txt index 0e90b16211..d123170412 100644 --- a/src/dlls/mscordbi/CMakeLists.txt +++ b/src/dlls/mscordbi/CMakeLists.txt @@ -57,7 +57,8 @@ if(WIN32) elseif(CLR_CMAKE_PLATFORM_UNIX) list(APPEND COREDBI_LIBRARIES mdhotdata_full - mscordaccore + CoreClrPal + palrt ) # COREDBI_LIBRARIES is mentioned twice because ld is one pass linker and will not find symbols diff --git a/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/dlls/mscoree/coreclr/CMakeLists.txt index c49b5e7bde..e8a0ac84e5 100644 --- a/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -94,9 +94,7 @@ if(WIN32) ) else() list(APPEND CORECLR_LIBRARIES - ${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available CoreClrPal - ${END_WHOLE_ARCHIVE} palrt ) endif(WIN32) diff --git a/src/pal/src/CMakeLists.txt b/src/pal/src/CMakeLists.txt index 1023ae1242..fd2c4ad093 100644 --- a/src/pal/src/CMakeLists.txt +++ b/src/pal/src/CMakeLists.txt @@ -150,18 +150,18 @@ set(SOURCES ) add_library(CoreClrPal - STATIC + SHARED ${SOURCES} ${PLATFORM_SOURCES} ) if(CMAKE_SYSTEM_NAME STREQUAL Linux) -target_link_libraries(CoreClrPal - pthread - rt - dl - unwind -) + target_link_libraries(CoreClrPal + pthread + rt + dl + unwind + ) endif(CMAKE_SYSTEM_NAME STREQUAL Linux) if(CMAKE_SYSTEM_NAME STREQUAL Darwin) @@ -178,3 +178,5 @@ if(CMAKE_SYSTEM_NAME STREQUAL Darwin) endif(CMAKE_SYSTEM_NAME STREQUAL Darwin) add_subdirectory(examples) + +install(TARGETS CoreClrPal DESTINATION .)
\ No newline at end of file diff --git a/src/pal/src/loader/module.cpp b/src/pal/src/loader/module.cpp index dfc4b30738..0c894bbf66 100644 --- a/src/pal/src/loader/module.cpp +++ b/src/pal/src/loader/module.cpp @@ -1397,7 +1397,11 @@ static HMODULE LOADLoadLibrary(LPCSTR ShortAsciiName, BOOL fDynamic) { // See GetProcAddress for an explanation why we leave the PAL. PAL_LeaveHolder holder; - dl_handle = dlopen(ShortAsciiName, RTLD_LAZY); + dl_handle = dlopen(ShortAsciiName, RTLD_LAZY | RTLD_NOLOAD); + if (!dl_handle) + { + dl_handle = dlopen(ShortAsciiName, RTLD_LAZY); + } // P/Invoke calls are often defined without an extension in the name of the // target library. So if we failed to load the specified library, try adding @@ -1406,7 +1410,11 @@ static HMODULE LOADLoadLibrary(LPCSTR ShortAsciiName, BOOL fDynamic) { if (snprintf(fullLibraryName, MAX_PATH, "%s%s", ShortAsciiName, PAL_SHLIB_SUFFIX) < MAX_PATH) { - dl_handle = dlopen(fullLibraryName, RTLD_LAZY); + dl_handle = dlopen(fullLibraryName, RTLD_LAZY | RTLD_NOLOAD); + if (!dl_handle) + { + dl_handle = dlopen(fullLibraryName, RTLD_LAZY); + } if (dl_handle) { ShortAsciiName = fullLibraryName; |