1From 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---
16Upstream-Status: Pending
17
18 lib/monkey/CMakeLists.txt | 2 ++
19 1 file changed, 2 insertions(+)
20
21diff --git a/lib/monkey/CMakeLists.txt b/lib/monkey/CMakeLists.txt
22index 15e62e8..96ac2bd 100644
23--- a/lib/monkey/CMakeLists.txt
24+++ b/lib/monkey/CMakeLists.txt
25@@ -178,6 +178,8 @@ endif()
26 # Use old Pthread TLS
27 if(NOT MK_PTHREAD_TLS)
28   check_c_source_compiles("
29+     #include <sys/types.h>
30+     extern void *__tls_get_addr(size_t *v);
31      __thread int a;
32      int main() {
33          __tls_get_addr(0);
34--
352.37.1
36
37