This is an automated email from the ASF dual-hosted git repository.

apitrou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new cf832b8b5d GH-40863: [C++] Fix TSAN link error for module library 
(#40864)
cf832b8b5d is described below

commit cf832b8b5dd91ca1b70519fa544f0a44ebdb3bce
Author: Rossi Sun <[email protected]>
AuthorDate: Thu Mar 28 23:23:59 2024 +0800

    GH-40863: [C++] Fix TSAN link error for module library (#40864)
    
    
    
    ### Rationale for this change
    
    Module library `arrow_filesystem_example` is introduced in #39067 for 
filesystem testing:
    
https://github.com/apache/arrow/blob/6cecbab5172b2b339277dde741bfff455646eb32/cpp/src/arrow/testing/CMakeLists.txt#L25
    
    However when built with TSAN, linker flags such as `-fsanitize=thread` is 
not set, causing the link error in #40863.
    
    ### What changes are included in this PR?
    
    Add necessary linker flags for module library.
    
    ### Are these changes tested?
    
    Manually tested.
    
    ### Are there any user-facing changes?
    
    None.
    
    * GitHub Issue: #40863
    
    Authored-by: Ruoxi Sun <[email protected]>
    Signed-off-by: Antoine Pitrou <[email protected]>
---
 cpp/cmake_modules/san-config.cmake | 1 +
 1 file changed, 1 insertion(+)

diff --git a/cpp/cmake_modules/san-config.cmake 
b/cpp/cmake_modules/san-config.cmake
index 2221dc1666..8c2983e18b 100644
--- a/cpp/cmake_modules/san-config.cmake
+++ b/cpp/cmake_modules/san-config.cmake
@@ -78,6 +78,7 @@ if(${ARROW_USE_TSAN})
 
   # Some of the above also need to be passed to the linker.
   set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie 
-fsanitize=thread")
+  set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -pie 
-fsanitize=thread")
 
   # Strictly speaking, TSAN doesn't require dynamic linking. But it does
   # require all code to be position independent, and the easiest way to

Reply via email to