Files
meta-openembedded/meta-oe/recipes-extended/fluentbit/fluentbit/0006-monkey-Fix-TLS-detection-testcase.patch
Khem Raj 0f8dced8c7 fluentbit: Fix build with clang
Fix build using clang-15 which is even stricter then clang-14
These patches are worth upstream too

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Paulo Neves <ptsneves@gmail.com>
2022-08-10 08:48:26 -07:00

35 lines
1006 B
Diff

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>
---
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