)
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)
endif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_subdirectory(examples)
+
+install(TARGETS CoreClrPal DESTINATION .)
\ No newline at end of file
{
// 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
{
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;