Skip to contentSkip to conversation

poco: Do not use std::atomic<bool>

PATCH New Khem Raj 1 participant 10 messages Jan 27, 2023

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/10 poco: Do not use std::atomic<bool>

They are not implemented for all arches e.g. RISCV on gcc 13 yet
Fixes
riscv64-yoe-linux/gcc/riscv64-yoe-linux/13.0.1/ld: lib/libPocoFoundation.so.94: unde fined reference to `__atomic_exchange_1'

---
 ...tomic-int-instead-of-std-atomic-bool.patch | 60 +++++++++++++++++++
 meta-oe/recipes-support/poco/poco_1.12.4.bb   |  1 +
 2 files changed, 61 insertions(+)
 create mode 100644 meta-oe/recipes-support/poco/poco/0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch
meta-oe/recipes-support/poco/poco/0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch new file +60 -0
new file mode 100644
index 0000000000..b06135222a
@@ -0,0 +1,60 @@
+From 4cbb225811205b51b65371d0d8abc2d2af8233b6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 26 Jan 2023 14:56:36 -0800
+Subject: [PATCH] Use std::atomic<int> instead of std::atomic<bool>
+
+GCC on RISCV does not yet support inline subword atomics [1]
+Therefore avoid them until fixed
+
+Upstream-Status: Pending
+
+[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104338
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ Foundation/include/Poco/AsyncChannel.h | 2 +-
+ Foundation/src/AsyncChannel.cpp        | 5 ++---
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/Foundation/include/Poco/AsyncChannel.h b/Foundation/include/Poco/AsyncChannel.h
+index 190bae7dd..d73ea6c72 100644
+--- a/Foundation/include/Poco/AsyncChannel.h
++++ b/Foundation/include/Poco/AsyncChannel.h
+@@ -111,7 +111,7 @@ private:
+ 	NotificationQueue _queue;
+ 	std::size_t _queueSize = 0;
+ 	std::size_t _dropCount = 0;
+-	std::atomic<bool> _closed;
++	std::atomic<int> _closed;
+ };
+ 
+ 
+diff --git a/Foundation/src/AsyncChannel.cpp b/Foundation/src/AsyncChannel.cpp
+index 37cdec477..e829b180c 100644
+--- a/Foundation/src/AsyncChannel.cpp
++++ b/Foundation/src/AsyncChannel.cpp
+@@ -48,11 +48,10 @@ private:
+ 	Message _msg;
+ };
+ 
+-
+ AsyncChannel::AsyncChannel(Channel::Ptr pChannel, Thread::Priority prio):
+ 	_pChannel(pChannel),
+ 	_thread("AsyncChannel"),
+-	_closed(false)
++	_closed(0)
+ {
+ 	_thread.setPriority(prio);
+ }
+@@ -95,7 +94,7 @@ void AsyncChannel::open()
+ 
+ void AsyncChannel::close()
+ {
+-	if (!_closed.exchange(true))
++	if (!_closed.exchange(1))
+ 	{
+ 		if (_thread.isRunning())
+ 		{
+-- 
+2.39.1
+
meta-oe/recipes-support/poco/poco_1.12.4.bb +1 -0
index f66a272524..51bd5611fb 100644
@@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=4267f48fc738f50380cbeeb76f95cebc"
 DEPENDS = "libpcre2 zlib"
 
 SRC_URI = "git://github.com/pocoproject/poco.git;branch=master;protocol=https \
+           file://0001-Use-std-atomic-int-instead-of-std-atomic-bool.patch \
            file://run-ptest \
            "
 SRCREV = "1211613642269b7d53bea58b02de7fcd25ece3b9"
Signature · 1 line
2.39.1
author
#1 lore raw

PATCH 2/10 libwebsockets: Fix build with gcc13

---
 ...int-mismatch-in-lws_tls_server_abort.patch | 32 +++++++++++++++++++
 .../libwebsockets/libwebsockets_4.3.2.bb      |  3 +-
 2 files changed, 34 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-connectivity/libwebsockets/libwebsockets/0001-Fix-Werror-enum-int-mismatch-in-lws_tls_server_abort.patch
meta-oe/recipes-connectivity/libwebsockets/libwebsockets/0001-Fix-Werror-enum-int-mismatch-in-lws_tls_server_abort.patch new file +32 -0
new file mode 100644
index 0000000000..41d004d9ff
@@ -0,0 +1,32 @@
+From 722e44cb5b74cae206f47a6dc0d985eba8ed1b2e Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 26 Jan 2023 17:17:49 -0800
+Subject: [PATCH] Fix -Werror=enum-int-mismatch in
+ lws_tls_server_abort_connection()
+
+GCC 13 is findinf this function signature mismatch.
+
+../git/lib/tls/openssl/openssl-server.c:713:1: error: conflicting types for 'lws_tls_server_abort_connection' due to enum/integer mismatch; have 'int(struct lws *)' [-Werror=enum-int-mismatch]
+
+Upstream-Status: Submitted [https://github.com/warmcat/libwebsockets/pull/2824]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ lib/tls/openssl/openssl-server.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/tls/openssl/openssl-server.c b/lib/tls/openssl/openssl-server.c
+index f2e77324f..43d65e030 100644
+--- a/lib/tls/openssl/openssl-server.c
++++ b/lib/tls/openssl/openssl-server.c
+@@ -699,7 +699,7 @@ lws_tls_server_new_nonblocking(struct lws *wsi, lws_sockfd_type accept_fd)
+ 	return 0;
+ }
+ 
+-int
++enum lws_ssl_capable_status
+ lws_tls_server_abort_connection(struct lws *wsi)
+ {
+ 	if (wsi->tls.use_ssl)
+-- 
+2.39.1
+
meta-oe/recipes-connectivity/libwebsockets/libwebsockets_4.3.2.bb +2 -1
index d401a187e2..67269b05af 100644
@@ -7,7 +7,8 @@ DEPENDS = "zlib"
 
 S = "${WORKDIR}/git"
 SRCREV = "b0a749c8e7a8294b68581ce4feac0e55045eb00b"
-SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;branch=v4.3-stable"
+SRC_URI = "git://github.com/warmcat/libwebsockets.git;protocol=https;branch=v4.3-stable \
+           file://0001-Fix-Werror-enum-int-mismatch-in-lws_tls_server_abort.patch"
 
 UPSTREAM_CHECK_URI = "https://github.com/warmcat/${BPN}/releases"
 UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>\d+(\.\d+)+)"
Signature · 1 line
2.39.1
author
#2 lore raw

PATCH 3/10 v4l-utils: Fix build with gcc13

In reply to Khem Raj
---
 ...nclude-missing-cstdint-for-uintptr_t.patch | 31 +++++++++++++++++++
 .../v4l2apps/v4l-utils_1.23.0.bb              |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-media-info-Include-missing-cstdint-for-uintptr_t.patch
meta-oe/recipes-multimedia/v4l2apps/v4l-utils/0001-media-info-Include-missing-cstdint-for-uintptr_t.patch new file +31 -0
new file mode 100644
index 0000000000..032bf00c7d
@@ -0,0 +1,31 @@
+From 1d9ce7cd799770981043f656373cbd1bf7558b9a Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 26 Jan 2023 17:00:00 -0800
+Subject: [PATCH] media-info: Include missing <cstdint> for uintptr_t
+
+gcc 13 moved some includes around and as a result <cstdint> is no longer
+transitively included [1]. Explicitly include it.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-media/[email protected]/]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ utils/common/media-info.cpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
+index 53e132f5..1a25a4b6 100644
+--- a/utils/common/media-info.cpp
++++ b/utils/common/media-info.cpp
+@@ -3,6 +3,7 @@
+  * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved.
+  */
+ 
++#include <cstdint>
+ #include <cstring>
+ #include <fstream>
+ #include <iostream>
+-- 
+2.39.1
+
meta-oe/recipes-multimedia/v4l2apps/v4l-utils_1.23.0.bb +1 -0
index 383be4a543..b42300f096 100644
@@ -32,6 +32,7 @@ SRC_URI = "\
     file://0003-original-patch-export-mediactl-headers.patch \
     file://0004-Do-not-use-getsubopt.patch \
     file://0005-configure.ac-Makefile.am-Support-building-without-NL.patch \
+    file://0001-media-info-Include-missing-cstdint-for-uintptr_t.patch \
 "
 
 SRCREV = "fd544473800d02e90bc289434cc44e5aa8fadd0f"
Signature · 1 line
2.39.1
author
#3 lore raw

PATCH 4/10 proj: Upgrade to 9.1.1 release

In reply to Khem Raj
---
 .../recipes-navigation/proj/{proj_9.1.0.bb => proj_9.1.1.bb}    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-oe/recipes-navigation/proj/{proj_9.1.0.bb => proj_9.1.1.bb} (90%)
meta-oe/recipes-navigation/proj/proj_9.1.1.bb renamed from meta-oe/recipes-navigation/proj/proj_9.1.0.bb +1 -1
similarity index 90%
rename from meta-oe/recipes-navigation/proj/proj_9.1.0.bb
rename to meta-oe/recipes-navigation/proj/proj_9.1.1.bb
index 218f083969..6ce1c88772 100644
@@ -6,7 +6,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=f27445198ba1500f508fce2b183ce0ff"
 DEPENDS = "sqlite3 sqlite3-native"
 
 SRC_URI = "http://download.osgeo.org/${BPN}/${BP}.tar.gz"
-SRC_URI[sha256sum] = "81b2239b94cad0886222cde4f53cb49d34905aad2a1317244a0c30a553db2315"
+SRC_URI[sha256sum] = "003cd4010e52bb5eb8f7de1c143753aa830c8902b6ed01209f294846e40e6d39"
 
 inherit cmake lib_package
 
Signature · 1 line
2.39.1
author
#4 lore raw

PATCH 5/10 mpd: Upgrade to 0.23.12 release

In reply to Khem Raj
---
 .../musicpd/{mpd_0.23.9.bb => mpd_0.23.12.bb}                   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta-multimedia/recipes-multimedia/musicpd/{mpd_0.23.9.bb => mpd_0.23.12.bb} (98%)
meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.12.bb renamed from meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.9.bb +1 -1
similarity index 98%
rename from meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.9.bb
rename to meta-multimedia/recipes-multimedia/musicpd/mpd_0.23.12.bb
index e63c1b5e19..13938444c8 100644
@@ -21,7 +21,7 @@ DEPENDS += " \
 SRC_URI = "git://github.com/MusicPlayerDaemon/MPD;branch=v0.23.x;protocol=https \
            file://mpd.conf.in \
            "
-SRCREV = "12147f6d5822899cc4316799b494c093b4b47f91"
+SRCREV = "d91da9679801224847c30147f5914785b6f8f240"
 S = "${WORKDIR}/git"
 
 EXTRA_OEMESON += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '-Dsystemd=enabled -Dsystemd_system_unit_dir=${systemd_system_unitdir} -Dsystemd_user_unit_dir=${systemd_system_unitdir}', '-Dsystemd=disabled', d)}"
Signature · 1 line
2.39.1
author
#5 lore raw

PATCH 6/10 geos: Upgrade to 3.9.4

In reply to Khem Raj

Merge .inc into .bb

---
 meta-oe/recipes-navigation/geos/geos_3.9.3.bb               | 3 ---
 meta-oe/recipes-navigation/geos/{geos.inc => geos_3.9.4.bb} | 3 ++-
 2 files changed, 2 insertions(+), 4 deletions(-)
 delete mode 100644 meta-oe/recipes-navigation/geos/geos_3.9.3.bb
 rename meta-oe/recipes-navigation/geos/{geos.inc => geos_3.9.4.bb} (81%)
meta-oe/recipes-navigation/geos/geos_3.9.3.bb deleted +0 -3
deleted file mode 100644
index fdb72204ea..0000000000
@@ -1,3 +0,0 @@
-require geos.inc
-
-SRC_URI[sha256sum] = "f8b2314e311456f7a449144efb5e3188c2a28774752bc50fc882a3cd5c89ee35"
meta-oe/recipes-navigation/geos/geos_3.9.4.bb renamed from meta-oe/recipes-navigation/geos/geos.inc +2 -1
similarity index 81%
rename from meta-oe/recipes-navigation/geos/geos.inc
rename to meta-oe/recipes-navigation/geos/geos_3.9.4.bb
index 484ca9154f..7822cde30d 100644
@@ -5,7 +5,8 @@ SECTION = "libs"
 LICENSE = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
-SRC_URI = "http://download.osgeo.org/geos/geos-${PV}.tar.bz2"
+SRC_URI = "http://download.osgeo.org/${BPN}/${BP}.tar.bz2"
+SRC_URI[sha256sum] = "70dff2530d8cd2dfaeeb91a5014bd17afb1baee8f0e3eb18e44d5b4dbea47b14"
 
 inherit autotools pkgconfig binconfig
 
Signature · 1 line
2.39.1
author
#6 lore raw

PATCH 7/10 geos: Fix build with gcc13

In reply to Khem Raj
---
 .../geos/0001-include-missing-cstdint.patch   | 82 +++++++++++++++++++
 meta-oe/recipes-navigation/geos/geos_3.9.4.bb |  3 +-
 2 files changed, 84 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-navigation/geos/geos/0001-include-missing-cstdint.patch
meta-oe/recipes-navigation/geos/geos/0001-include-missing-cstdint.patch new file +82 -0
new file mode 100644
index 0000000000..6cfd2e81bc
@@ -0,0 +1,82 @@
+From 11b9ef265a942cb3fdd373520d0c3fce67d3cdf9 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 26 Jan 2023 18:05:33 -0800
+Subject: [PATCH] include missing <cstdint>
+
+gcc 13 moved some includes around and as a result <cstdint> is no longer transitively included [1]. Explicitly include it for uint{32,64}_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Backport [https://github.com/kraj/geos/commit/0e8d4368b]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ include/geos/geomgraph/TopologyLocation.h   | 1 +
+ include/geos/io/WKTWriter.h                 | 1 +
+ include/geos/shape/fractal/HilbertCode.h    | 1 +
+ include/geos/shape/fractal/HilbertEncoder.h | 1 +
+ include/geos/shape/fractal/MortonCode.h     | 1 +
+ 5 files changed, 5 insertions(+)
+
+diff --git a/include/geos/geomgraph/TopologyLocation.h b/include/geos/geomgraph/TopologyLocation.h
+index 4cbbacb3..a3ecd212 100644
+--- a/include/geos/geomgraph/TopologyLocation.h
++++ b/include/geos/geomgraph/TopologyLocation.h
+@@ -25,6 +25,7 @@
+ #include <geos/inline.h>
+ #include <geos/geom/Location.h>
+ 
++#include <cstdint>
+ #include <vector>
+ #include <array>
+ #include <string>
+diff --git a/include/geos/io/WKTWriter.h b/include/geos/io/WKTWriter.h
+index c0af8e71..0d60e975 100644
+--- a/include/geos/io/WKTWriter.h
++++ b/include/geos/io/WKTWriter.h
+@@ -25,6 +25,7 @@
+ 
+ #include <string>
+ #include <cctype>
++#include <cstdint>
+ 
+ #ifdef _MSC_VER
+ #pragma warning(push)
+diff --git a/include/geos/shape/fractal/HilbertCode.h b/include/geos/shape/fractal/HilbertCode.h
+index 46012efc..beeb28c6 100644
+--- a/include/geos/shape/fractal/HilbertCode.h
++++ b/include/geos/shape/fractal/HilbertCode.h
+@@ -17,6 +17,7 @@
+ 
+ #include <geos/export.h>
+ #include <string>
++#include <cstdint>
+ 
+ // Forward declarations
+ namespace geos {
+diff --git a/include/geos/shape/fractal/HilbertEncoder.h b/include/geos/shape/fractal/HilbertEncoder.h
+index 61c0010d..0126d3d9 100644
+--- a/include/geos/shape/fractal/HilbertEncoder.h
++++ b/include/geos/shape/fractal/HilbertEncoder.h
+@@ -16,6 +16,7 @@
+ #pragma once
+ 
+ #include <geos/export.h>
++#include <cstdint>
+ #include <string>
+ #include <vector>
+ 
+diff --git a/include/geos/shape/fractal/MortonCode.h b/include/geos/shape/fractal/MortonCode.h
+index 6743f87c..ad4a42e7 100644
+--- a/include/geos/shape/fractal/MortonCode.h
++++ b/include/geos/shape/fractal/MortonCode.h
+@@ -17,6 +17,7 @@
+ 
+ #include <geos/export.h>
+ #include <string>
++#include <cstdint>
+ 
+ // Forward declarations
+ namespace geos {
+-- 
+2.39.1
+
meta-oe/recipes-navigation/geos/geos_3.9.4.bb +2 -1
index 7822cde30d..558acd92bf 100644
@@ -5,7 +5,8 @@ SECTION = "libs"
 LICENSE = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
 
-SRC_URI = "http://download.osgeo.org/${BPN}/${BP}.tar.bz2"
+SRC_URI = "http://download.osgeo.org/${BPN}/${BP}.tar.bz2 \
+           file://0001-include-missing-cstdint.patch"
 SRC_URI[sha256sum] = "70dff2530d8cd2dfaeeb91a5014bd17afb1baee8f0e3eb18e44d5b4dbea47b14"
 
 inherit autotools pkgconfig binconfig
Signature · 1 line
2.39.1
author
#7 lore raw

PATCH 8/10 libinih: Upgrade to version 56

In reply to Khem Raj

Change SRC_URI to benhoyt fork, it seems to be well maintained.

---
 meta-oe/recipes-support/inih/libinih_56.bb  | 14 +++++++++++++
 meta-oe/recipes-support/inih/libinih_git.bb | 23 ---------------------
 2 files changed, 14 insertions(+), 23 deletions(-)
 create mode 100644 meta-oe/recipes-support/inih/libinih_56.bb
 delete mode 100644 meta-oe/recipes-support/inih/libinih_git.bb
meta-oe/recipes-support/inih/libinih_56.bb new file +14 -0
new file mode 100644
index 0000000000..89d68c6e16
@@ -0,0 +1,14 @@
+SUMMARY = "inih (INI Not Invented Here)"
+DESCRIPTION = "A .INI file parser written in C that was designed to be small and simple."
+HOMEPAGE = "https://github.com/benhoyt/inih"
+SECTION = "libs"
+LICENSE = "BSD-3-Clause"
+
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a7a95d2af90376e85a05318794e6f202"
+
+SRC_URI = "git://github.com/benhoyt/inih.git;protocol=https;branch=master"
+
+S = "${WORKDIR}/git"
+SRCREV = "5e1d9e2625842dddb3f9c086a50f22e4f45dfc2b"
+
+inherit meson pkgconfig
meta-oe/recipes-support/inih/libinih_git.bb deleted +0 -23
deleted file mode 100644
index cf390800b9..0000000000
@@ -1,23 +0,0 @@
-SUMMARY = "C and C++ INI Library"
-HOMEPAGE = "http://code.google.com/p/inih/"
-PV = "0.0+gitr${SRCPV}"
-PKGV = "${GITPKGVTAG}"
-LICENSE = "BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=dae28cbf28207425e0d0b3eb835f4bde"
-
-PR = "r3"
-
-# The github repository provides a cmake and pkg-config integration
-SRCREV = "c858aff8c31fa63ef4d1e0176c10e5928cde9a23"
-SRC_URI = "git://github.com/OSSystems/inih.git;branch=master;protocol=https \
-           file://0001-include-install-header-files-without-prefix-dir-inih.patch \
-           "
-
-UPSTREAM_CHECK_COMMITS = "1"
-
-S = "${WORKDIR}/git"
-
-inherit gitpkgv cmake
-
-# We don't have libinih since we only have static libraries
-ALLOW_EMPTY:${PN} = "1"
Signature · 1 line
2.39.1
author
#8 lore raw

PATCH 9/10 python3-pybind11: Upgrade to 2.10.3

In reply to Khem Raj

It gets pkgconfig support which is required by some dependent packages like rwmem

---
 ...11_2.10.0.bb => python3-pybind11_2.10.3.bb} | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)
 rename meta-python/recipes-devtools/python/{python3-pybind11_2.10.0.bb => python3-pybind11_2.10.3.bb} (68%)
meta-python/recipes-devtools/python/python3-pybind11_2.10.3.bb renamed from meta-python/recipes-devtools/python/python3-pybind11_2.10.0.bb +7 -11
similarity index 68%
rename from meta-python/recipes-devtools/python/python3-pybind11_2.10.0.bb
rename to meta-python/recipes-devtools/python/python3-pybind11_2.10.3.bb
index 66aefac3d6..bb604982d0 100644
@@ -5,16 +5,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=774f65abd8a7fe3124be2cdf766cd06f"
 
 DEPENDS = "boost"
 
-SRC_URI = "git://github.com/pybind/pybind11.git;branch=stable;protocol=https \
-           file://0001-Do-not-strip-binaries.patch \
-"
+SRC_URI = "git://github.com/pybind/pybind11.git;branch=stable;protocol=https"
 
-SRCREV = "aa304c9c7d725ffb9d10af08a3b34cb372307020"
+SRCREV = "0bd8896a4010f2d91b2340570c24fa08606ec406"
 
 S = "${WORKDIR}/git"
 
-BBCLASSEXTEND = "native"
-
 EXTRA_OECMAKE =  "-DPYBIND11_TEST=OFF"
 
 inherit cmake setuptools3 python3native
@@ -23,17 +19,17 @@ PIP_INSTALL_DIST_PATH = "${S}/dist"
 PIP_INSTALL_PACKAGE = "pybind11"
 
 do_configure() {
-	cmake_do_configure
+   cmake_do_configure
 }
 
 do_compile() {
-	setuptools3_do_compile
-	cmake_do_compile
+   setuptools3_do_compile
+   cmake_do_compile
 }
 
 do_install() {
-	setuptools3_do_install
-	cmake_do_install
+   setuptools3_do_install
+   cmake_do_install
 }
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.1
author
#9 lore raw

PATCH 10/10 rwmem: Update to latest

In reply to Khem Raj

- Switch to using meson
- Fix build with gcc13
- Use packageconfig for enabling python support and static libs

---
 .../rwmem/0001-include-missing-cstdint.patch  | 32 +++++++++++++++++++
 .../recipes-bsp/rwmem/rwmem_1.2.bb            | 26 +++++++--------
 2 files changed, 45 insertions(+), 13 deletions(-)
 create mode 100644 meta-oe/dynamic-layers/meta-python/recipes-bsp/rwmem/rwmem/0001-include-missing-cstdint.patch
meta-oe/dynamic-layers/meta-python/recipes-bsp/rwmem/rwmem/0001-include-missing-cstdint.patch new file +32 -0
new file mode 100644
index 0000000000..0560daa4c2
@@ -0,0 +1,32 @@
+From 84e884f99e581515b49d8973538bb17e1e6c0dc0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 26 Jan 2023 20:45:57 -0800
+Subject: [PATCH] include missing <cstdint>
+
+gcc 13 moved some includes around and as a result <cstdint> is no
+longer transitively included [1]. Explicitly include it for
+uint{32,64}_t.
+
+[1] https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes
+
+Upstream-Status: Submitted [https://github.com/tomba/rwmem/pull/7]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ librwmem/helpers.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/librwmem/helpers.h b/librwmem/helpers.h
+index a0a738b..8d02c9c 100644
+--- a/librwmem/helpers.h
++++ b/librwmem/helpers.h
+@@ -1,6 +1,7 @@
+ #pragma once
+ 
+ #include <cerrno>
++#include <cstdint>
+ #include <string>
+ #include <vector>
+ #include <string.h>
+-- 
+2.39.1
+
meta-oe/dynamic-layers/meta-python/recipes-bsp/rwmem/rwmem_1.2.bb +13 -13
index 7bca24cc0a..8ccdc27a8e 100644
@@ -11,25 +11,25 @@ In i2c mode rwmem accesses an i2c peripheral by sending i2c messages to it."
 LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-DEPENDS += "python3 python3-pybind11"
+DEPENDS += "fmt libinih"
 
 PV .= "+git${SRCPV}"
 
-SRCREV_rwmem = "3ec3e421211b58e766651c2e3a3a21acf14a1906"
-SRCREV_inih = "4b10c654051a86556dfdb634c891b6c3224c4109"
+SRCREV = "8416326777b2aada0706539b8f9f6acefa476b16"
 
-SRCREV_FORMAT = "rwmem_inih"
-
-SRC_URI = " \
-    git://github.com/tomba/rwmem.git;protocol=https;name=rwmem;branch=master \
-    git://github.com/benhoyt/inih.git;protocol=https;name=inih;nobranch=1;destsuffix=git/ext/inih \
-"
+SRC_URI = "git://github.com/tomba/rwmem.git;protocol=https;name=rwmem;branch=master \
+           file://0001-include-missing-cstdint.patch"
 
 S = "${WORKDIR}/git"
 
-inherit cmake pkgconfig
+inherit meson pkgconfig python3native
+
+PACKAGECONFIG ?= "python static"
+PACKAGECONFIG[python] = "-Dpyrwmem=enabled,-Dpyrwmem=disabled,cmake-native python3 python3-pybind11"
+PACKAGECONFIG[static] = "-Dstatic-libc=true,-Dstatic-libc=false,"
 
-do_install() {
-	install -D -m 0755 ${B}/bin/rwmem ${D}${bindir}/rwmem
-	install -D -m 0644 ${B}/lib/librwmem.a ${D}${libdir}/librwmem.a
+do_install:append() {
+	install -D -m 0644 ${B}/librwmem/librwmem.a ${D}${libdir}/librwmem.a
 }
+
+FILES:${PN} += "${libdir}/python3.11/site-packages/pyrwmem"
Signature · 1 line
2.39.1