summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-cmake-Link-with-libatomic-on-rv32-rv64.patch45
-rw-r--r--meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.8.bb3
2 files changed, 48 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-cmake-Link-with-libatomic-on-rv32-rv64.patch b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-cmake-Link-with-libatomic-on-rv32-rv64.patch
new file mode 100644
index 000000000..7b40b7a67
--- /dev/null
+++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-cmake-Link-with-libatomic-on-rv32-rv64.patch
@@ -0,0 +1,45 @@
1From dd2d42a7f877d292f86e421dd9651f4b7c2abf18 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 19 Apr 2022 14:57:58 -0700
4Subject: [PATCH] cmake: Link with libatomic on rv32/rv64
5
6Use of <atomic> needs to link in libatomic on riscv
7Fixes
8
9undefined reference to `__atomic_exchange_1'
10
11Upstream-Status: Pending
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 src/lib/CMakeLists.txt | 8 +++++++-
15 1 file changed, 7 insertions(+), 1 deletion(-)
16
17diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
18index 3293376..65018be 100644
19--- a/src/lib/CMakeLists.txt
20+++ b/src/lib/CMakeLists.txt
21@@ -37,6 +37,12 @@ else()
22 set(SOCKET_LIBRARY socket)
23 endif()
24
25+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "riscv32")
26+ set(ATOMIC_LIBRARY atomic)
27+else()
28+ set(ATOMIC_LIBRARY "")
29+endif()
30+
31 if(HAVE_FUNC_PTHREAD_SETNAME_NP)
32 add_definitions(-DDLT_USE_PTHREAD_SETNAME_NP)
33 message(STATUS "Using pthread_setname_np API to set thread name")
34@@ -44,7 +50,7 @@ else()
35 message(STATUS "pthread_setname_np API not available on this platform")
36 endif()
37
38-target_link_libraries(dlt ${RT_LIBRARY} ${SOCKET_LIBRARY} Threads::Threads)
39+target_link_libraries(dlt ${RT_LIBRARY} ${SOCKET_LIBRARY} ${ATOMIC_LIBRARY} Threads::Threads)
40
41 target_include_directories(dlt
42 PUBLIC
43--
442.36.0
45
diff --git a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.8.bb b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.8.bb
index 014c77358..2cea50dfb 100644
--- a/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.8.bb
+++ b/meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.8.bb
@@ -17,6 +17,7 @@ DEPENDS = "zlib gzip-native json-c"
17SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=https;branch=master \ 17SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=https;branch=master \
18 file://0002-Don-t-execute-processes-as-a-specific-user.patch \ 18 file://0002-Don-t-execute-processes-as-a-specific-user.patch \
19 file://0004-Modify-systemd-config-directory.patch \ 19 file://0004-Modify-systemd-config-directory.patch \
20 file://0001-cmake-Link-with-libatomic-on-rv32-rv64.patch \
20 " 21 "
21SRCREV = "0138c00811c86eab4ff6bff3c6528163885ade19" 22SRCREV = "0138c00811c86eab4ff6bff3c6528163885ade19"
22 23
@@ -24,6 +25,8 @@ PV .= "+2.18.9git${SRCPV}"
24 25
25S = "${WORKDIR}/git" 26S = "${WORKDIR}/git"
26 27
28LDFLAGS:append:riscv64 = " -latomic"
29
27PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd systemd-watchdog systemd-journal dlt-examples dlt-adaptor dlt-console ', '', d)} \ 30PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd systemd-watchdog systemd-journal dlt-examples dlt-adaptor dlt-console ', '', d)} \
28 udp-connection dlt-system dlt-filetransfer " 31 udp-connection dlt-system dlt-filetransfer "
29# dlt-dbus 32# dlt-dbus