diff options
author | Khem Raj <raj.khem@gmail.com> | 2022-04-19 15:00:32 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2022-04-20 10:58:01 -0700 |
commit | 62a60f91aaf14d438bc2f3f4a851e7474984e09e (patch) | |
tree | 38bfc3e215f0b4813ac379d69ed7fd24fc865d4f /meta-oe/recipes-extended | |
parent | 47d2307ae77e347674a2d99d32d17fd5537a8a9f (diff) | |
download | meta-openembedded-62a60f91aaf14d438bc2f3f4a851e7474984e09e.tar.gz |
dlt-daemon: Fix build on rv32/rv64
This is seen with gcc particularly
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rw-r--r-- | meta-oe/recipes-extended/dlt-daemon/dlt-daemon/0001-cmake-Link-with-libatomic-on-rv32-rv64.patch | 45 | ||||
-rw-r--r-- | meta-oe/recipes-extended/dlt-daemon/dlt-daemon_2.18.8.bb | 3 |
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 @@ | |||
1 | From dd2d42a7f877d292f86e421dd9651f4b7c2abf18 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 19 Apr 2022 14:57:58 -0700 | ||
4 | Subject: [PATCH] cmake: Link with libatomic on rv32/rv64 | ||
5 | |||
6 | Use of <atomic> needs to link in libatomic on riscv | ||
7 | Fixes | ||
8 | |||
9 | undefined reference to `__atomic_exchange_1' | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | --- | ||
14 | src/lib/CMakeLists.txt | 8 +++++++- | ||
15 | 1 file changed, 7 insertions(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt | ||
18 | index 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 | -- | ||
44 | 2.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" | |||
17 | SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=https;branch=master \ | 17 | SRC_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 | " |
21 | SRCREV = "0138c00811c86eab4ff6bff3c6528163885ade19" | 22 | SRCREV = "0138c00811c86eab4ff6bff3c6528163885ade19" |
22 | 23 | ||
@@ -24,6 +25,8 @@ PV .= "+2.18.9git${SRCPV}" | |||
24 | 25 | ||
25 | S = "${WORKDIR}/git" | 26 | S = "${WORKDIR}/git" |
26 | 27 | ||
28 | LDFLAGS:append:riscv64 = " -latomic" | ||
29 | |||
27 | PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd systemd-watchdog systemd-journal dlt-examples dlt-adaptor dlt-console ', '', d)} \ | 30 | PACKAGECONFIG ?= "${@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 |