diff options
author | Mikhail Maltsev <mikhail.maltsev@arm.com> | 2018-06-11 09:15:37 +0000 |
---|---|---|
committer | Mikhail Maltsev <mikhail.maltsev@arm.com> | 2018-06-11 09:15:37 +0000 |
commit | fa5a72865791f17d80ee101d8218e57a690a41fa (patch) | |
tree | d17d77485c8a5d4bb2ec11e65e74f733c3743225 | |
parent | 33513811656baddad1a9a6d15da1703c06661aaa (diff) | |
download | bcm5719-llvm-fa5a72865791f17d80ee101d8218e57a690a41fa.tar.gz bcm5719-llvm-fa5a72865791f17d80ee101d8218e57a690a41fa.zip |
[Unittests] Change linker flags of dynamic library tests
A recent change https://reviews.llvm.org/D46898 which had no intended
behavior change, actually modified the linker flags used when linking
the dynamic libraries used by the DynamicLibraryTests unit test. This
made the test fail in our testing environment which runs the tests
from an NFS share. Prior to D46898 the two libraries used by the test
were different (because the library name used to be embedded into the
binary), and after the change they became bit-to-bit identical. This
causes dlopen to return the same handle when these two libraries are
loaded from an NFS share, and the test expects two different handles.
This patch reverts the part of D46898 that is responsible for
changing the linker flags.
Differential Revision: https://reviews.llvm.org/D47469
llvm-svn: 334394
-rw-r--r-- | llvm/unittests/Support/DynamicLibrary/CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt index a3d2c2649c9..ec202295ac1 100644 --- a/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt +++ b/llvm/unittests/Support/DynamicLibrary/CMakeLists.txt @@ -15,7 +15,7 @@ target_link_libraries(DynamicLibraryTests PRIVATE DynamicLibraryLib) export_executable_symbols(DynamicLibraryTests) function(dynlib_add_module NAME) - add_library(${NAME} MODULE + add_library(${NAME} SHARED PipSqueak.cpp ) set_target_properties(${NAME} PROPERTIES FOLDER "Tests") @@ -33,5 +33,12 @@ function(dynlib_add_module NAME) add_dependencies(DynamicLibraryTests ${NAME}) endfunction(dynlib_add_module) +# Revert -Wl,-z,nodelete on this test since it relies on the file +# being unloaded. +if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + string(REPLACE "-Wl,-z,nodelete" "" CMAKE_SHARED_LINKER_FLAGS + ${CMAKE_SHARED_LINKER_FLAGS}) +endif() + dynlib_add_module(PipSqueak) dynlib_add_module(SecondLib) |