Skip to content

Commit

Permalink
Enable position independent code for these tests
Browse files Browse the repository at this point in the history
Fixes:
ld: error: relocation R_X86_64_32 cannot be used against local symbol; recompile with -fPIC
  • Loading branch information
Andras Mantia authored and milianw committed Jan 13, 2024
1 parent fa05d31 commit ee2dd24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/test-clients/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include(CMakePushCheckState)
# Check if static linking works at all. For example OpenSuse 42.3 with clang
# doesn't ship a static libc++.a, making static linking fail.
cmake_push_check_state(RESET)
set(CMAKE_POSITION_INDEPENDENT_CODE On)
set(CMAKE_REQUIRED_LIBRARIES "-static")
set(CMAKE_REQUIRED_FLAGS "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
check_cxx_source_compiles("int main() {}" STATIC_LINKING_WORKS)
Expand Down

0 comments on commit ee2dd24

Please sign in to comment.