aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/fluentbit/fluentbit/0006-monkey-Fix-TLS-detection-testcase.patch
blob: c3f2574d2629df7df9bd5443a2d695d3ec5754b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From f88d9b82e8bd8ae38fba666b5825ffb41769f81a Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Tue, 9 Aug 2022 12:25:22 -0700
Subject: [PATCH] monkey: Fix TLS detection testcase

Clang15 errors out on compiling the check and disables TLS

Fixes errors like

error: call to undeclared function '__tls_get_addr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
         __tls_get_addr(0);
         ^

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Upstream-Status: Pending

 lib/monkey/CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/monkey/CMakeLists.txt b/lib/monkey/CMakeLists.txt
index 15e62e8..96ac2bd 100644
--- a/lib/monkey/CMakeLists.txt
+++ b/lib/monkey/CMakeLists.txt
@@ -178,6 +178,8 @@ endif()
 # Use old Pthread TLS
 if(NOT MK_PTHREAD_TLS)
   check_c_source_compiles("
+     #include <sys/types.h>
+     extern void *__tls_get_addr(size_t *v);
      __thread int a;
      int main() {
          __tls_get_addr(0);
-- 
2.37.1