blob: eef1a56ba7bb3892f5693f3d6d6aa96695fd352c [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001From f88d9b82e8bd8ae38fba666b5825ffb41769f81a Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 9 Aug 2022 12:25:22 -0700
4Subject: [PATCH] monkey: Fix TLS detection testcase
5
6Clang15 errors out on compiling the check and disables TLS
7
8Fixes errors like
9
10error: call to undeclared function '__tls_get_addr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
11 __tls_get_addr(0);
12 ^
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 lib/monkey/CMakeLists.txt | 2 ++
17 1 file changed, 2 insertions(+)
18
19diff --git a/lib/monkey/CMakeLists.txt b/lib/monkey/CMakeLists.txt
20index 15e62e8..96ac2bd 100644
21--- a/lib/monkey/CMakeLists.txt
22+++ b/lib/monkey/CMakeLists.txt
23@@ -178,6 +178,8 @@ endif()
24 # Use old Pthread TLS
25 if(NOT MK_PTHREAD_TLS)
26 check_c_source_compiles("
27+ #include <sys/types.h>
28+ extern void *__tls_get_addr(size_t *v);
29 __thread int a;
30 int main() {
31 __tls_get_addr(0);
32--
332.37.1
34