Skip to content

Commit a7cd535

Browse files
author
elsa
committed
add tls flags to customlabels dep
1 parent f9f5659 commit a7cd535

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

cmake/deps/customlabels.cmake

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ FetchContent_Declare(customlabels
55
GIT_TAG elsa/add-process-storage
66
)
77

8+
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
9+
set(TLS_DIALECT desc)
10+
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64")
11+
set(TLS_DIALECT gnu2)
12+
else()
13+
message(FATAL_ERROR "Only aarch64 and x86-64 are supported (found: ${CMAKE_SYSTEM_PROCESSOR})")
14+
endif()
15+
16+
target_compile_options(dd_trace_cpp-shared PRIVATE
17+
-g
18+
-fPIC
19+
-ftls-model=global-dynamic
20+
-mtls-dialect=${TLS_DIALECT}
21+
)
22+
823
FetchContent_MakeAvailable(customlabels)
924

1025
add_library(customlabels SHARED

0 commit comments

Comments
 (0)