From: Herve Codina <herve.codina@bootlin.com>
To: buildroot@buildroot.org
Cc: "Hervé Codina" <herve.codina@bootlin.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH v2 4/5] package/libshdata: new package
Date: Fri, 12 Nov 2021 14:12:57 +0100 [thread overview]
Message-ID: <20211112131258.2671293-5-herve.codina@bootlin.com> (raw)
In-Reply-To: <20211112131258.2671293-1-herve.codina@bootlin.com>
The libshdata library provides lock free shared-memory tools.
https://github.com/Parrot-Developers/libshdata
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
Changes v1 -> v2
- Added comment related to "patch submitted upstream" in the patch itself
- Renamed ALCHEMY_TARGET_CONFIGURE_ENV to ALCHEMY_TARGET_ENV
- Removed ALCHEMY_TARGET_CONFIGURE_SDKS and set ALCHEMY_TARGET_SDK_DIRS
- Removed $(strip ...)
- Fixed indentation
- Added missing "depends on" in Config.in comment
- Moved the Config.in "comment" block after the if...endif block
- Removed unneeded LIBSHDATA_CONF_ENV
DEVELOPERS | 1 +
package/Config.in | 1 +
...01-backend-Add-missing-include-files.patch | 47 +++++++++++++++
package/libshdata/Config.in | 25 ++++++++
package/libshdata/libshdata.hash | 3 +
package/libshdata/libshdata.mk | 58 +++++++++++++++++++
6 files changed, 135 insertions(+)
create mode 100644 package/libshdata/0001-backend-Add-missing-include-files.patch
create mode 100644 package/libshdata/Config.in
create mode 100644 package/libshdata/libshdata.hash
create mode 100644 package/libshdata/libshdata.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 792aae625f..461c987b94 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1154,6 +1154,7 @@ F: package/dtbocfg/
F: package/libdbi/
F: package/libdbi-drivers/
F: package/libfutils/
+F: package/libshdata/
F: package/lua-augeas/
F: package/ulog/
F: support/testing/tests/package/test_dtbocfg.py
diff --git a/package/Config.in b/package/Config.in
index 89d928c0e7..e2a8f64fb1 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1991,6 +1991,7 @@ comment "linux-pam plugins"
source "package/libpam-tacplus/Config.in"
endif
source "package/liquid-dsp/Config.in"
+ source "package/libshdata/Config.in"
source "package/llvm/Config.in"
source "package/lttng-libust/Config.in"
source "package/matio/Config.in"
diff --git a/package/libshdata/0001-backend-Add-missing-include-files.patch b/package/libshdata/0001-backend-Add-missing-include-files.patch
new file mode 100644
index 0000000000..78c9e669c3
--- /dev/null
+++ b/package/libshdata/0001-backend-Add-missing-include-files.patch
@@ -0,0 +1,47 @@
+From 3eaf11bd957555674f5993435ef79dd4717ce890 Mon Sep 17 00:00:00 2001
+From: Herve Codina <herve.codina@bootlin.com>
+Date: Tue, 26 Oct 2021 08:45:10 +0200
+Subject: [PATCH] backend: Add missing include files
+
+With some libc library (musl), shd_dev_mem.c and shd_shm.c do not
+compile. Indeed, open() needs <fcntl.h> (Cf. man open).
+
+This patch fixes the compilation issue adding this
+include file.
+
+This patch was submitted upstream.
+https://github.com/Parrot-Developers/libshdata/issues/1
+
+Signed-off-by: Herve Codina <herve.codina@bootlin.com>
+---
+ src/backend/shd_dev_mem.c | 1 +
+ src/backend/shd_shm.c | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/src/backend/shd_dev_mem.c b/src/backend/shd_dev_mem.c
+index 14573c1..a65f052 100644
+--- a/src/backend/shd_dev_mem.c
++++ b/src/backend/shd_dev_mem.c
+@@ -33,6 +33,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h> /* For ftruncate */
++#include <fcntl.h> /* For open */
+ #include <sys/file.h> /* for flock */
+ #include <sys/mman.h> /* For shm and PROT flags */
+ #include <futils/fdutils.h>
+diff --git a/src/backend/shd_shm.c b/src/backend/shd_shm.c
+index 117bf01..1e5a38c 100644
+--- a/src/backend/shd_shm.c
++++ b/src/backend/shd_shm.c
+@@ -35,6 +35,7 @@
+ #include <string.h>
+ #include <errno.h>
+ #include <unistd.h> /* For ftruncate */
++#include <fcntl.h> /* For open */
+ #include <limits.h> /* For NAME_MAX macro */
+ #include <sys/file.h> /* for flock */
+ #include <sys/mman.h> /* For shm and PROT flags */
+--
+2.31.1
+
diff --git a/package/libshdata/Config.in b/package/libshdata/Config.in
new file mode 100644
index 0000000000..89d4e1393a
--- /dev/null
+++ b/package/libshdata/Config.in
@@ -0,0 +1,25 @@
+config BR2_PACKAGE_LIBSHDATA
+ bool "libshdata"
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4
+ depends on BR2_TOOLCHAIN_HAS_ATOMIC # libfutils
+ depends on BR2_INSTALL_LIBSTDCPP # libfutils
+ depends on BR2_TOOLCHAIN_HAS_THREADS # libfutils
+ select BR2_PACKAGE_LIBFUTILS
+ help
+ This library provides lock free shared-memory tools
+
+ https://github.com/Parrot-Developers/libshdata
+
+if BR2_PACKAGE_LIBSHDATA
+
+config BR2_PACKAGE_LIBSHDATA_STRESS
+ bool "libshdata-stress binary"
+ help
+ Install libshdata-stress binary as well
+
+endif
+
+comment "libshdata needs a toolchain w/ C++, threads"
+ depends on BR2_TOOLCHAIN_HAS_SYNC_4
+ depends on BR2_TOOLCHAIN_HAS_ATOMIC
+ depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/libshdata/libshdata.hash b/package/libshdata/libshdata.hash
new file mode 100644
index 0000000000..880404cf52
--- /dev/null
+++ b/package/libshdata/libshdata.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 1ae83ac73c2b5b17c726067737b8d446b99f190e16fe6198eb464368796ecce3 libshdata-d9ec4bdba834d8f3daf6bf9aa6da374bc462961f.tar.gz
+sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING
diff --git a/package/libshdata/libshdata.mk b/package/libshdata/libshdata.mk
new file mode 100644
index 0000000000..ed9b4579a5
--- /dev/null
+++ b/package/libshdata/libshdata.mk
@@ -0,0 +1,58 @@
+################################################################################
+#
+# libshdata
+#
+################################################################################
+
+LIBSHDATA_VERSION = d9ec4bdba834d8f3daf6bf9aa6da374bc462961f
+LIBSHDATA_SITE = $(call github,Parrot-Developers,libshdata,$(LIBSHDATA_VERSION))
+LIBSHDATA_LICENSE = BSD-3-Clause
+LIBSHDATA_LICENSE_FILES = COPYING
+LIBSHDATA_DEPENDENCIES = libfutils host-alchemy
+LIBSHDATA_INSTALL_STAGING = YES
+
+LIBSHDATA_TARGETS = libshdata
+ifeq ($(BR2_PACKAGE_LIBSHDATA_STRESS),y)
+LIBSHDATA_TARGETS += libshdata-stress
+endif
+
+define LIBSHDATA_BUILD_CMDS
+ $(ALCHEMY_TARGET_ENV) \
+ ALCHEMY_TARGET_SDK_DIRS="$(ALCHEMY_SDK_BASEDIR)/libfutils" \
+ $(ALCHEMY_MAKE) $(LIBSHDATA_TARGETS)
+endef
+
+define LIBSHDATA_INSTALL_STATIC_LIBS
+ $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata.a $(1)/usr/lib/
+ $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata-section-lookup.a $(1)/usr/lib/
+endef
+
+define LIBSHDATA_INSTALL_HEADERS
+ cp -Raf $(@D)/include/* $(1)/usr/include/
+endef
+
+ifeq ($(BR2_STATIC_LIBS),)
+define LIBSHDATA_INSTALL_SHARED_LIBS
+ $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libshdata.so* $(1)/usr/lib/
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_LIBSHDATA_STRESS),y)
+define LIBSHDATA_INSTALL_BIN
+ $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/bin/libshdata-stress $(1)/usr/bin/
+endef
+endif
+
+define LIBSHDATA_INSTALL_TARGET_CMDS
+ $(call LIBSHDATA_INSTALL_SHARED_LIBS, $(TARGET_DIR))
+ $(call LIBSHDATA_INSTALL_BIN, $(TARGET_DIR))
+endef
+
+define LIBSHDATA_INSTALL_STAGING_CMDS
+ $(call LIBSHDATA_INSTALL_STATIC_LIBS, $(STAGING_DIR))
+ $(call LIBSHDATA_INSTALL_SHARED_LIBS, $(STAGING_DIR))
+ $(call LIBSHDATA_INSTALL_HEADERS, $(STAGING_DIR))
+ $(call ALCHEMY_INSTALL_LIB_SDK_FILE, libshdata, libshdata, libshdata.so)
+endef
+
+$(eval $(generic-package))
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2021-11-12 13:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-12 13:12 [Buildroot] [PATCH v2 0/5] Add Alchemy build system and some related libs Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 1/5] package/alchemy: new host package Herve Codina
2022-01-01 15:50 ` Yann E. MORIN
2022-01-09 15:17 ` Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 2/5] package/ulog: new package Herve Codina
2022-01-01 16:05 ` Yann E. MORIN
2022-01-10 9:02 ` Herve Codina
2021-11-12 13:12 ` [Buildroot] [PATCH v2 3/5] package/libfutils: " Herve Codina
2021-11-12 13:12 ` Herve Codina [this message]
2021-11-12 13:12 ` [Buildroot] [PATCH v2 5/5] support/testing/tests/package/test_libshdata: new test Herve Codina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211112131258.2671293-5-herve.codina@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox