Skip to content

Commit

Permalink
GH-40863: [C++] Fix TSAN link error for module library (#40864)
Browse files Browse the repository at this point in the history
### 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]>
  • Loading branch information
zanmato1984 authored Mar 28, 2024
1 parent edf7e57 commit cf832b8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cpp/cmake_modules/san-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf832b8

Please sign in to comment.