diff options
author | Moritz Haase <Moritz.Haase@bmw.de> | 2025-07-14 13:26:27 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-07-15 00:25:28 -0700 |
commit | a7504ae1c226cb7aad4cf951cfd6be7b1a7de23c (patch) | |
tree | af115b265ff032a0c4957ee0e4b619bc064c3cce | |
parent | d8259c30aaf4392a97ddcc7b9727d3097e8826f0 (diff) | |
download | meta-openembedded-a7504ae1c226cb7aad4cf951cfd6be7b1a7de23c.tar.gz |
libubox: Update to latest tip of trunk
Fixes builds with CMake 4+. All patches that are still required have been
refreshed and a new patch for CMake 4 compatibility has been added.
Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch | 42 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/libubox/libubox/0001-cmake-Set-library-version.patch (renamed from meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch) | 19 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/libubox/libubox/0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch (renamed from meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch) | 15 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/libubox/libubox/0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch | 35 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/libubox/libubox_git.bb | 8 |
5 files changed, 61 insertions, 58 deletions
diff --git a/meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch b/meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch deleted file mode 100644 index 4f1dd76326..0000000000 --- a/meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | From a12325a0cbf3bf1d66a0b0f8d85e08083bae6066 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <ynezz@true.cz> | ||
3 | Date: Wed, 25 Dec 2019 10:27:59 +0100 | ||
4 | Subject: [PATCH] blobmsg: fix array out of bounds GCC 10 warning | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Fixes following warning reported by GCC 10.0.0 20191203: | ||
10 | |||
11 | blobmsg.c:234:2: error: 'strcpy' offset 6 from the object at 'attr' is out of the bounds of referenced subobject 'name' with type 'uint8_t[0]' {aka 'unsigned char[0]'} at offset 6 [-Werror=array-bounds] | ||
12 | 234 | strcpy((char *) hdr->name, (const char *)name); | ||
13 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
14 | |||
15 | In file included from blobmsg.c:16: | ||
16 | blobmsg.h:42:10: note: subobject 'name' declared here | ||
17 | 42 | uint8_t name[]; | ||
18 | | ^~~~ | ||
19 | |||
20 | Upstream-Status: Submitted [https://gitlab.com/ynezz/openwrt-libubox/commit/3775b3aa28de8c20d96b6f02786a327423b0748a] | ||
21 | Reported-by: Khem Raj <raj.khem@gmail.com> | ||
22 | Signed-off-by: Petr Štetiar <ynezz@true.cz> | ||
23 | --- | ||
24 | blobmsg.c | 2 +- | ||
25 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
26 | |||
27 | diff --git a/blobmsg.c b/blobmsg.c | ||
28 | index a860483..b6b7535 100644 | ||
29 | --- a/blobmsg.c | ||
30 | +++ b/blobmsg.c | ||
31 | @@ -195,7 +195,7 @@ blobmsg_new(struct blob_buf *buf, int type, const char *name, int payload_len, v | ||
32 | attr->id_len |= be32_to_cpu(BLOB_ATTR_EXTENDED); | ||
33 | hdr = blob_data(attr); | ||
34 | hdr->namelen = cpu_to_be16(namelen); | ||
35 | - strcpy((char *) hdr->name, (const char *)name); | ||
36 | + memcpy(hdr->name, name, namelen); | ||
37 | pad_end = *data = blobmsg_data(attr); | ||
38 | pad_start = (char *) &hdr->name[namelen]; | ||
39 | if (pad_start < pad_end) | ||
40 | -- | ||
41 | 2.24.1 | ||
42 | |||
diff --git a/meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch b/meta-oe/recipes-devtools/libubox/libubox/0001-cmake-Set-library-version.patch index f82c31ad07..737d143287 100644 --- a/meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch +++ b/meta-oe/recipes-devtools/libubox/libubox/0001-cmake-Set-library-version.patch | |||
@@ -1,18 +1,27 @@ | |||
1 | From 0d97421370d1c52d0db798134420796a960df743 Mon Sep 17 00:00:00 2001 | ||
2 | From: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> | ||
3 | Date: Thu, 1 Oct 2015 17:31:36 +0300 | ||
4 | Subject: [PATCH 1/3] cmake: Set library version | ||
5 | |||
1 | Upstream-Status: Pending | 6 | Upstream-Status: Pending |
7 | Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de> | ||
8 | --- | ||
9 | CMakeLists.txt | 3 +++ | ||
10 | 1 file changed, 3 insertions(+) | ||
2 | 11 | ||
3 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 12 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
4 | index 57804cf..1aa7f27 100644 | 13 | index f40eaa6..cb089a2 100644 |
5 | --- a/CMakeLists.txt | 14 | --- a/CMakeLists.txt |
6 | +++ b/CMakeLists.txt | 15 | +++ b/CMakeLists.txt |
7 | @@ -18,6 +18,7 @@ ENDIF() | 16 | @@ -21,6 +21,7 @@ INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS}) |
8 | SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c) | 17 | SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c udebug.c udebug-remote.c) |
9 | 18 | ||
10 | ADD_LIBRARY(ubox SHARED ${SOURCES}) | 19 | ADD_LIBRARY(ubox SHARED ${SOURCES}) |
11 | +SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION 1.0.1 SOVERSION 1) | 20 | +SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION 1.0.1 SOVERSION 1) |
12 | ADD_LIBRARY(ubox-static STATIC ${SOURCES}) | 21 | ADD_LIBRARY(ubox-static STATIC ${SOURCES}) |
13 | SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox) | 22 | SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox) |
14 | 23 | ||
15 | @@ -46,6 +47,7 @@ find_library(json NAMES json-c) | 24 | @@ -65,6 +66,7 @@ find_library(json NAMES json-c) |
16 | IF(EXISTS ${json}) | 25 | IF(EXISTS ${json}) |
17 | ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) | 26 | ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c) |
18 | TARGET_LINK_LIBRARIES(blobmsg_json ubox ${json}) | 27 | TARGET_LINK_LIBRARIES(blobmsg_json ubox ${json}) |
@@ -20,7 +29,7 @@ index 57804cf..1aa7f27 100644 | |||
20 | 29 | ||
21 | ADD_LIBRARY(blobmsg_json-static STATIC blobmsg_json.c) | 30 | ADD_LIBRARY(blobmsg_json-static STATIC blobmsg_json.c) |
22 | SET_TARGET_PROPERTIES(blobmsg_json-static | 31 | SET_TARGET_PROPERTIES(blobmsg_json-static |
23 | @@ -55,6 +57,7 @@ IF(EXISTS ${json}) | 32 | @@ -78,6 +80,7 @@ IF(EXISTS ${json}) |
24 | TARGET_LINK_LIBRARIES(jshn blobmsg_json ${json}) | 33 | TARGET_LINK_LIBRARIES(jshn blobmsg_json ${json}) |
25 | 34 | ||
26 | ADD_LIBRARY(json_script SHARED json_script.c) | 35 | ADD_LIBRARY(json_script SHARED json_script.c) |
diff --git a/meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch b/meta-oe/recipes-devtools/libubox/libubox/0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch index 6f09c8b293..853ce9b5e4 100644 --- a/meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch +++ b/meta-oe/recipes-devtools/libubox/libubox/0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch | |||
@@ -1,19 +1,23 @@ | |||
1 | [PATCH] fix the CMAKE_INSTALL_LIBDIR | 1 | From ff1f1c6c67ca9c955385a967b1b6609da76c5944 Mon Sep 17 00:00:00 2001 |
2 | From: Roy Li <rongqing.li@windriver.com> | ||
3 | Date: Fri, 30 Oct 2015 13:06:03 +0800 | ||
4 | Subject: [PATCH 2/3] cmake: fix the CMAKE_INSTALL_LIBDIR | ||
2 | 5 | ||
3 | Upstream-Status: Pending | 6 | Upstream-Status: Pending |
4 | 7 | ||
5 | libdir maybe /usr/lib64 for 64bit machine | 8 | libdir maybe /usr/lib64 for 64bit machine |
6 | 9 | ||
7 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | 10 | Signed-off-by: Roy Li <rongqing.li@windriver.com> |
11 | Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de> | ||
8 | --- | 12 | --- |
9 | CMakeLists.txt | 8 ++++---- | 13 | CMakeLists.txt | 8 ++++---- |
10 | 1 file changed, 4 insertions(+), 4 deletions(-) | 14 | 1 file changed, 4 insertions(+), 4 deletions(-) |
11 | 15 | ||
12 | diff --git a/CMakeLists.txt b/CMakeLists.txt | 16 | diff --git a/CMakeLists.txt b/CMakeLists.txt |
13 | index 57804cf..2c7bdc1 100644 | 17 | index cb089a2..783fa0a 100644 |
14 | --- a/CMakeLists.txt | 18 | --- a/CMakeLists.txt |
15 | +++ b/CMakeLists.txt | 19 | +++ b/CMakeLists.txt |
16 | @@ -35,8 +35,8 @@ INSTALL(FILES ${headers} | 20 | @@ -42,8 +42,8 @@ INSTALL(FILES ${headers} |
17 | DESTINATION include/libubox | 21 | DESTINATION include/libubox |
18 | ) | 22 | ) |
19 | INSTALL(TARGETS ubox ubox-static | 23 | INSTALL(TARGETS ubox ubox-static |
@@ -24,7 +28,7 @@ index 57804cf..2c7bdc1 100644 | |||
24 | ) | 28 | ) |
25 | 29 | ||
26 | ADD_SUBDIRECTORY(lua) | 30 | ADD_SUBDIRECTORY(lua) |
27 | @@ -58,8 +58,8 @@ IF(EXISTS ${json}) | 31 | @@ -84,8 +84,8 @@ IF(EXISTS ${json}) |
28 | TARGET_LINK_LIBRARIES(json_script ubox) | 32 | TARGET_LINK_LIBRARIES(json_script ubox) |
29 | 33 | ||
30 | INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script | 34 | INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script |
@@ -35,6 +39,3 @@ index 57804cf..2c7bdc1 100644 | |||
35 | RUNTIME DESTINATION bin | 39 | RUNTIME DESTINATION bin |
36 | ) | 40 | ) |
37 | 41 | ||
38 | -- | ||
39 | 1.9.1 | ||
40 | |||
diff --git a/meta-oe/recipes-devtools/libubox/libubox/0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch b/meta-oe/recipes-devtools/libubox/libubox/0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch new file mode 100644 index 0000000000..b38989ef9e --- /dev/null +++ b/meta-oe/recipes-devtools/libubox/libubox/0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 93e7b9014a14193e39e5d414c81da2d32f94ed43 Mon Sep 17 00:00:00 2001 | ||
2 | From: Moritz Haase <Moritz.Haase@bmw.de> | ||
3 | Date: Mon, 14 Jul 2025 09:23:09 +0200 | ||
4 | Subject: [PATCH 3/3] cmake: Don't include 'lua' and 'examples' directories if | ||
5 | disabled | ||
6 | |||
7 | It's the sensible thing to do and unblocks builds with CMake 4+, since both | ||
8 | CMakeLists.txt files in the directories in question have | ||
9 | 'cmake_minimum_required(VERSION 2.6)'. | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de> | ||
13 | --- | ||
14 | CMakeLists.txt | 8 ++++++-- | ||
15 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
18 | index 783fa0a..61e152c 100644 | ||
19 | --- a/CMakeLists.txt | ||
20 | +++ b/CMakeLists.txt | ||
21 | @@ -46,8 +46,12 @@ INSTALL(TARGETS ubox ubox-static | ||
22 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
23 | ) | ||
24 | |||
25 | -ADD_SUBDIRECTORY(lua) | ||
26 | -ADD_SUBDIRECTORY(examples) | ||
27 | +IF(BUILD_LUA) | ||
28 | + ADD_SUBDIRECTORY(lua) | ||
29 | +ENDIF() | ||
30 | +IF(BUILD_EXAMPLES) | ||
31 | + ADD_SUBDIRECTORY(examples) | ||
32 | +ENDIF() | ||
33 | |||
34 | MACRO(ADD_UNIT_TEST_SAN name) | ||
35 | ADD_EXECUTABLE(${name}-san ${name}.c) | ||
diff --git a/meta-oe/recipes-devtools/libubox/libubox_git.bb b/meta-oe/recipes-devtools/libubox/libubox_git.bb index 394cf9c000..3c51d36848 100644 --- a/meta-oe/recipes-devtools/libubox/libubox_git.bb +++ b/meta-oe/recipes-devtools/libubox/libubox_git.bb | |||
@@ -14,12 +14,12 @@ LIC_FILES_CHKSUM = "\ | |||
14 | 14 | ||
15 | SRC_URI = "\ | 15 | SRC_URI = "\ |
16 | git://git.openwrt.org/project/libubox.git;branch=master \ | 16 | git://git.openwrt.org/project/libubox.git;branch=master \ |
17 | file://0001-version-libraries.patch \ | 17 | file://0001-cmake-Set-library-version.patch \ |
18 | file://fix-libdir.patch \ | 18 | file://0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch \ |
19 | file://0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch \ | 19 | file://0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch \ |
20 | " | 20 | " |
21 | 21 | ||
22 | SRCREV = "07413cce72e19520af55dfcbc765484f5ab41dd9" | 22 | SRCREV = "b7acc8e6fd5e13611ad90a593e98f9589af4009a" |
23 | PV = "1.0.1+git" | 23 | PV = "1.0.1+git" |
24 | 24 | ||
25 | # Upstream repo does not tag | 25 | # Upstream repo does not tag |