summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-09-16 22:48:42 -0700
committerKhem Raj <raj.khem@gmail.com>2024-09-17 07:50:23 -0700
commita2010f12fd3a0d615c021417b0494447560742a0 (patch)
treeeae18e039959fddc11d47818cf32c7c522f45e9a
parent2b9f166f28039f80d1c54d1541802daa845d5e25 (diff)
downloadmeta-openembedded-a2010f12fd3a0d615c021417b0494447560742a0.tar.gz
netdata: Add checks for 64-bit atomic builtins
This helps in passing correct flags to h2o module compilation Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-webserver/recipes-webadmin/netdata/netdata/0001-cmake-Add-check-for-64bit-builtin-atomics.patch51
-rw-r--r--meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb1
2 files changed, 52 insertions, 0 deletions
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata/0001-cmake-Add-check-for-64bit-builtin-atomics.patch b/meta-webserver/recipes-webadmin/netdata/netdata/0001-cmake-Add-check-for-64bit-builtin-atomics.patch
new file mode 100644
index 0000000000..d8ad69ceca
--- /dev/null
+++ b/meta-webserver/recipes-webadmin/netdata/netdata/0001-cmake-Add-check-for-64bit-builtin-atomics.patch
@@ -0,0 +1,51 @@
1From 1e8fbb6da4e5ee44fe24c078aae1930d759f0ba3 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 17 Sep 2024 05:29:13 +0000
4Subject: [PATCH] cmake: Add check for 64bit builtin atomics
5
6Compilers for some architectures e.g. RISCV32 do not have 64bit atomics
7therefore, its important to deduce that and use it to pass right flags to
8compiler to use them, e.g. h2o module
9
10Fixes
11nection.c.o): in function `h2o_create_connection':
12| /usr/src/debug/netdata/1.47.1/src/web/server/h2o/libh2o/include/h2o.h:1917:(.text.create_conn+0x5e): undefined reference to `__sync_add_and_fetch_8'
13| collect2: error: ld returned 1 exit status
14
15Upstream-Status: Submitted [https://github.com/netdata/netdata/pull/18565]
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 CMakeLists.txt | 13 +++++++++++++
19 1 file changed, 13 insertions(+)
20
21Index: netdata-v1.47.1/CMakeLists.txt
22===================================================================
23--- netdata-v1.47.1.orig/CMakeLists.txt
24+++ netdata-v1.47.1/CMakeLists.txt
25@@ -448,6 +448,15 @@ int main() {
26 }
27 " HAVE_BUILTIN_ATOMICS)
28
29+check_cxx_source_compiles("
30+#include <stdint.h>
31+int main(void) {
32+ uint64_t a;
33+ __sync_add_and_fetch(&a, 1);
34+ return 0;
35+}
36+" ARCH_SUPPORTS_64BIT_ATOMICS)
37+
38 check_c_source_compiles("
39 void my_printf(char const *s, ...) __attribute__((format(gnu_printf, 1, 2)));
40 int main() { return 0; }
41@@ -523,6 +532,10 @@ if(OS_FREEBSD OR OS_MACOS)
42 set(HAVE_BUILTIN_ATOMICS True)
43 endif()
44
45+if (ENABLE_H2O AND NOT ARCH_SUPPORTS_64BIT_ATOMICS)
46+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DH2O_NO_64BIT_ATOMICS")
47+endif (NOT ARCH_SUPPORTS_64BIT_ATOMICS)
48+
49 # openssl/crypto
50 set(ENABLE_OPENSSL True)
51 pkg_check_modules(TLS IMPORTED_TARGET openssl)
diff --git a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb
index e134c06b06..5b38d401cd 100644
--- a/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb
+++ b/meta-webserver/recipes-webadmin/netdata/netdata_1.47.1.bb
@@ -9,6 +9,7 @@ DEPENDS += "json-c libuv libyaml util-linux zlib lz4"
9 9
10SRC_URI = "\ 10SRC_URI = "\
11 https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \ 11 https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BPN}-v${PV}.tar.gz \
12 file://0001-cmake-Add-check-for-64bit-builtin-atomics.patch \
12 file://netdata.conf \ 13 file://netdata.conf \
13 file://netdata.service \ 14 file://netdata.service \
14 file://netdata-volatiles.conf \ 15 file://netdata-volatiles.conf \