celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pnol...@apache.org
Subject celix git commit: CELIX-347: Changes build options for building with dependency manager. Trying to fix issues when building with asan
Date Tue, 16 Feb 2016 18:44:29 GMT
Repository: celix
Updated Branches:
  refs/heads/develop c1078421b -> 9ba383291


CELIX-347: Changes build options for building with dependency manager. Trying to fix issues
when building with asan


Project: http://git-wip-us.apache.org/repos/asf/celix/repo
Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/9ba38329
Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/9ba38329
Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/9ba38329

Branch: refs/heads/develop
Commit: 9ba3832910d933cea7cd9e110f51e35710d373ab
Parents: c107842
Author: Pepijn Noltes <pepijnnoltes@gmail.com>
Authored: Tue Feb 16 19:43:32 2016 +0100
Committer: Pepijn Noltes <pepijnnoltes@gmail.com>
Committed: Tue Feb 16 19:43:32 2016 +0100

----------------------------------------------------------------------
 cmake/cmake_celix/BuildOptions.cmake       | 4 ++--
 examples/dm_example/phase1/CMakeLists.txt  | 9 +++++++--
 examples/dm_example/phase2a/CMakeLists.txt | 7 ++++++-
 examples/dm_example/phase2b/CMakeLists.txt | 7 ++++++-
 examples/dm_example/phase3/CMakeLists.txt  | 7 ++++++-
 5 files changed, 27 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/cmake/cmake_celix/BuildOptions.cmake
----------------------------------------------------------------------
diff --git a/cmake/cmake_celix/BuildOptions.cmake b/cmake/cmake_celix/BuildOptions.cmake
index 11deb68..8c5caf5 100644
--- a/cmake/cmake_celix/BuildOptions.cmake
+++ b/cmake/cmake_celix/BuildOptions.cmake
@@ -2,6 +2,6 @@
 option(ENABLE_ADDRESS_SANITIZER "Enabled building with address sanitizer. Note for gcc libasan
must be installed" OFF)
 
 if (ENABLE_ADDRESS_SANITIZER)
-    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS} -Wl,--allow-shlib-undefined")
-    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS} -Wl,--allow-shlib-undefined")
+    set(CMAKE_C_FLAGS "-lasan -fsanitize=address ${CMAKE_C_FLAGS}")
+    set(CMAKE_CXX_FLAGS "-lasan -fsanitize=address ${CMAKE_CXX_FLAGS}")
 endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase1/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase1/CMakeLists.txt b/examples/dm_example/phase1/CMakeLists.txt
index b8c34b3..99abe65 100644
--- a/examples/dm_example/phase1/CMakeLists.txt
+++ b/examples/dm_example/phase1/CMakeLists.txt
@@ -34,5 +34,10 @@ add_bundle(phase1
 IF(APPLE)
     target_link_libraries(phase1 celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase1 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
-ENDIF()
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase1 -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive
celix_framework)
+    else()
+        target_link_libraries(phase1 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    endif()
+endif()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase2a/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2a/CMakeLists.txt b/examples/dm_example/phase2a/CMakeLists.txt
index 5474534..31c27a6 100644
--- a/examples/dm_example/phase2a/CMakeLists.txt
+++ b/examples/dm_example/phase2a/CMakeLists.txt
@@ -31,5 +31,10 @@ add_bundle(phase2a
 IF(APPLE)
     target_link_libraries(phase2a celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase2a -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase2a -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive
celix_framework)
+    else()
+        target_link_libraries(phase2a -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    endif()
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase2b/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase2b/CMakeLists.txt b/examples/dm_example/phase2b/CMakeLists.txt
index ff3089c..1d107ec 100644
--- a/examples/dm_example/phase2b/CMakeLists.txt
+++ b/examples/dm_example/phase2b/CMakeLists.txt
@@ -33,5 +33,10 @@ add_bundle(phase2b
 IF(APPLE)
     target_link_libraries(phase2b celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase2b -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase2b -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive
celix_framework)
+    else()
+        target_link_libraries(phase2b -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    endif()
 ENDIF()

http://git-wip-us.apache.org/repos/asf/celix/blob/9ba38329/examples/dm_example/phase3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/dm_example/phase3/CMakeLists.txt b/examples/dm_example/phase3/CMakeLists.txt
index 71d31c0..aea9f9e 100644
--- a/examples/dm_example/phase3/CMakeLists.txt
+++ b/examples/dm_example/phase3/CMakeLists.txt
@@ -33,5 +33,10 @@ add_bundle(phase3
 IF(APPLE)
     target_link_libraries(phase3 celix_framework -Wl,-all_load dependency_manager_static)
 else()
-    target_link_libraries(phase3 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    if(ENABLE_ADDRESS_SANITIZER)
+        #With asan there can be undefined symbols
+        target_link_libraries(phase3 -Wl,--whole-archive dependency_manager_static -Wl,--no-whole-archive
celix_framework)
+    else()
+        target_link_libraries(phase3 -Wl,--no-undefined -Wl,--whole-archive dependency_manager_static
-Wl,--no-whole-archive celix_framework)
+    endif()
 ENDIF()


Mime
View raw message