* [Buildroot] [PATCH 1/5] package/alchemy: new host package
2021-11-03 7:36 [Buildroot] [PATCH 0/5] Add Alchemy build system and some related libs Herve Codina
@ 2021-11-03 7:36 ` Herve Codina
2021-11-03 15:44 ` Thomas Petazzoni
2021-11-03 7:36 ` [Buildroot] [PATCH 2/5] package/ulog: new package Herve Codina
` (3 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Herve Codina @ 2021-11-03 7:36 UTC (permalink / raw)
To: buildroot; +Cc: Hervé Codina, Thomas Petazzoni
Alchemy is a build system developed by Parrot.
It is a new build system based on the one used in Android.
A central makefile instance scans a workspace to find user
makefiles, includes them and register modules to be built.
https://github.com/Parrot-Developers/alchemy
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
DEVELOPERS | 1 +
...lchains-remove-hash-style-management.patch | 36 +++++++++
package/alchemy/alchemy.hash | 3 +
package/alchemy/alchemy.mk | 73 +++++++++++++++++++
4 files changed, 113 insertions(+)
create mode 100644 package/alchemy/0001-toolchains-remove-hash-style-management.patch
create mode 100644 package/alchemy/alchemy.hash
create mode 100644 package/alchemy/alchemy.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 65240615b0..778c5c7e08 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1147,6 +1147,7 @@ N: Henrique Camargo <henrique@henriquecamargo.com>
F: package/json-glib/
N: Hervé Codina <herve.codina@bootlin.com>
+F: package/alchemy/
F: package/dtbocfg/
F: package/libdbi/
F: package/libdbi-drivers/
diff --git a/package/alchemy/0001-toolchains-remove-hash-style-management.patch b/package/alchemy/0001-toolchains-remove-hash-style-management.patch
new file mode 100644
index 0000000000..522766b977
--- /dev/null
+++ b/package/alchemy/0001-toolchains-remove-hash-style-management.patch
@@ -0,0 +1,36 @@
+From 4cb9681ab99db3d8e330ac789e17ec69583aecd4 Mon Sep 17 00:00:00 2001
+From: Herve Codina <herve.codina@bootlin.com>
+Date: Thu, 28 Oct 2021 18:39:18 +0200
+Subject: [PATCH] toolchains: remove --hash-style management
+
+Using an external toolchain, with an external configuration given
+using TARGET_GLOBAL_XXXX variables, having '--hash-style=both'
+in Alchemy toolchains can lead to compilation failure.
+
+This patch simply removes all --hash-style settings.
+
+Signed-off-by: Herve Codina <herve.codina@bootlin.com>
+---
+ toolchains/linux/eglibc/flags.mk | 9 +--------
+ 1 file changed, 1 insertion(+), 8 deletions(-)
+
+diff --git a/toolchains/linux/eglibc/flags.mk b/toolchains/linux/eglibc/flags.mk
+index 95c0a46..4474729 100644
+--- a/toolchains/linux/eglibc/flags.mk
++++ b/toolchains/linux/eglibc/flags.mk
+@@ -11,11 +11,4 @@ TARGET_GLOBAL_LDLIBS += -pthread -lrt
+ TARGET_GLOBAL_CFLAGS += -funwind-tables
+
+ # Enable link optimization for binutils's ld.
+-# gnu hash not supported by mips ABI
+-ifeq ("$(TARGET_ARCH)","mips")
+- TARGET_GLOBAL_LDFLAGS += -Wl,-O1
+-else ifeq ("$(TARGET_ARCH)","mips64")
+- TARGET_GLOBAL_LDFLAGS += -Wl,-O1
+-else
+- TARGET_GLOBAL_LDFLAGS += -Wl,-O1,--hash-style=both
+-endif
++TARGET_GLOBAL_LDFLAGS += -Wl,-O1
+--
+2.31.1
+
diff --git a/package/alchemy/alchemy.hash b/package/alchemy/alchemy.hash
new file mode 100644
index 0000000000..7051b65362
--- /dev/null
+++ b/package/alchemy/alchemy.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 346c06b9317691a9371d878b850e61f8bcec4f20132ac95340b9d2571be25ee8 alchemy-d95b3c38cd37814a1b98d0bbf813de7adaaecfbc.tar.gz
+sha256 542f44eecd9f8806ec1ae285201e442ab547c82d9f8c70e44c977d6332a2bea0 COPYING
diff --git a/package/alchemy/alchemy.mk b/package/alchemy/alchemy.mk
new file mode 100644
index 0000000000..95912a53a1
--- /dev/null
+++ b/package/alchemy/alchemy.mk
@@ -0,0 +1,73 @@
+################################################################################
+#
+# alchemy
+#
+################################################################################
+
+ALCHEMY_VERSION = d95b3c38cd37814a1b98d0bbf813de7adaaecfbc
+ALCHEMY_SITE = $(call github,Parrot-Developers,alchemy,$(ALCHEMY_VERSION))
+ALCHEMY_LICENSE = BSD-3-Clause
+ALCHEMY_LICENSE_FILES = COPYING
+HOST_ALCHEMY_DEPENDENCIES = host-python3
+
+ALCHEMY_SDK_BASEDIR = $(STAGING_DIR)/usr/lib/alchemy/sdk
+
+define HOST_ALCHEMY_INSTALL_CMDS
+ rm -rf $(HOST_DIR)/usr/bin/alchemy
+ mkdir -p $(HOST_DIR)/usr/bin/alchemy
+ cp -rf $(@D)/* $(HOST_DIR)/usr/bin/alchemy/
+ mkdir -p $(ALCHEMY_SDK_BASEDIR)
+endef
+
+$(eval $(host-generic-package))
+
+# Variables used by other packages
+
+ALCHEMY_HOME = $(HOST_DIR)/usr/bin/alchemy
+ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake
+
+ALCHEMY_TARGET_CONFIGURE_ENV = \
+ $(TARGET_MAKE_ENV) \
+ ALCHEMY_HOME=$(ALCHEMY_HOME) \
+ ALCHEMY_WORKSPACE_DIR="$(@D)" \
+ ALCHEMY_TARGET_OUT=alchemy-out \
+ TARGET_OS=linux \
+ TARGET_OS_FLAVOUR=buildroot \
+ TARGET_CROSS="$(TARGET_CROSS)" \
+ TARGET_ARCH=xxx \
+ TARGET_GLOBAL_CXXFLAGS="$(TARGET_CXXFLAGS)" \
+ TARGET_GLOBAL_LDFLAGS="$(TARGET_LDFLAGS)" \
+ TARGET_GLOBAL_FFLAGS="$(TARGET_FCFLAGS)" \
+ TARGET_GLOBAL_FCFLAGS="$(TARGET_FCFLAGS)"
+
+ifeq ($(BR2_STATIC_LIBS),y)
+ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_FORCE_STATIC=1
+ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS)"
+else
+ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS) -fPIC"
+endif
+
+# Configure Alchemy package dependencies.
+# This macro can be used by Alchemy packages
+# $1: List of Buildroot alchemy package the caller depends on
+define ALCHEMY_TARGET_CONFIGURE_SDKS
+ ALCHEMY_TARGET_SDK_DIRS="$(addprefix $(ALCHEMY_SDK_BASEDIR)/,$(1))"
+endef
+
+# Install an Alchemy SDK file.
+# This macro can be used by Alchemy packages
+# $1: Buildroot package name
+# $2: Alchemy module name
+# $3: Alchemy module file name
+define ALCHEMY_INSTALL_LIB_SDK_FILE
+ mkdir -p $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))
+ ( \
+ echo 'LOCAL_PATH := $$(call my-dir)'; \
+ echo 'include $$(CLEAR_VARS)'; \
+ echo 'LOCAL_MODULE := $(strip $(2))'; \
+ echo 'LOCAL_SDK := $(STAGING_DIR)'; \
+ echo 'LOCAL_DESTDIR := usr/lib'; \
+ echo 'LOCAL_MODULE_FILENAME := $(strip $(3))'; \
+ echo 'include $$(BUILD_LIBRARY)'; \
+ ) > $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk
+endef
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 1/5] package/alchemy: new host package
2021-11-03 7:36 ` [Buildroot] [PATCH 1/5] package/alchemy: new host package Herve Codina
@ 2021-11-03 15:44 ` Thomas Petazzoni
2021-11-03 17:20 ` Herve Codina
0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-11-03 15:44 UTC (permalink / raw)
To: Herve Codina; +Cc: buildroot
Hello Hervé,
On Wed, 3 Nov 2021 08:36:52 +0100
Herve Codina <herve.codina@bootlin.com> wrote:
> Alchemy is a build system developed by Parrot.
>
> It is a new build system based on the one used in Android.
> A central makefile instance scans a workspace to find user
> makefiles, includes them and register modules to be built.
>
> https://github.com/Parrot-Developers/alchemy
>
> Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Thanks for this. I think we should make it clear to other reviewers
that we intentionally did not add a new package infrastructure for this
new build system. Indeed, we do not expect to have a significant number
of packages that will rely on the Alchemy build system.
Of course, should we have more of these packages in the future, we can
consider adding a package infrastructure.
> diff --git a/package/alchemy/alchemy.mk b/package/alchemy/alchemy.mk
> new file mode 100644
> index 0000000000..95912a53a1
> --- /dev/null
> +++ b/package/alchemy/alchemy.mk
> @@ -0,0 +1,73 @@
> +################################################################################
> +#
> +# alchemy
> +#
> +################################################################################
> +
> +ALCHEMY_VERSION = d95b3c38cd37814a1b98d0bbf813de7adaaecfbc
> +ALCHEMY_SITE = $(call github,Parrot-Developers,alchemy,$(ALCHEMY_VERSION))
> +ALCHEMY_LICENSE = BSD-3-Clause
The kconfig code is under GPL-2.0.
> +ALCHEMY_LICENSE_FILES = COPYING
> +HOST_ALCHEMY_DEPENDENCIES = host-python3
> +
> +ALCHEMY_SDK_BASEDIR = $(STAGING_DIR)/usr/lib/alchemy/sdk
> +
> +define HOST_ALCHEMY_INSTALL_CMDS
> + rm -rf $(HOST_DIR)/usr/bin/alchemy
> + mkdir -p $(HOST_DIR)/usr/bin/alchemy
> + cp -rf $(@D)/* $(HOST_DIR)/usr/bin/alchemy/
It feels really odd to have the entire Alchemy code base installed in
$(HOST_DIR)/usr/bin/alchemy/. Perhaps better installed in
$(HOST_DIR)/opt ?
Also $(HOST_DIR)/usr in fact no longer exists, it's a symlink to
$(HOST_DIR) itself, so instead of using $(HOST_DIR)/usr/bin, we prefer
using $(HOST_DIR)/bin directly.
> + mkdir -p $(ALCHEMY_SDK_BASEDIR)
Is this required to be done here? It's just that this directory is in
the STAGING_DIR, so having it created during the installation of a host
package isn't nice (but admittedly we do have a number of packages who
already do this kind of things).
> +$(eval $(host-generic-package))
> +
> +# Variables used by other packages
> +
> +ALCHEMY_HOME = $(HOST_DIR)/usr/bin/alchemy
> +ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake
> +
> +ALCHEMY_TARGET_CONFIGURE_ENV = \
You never have any CONFIGURE_CMDS in alchemy based packages, and this
variable gets used in BUILD_CMDS, so the name
ALCHEMY_TARGET_CONFIGURE_ENV doesn't look very good. Perhaps just
ALCHEMY_TARGET_ENV ?
> + $(TARGET_MAKE_ENV) \
> + ALCHEMY_HOME=$(ALCHEMY_HOME) \
> + ALCHEMY_WORKSPACE_DIR="$(@D)" \
> + ALCHEMY_TARGET_OUT=alchemy-out \
> + TARGET_OS=linux \
> + TARGET_OS_FLAVOUR=buildroot \
> + TARGET_CROSS="$(TARGET_CROSS)" \
> + TARGET_ARCH=xxx \
Is this intended ?
> + TARGET_GLOBAL_CXXFLAGS="$(TARGET_CXXFLAGS)" \
> + TARGET_GLOBAL_LDFLAGS="$(TARGET_LDFLAGS)" \
> + TARGET_GLOBAL_FFLAGS="$(TARGET_FCFLAGS)" \
> + TARGET_GLOBAL_FCFLAGS="$(TARGET_FCFLAGS)"
> +
> +ifeq ($(BR2_STATIC_LIBS),y)
> +ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_FORCE_STATIC=1
> +ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS)"
Just one assignment:
FOOBAR += \
THIS=1 \
THAT=2
> +else
> +ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS) -fPIC"
> +endif
> +
> +# Configure Alchemy package dependencies.
> +# This macro can be used by Alchemy packages
> +# $1: List of Buildroot alchemy package the caller depends on
> +define ALCHEMY_TARGET_CONFIGURE_SDKS
> + ALCHEMY_TARGET_SDK_DIRS="$(addprefix $(ALCHEMY_SDK_BASEDIR)/,$(1))"
> +endef
I don't really like this idiom, I don't think we have constructs like
this in Buildroot so far, and I find it quite confusing. I think I
would prefer to keep it explicit, i.e in libfutils:
+define LIBFUTILS_BUILD_CMDS
+ $(ALCHEMY_TARGET_CONFIGURE_ENV) \
+ ALCHEMY_TARGET_SDK_DIRS="$(addprefix $(ALCHEMY_SDK_BASEDIR)/,ulog)"
+ $(LIBFUTILS_CONF_ENV) \
+ $(ALCHEMY_MAKE) libfutils
+endef
Indeed, this macro which generates an assignment that should be added
in the environment of ALCHEMY_MAKE feels too tricky.
> +# Install an Alchemy SDK file.
> +# This macro can be used by Alchemy packages
> +# $1: Buildroot package name
> +# $2: Alchemy module name
> +# $3: Alchemy module file name
> +define ALCHEMY_INSTALL_LIB_SDK_FILE
> + mkdir -p $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))
> + ( \
> + echo 'LOCAL_PATH := $$(call my-dir)'; \
> + echo 'include $$(CLEAR_VARS)'; \
> + echo 'LOCAL_MODULE := $(strip $(2))'; \
> + echo 'LOCAL_SDK := $(STAGING_DIR)'; \
> + echo 'LOCAL_DESTDIR := usr/lib'; \
> + echo 'LOCAL_MODULE_FILENAME := $(strip $(3))'; \
> + echo 'include $$(BUILD_LIBRARY)'; \
> + ) > $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk
> +endef
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 1/5] package/alchemy: new host package
2021-11-03 15:44 ` Thomas Petazzoni
@ 2021-11-03 17:20 ` Herve Codina
2021-11-03 17:30 ` Thomas Petazzoni
0 siblings, 1 reply; 15+ messages in thread
From: Herve Codina @ 2021-11-03 17:20 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hi,
On Wed, 3 Nov 2021 16:44:31 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello Hervé,
[...]
> > +ALCHEMY_VERSION = d95b3c38cd37814a1b98d0bbf813de7adaaecfbc
> > +ALCHEMY_SITE = $(call github,Parrot-Developers,alchemy,$(ALCHEMY_VERSION))
> > +ALCHEMY_LICENSE = BSD-3-Clause
>
> The kconfig code is under GPL-2.0.
I missed this one.
The GPL-2.0 license file is not provided by Alchemy.
They mention 'kconfig source code is GPLv2' in their README file.
ALCHEMY_LICENSE = BSD-3-Clause (Alchemy), GPL-2.0 (kconfig)
ALCHEMY_LICENSE_FILES = COPYING README
Is that correct from Buildroot even if the GLP-2.0 license file is not
provided ?
>
> > +ALCHEMY_LICENSE_FILES = COPYING
> > +HOST_ALCHEMY_DEPENDENCIES = host-python3
> > +
> > +ALCHEMY_SDK_BASEDIR = $(STAGING_DIR)/usr/lib/alchemy/sdk
> > +
> > +define HOST_ALCHEMY_INSTALL_CMDS
> > + rm -rf $(HOST_DIR)/usr/bin/alchemy
> > + mkdir -p $(HOST_DIR)/usr/bin/alchemy
> > + cp -rf $(@D)/* $(HOST_DIR)/usr/bin/alchemy/
>
> It feels really odd to have the entire Alchemy code base installed in
> $(HOST_DIR)/usr/bin/alchemy/. Perhaps better installed in
> $(HOST_DIR)/opt ?
Ok, I will change in v2 to $(HOST_DIR)/opt/alchemy/
>
> Also $(HOST_DIR)/usr in fact no longer exists, it's a symlink to
> $(HOST_DIR) itself, so instead of using $(HOST_DIR)/usr/bin, we prefer
> using $(HOST_DIR)/bin directly.
>
> > + mkdir -p $(ALCHEMY_SDK_BASEDIR)
>
> Is this required to be done here? It's just that this directory is in
> the STAGING_DIR, so having it created during the installation of a host
> package isn't nice (but admittedly we do have a number of packages who
> already do this kind of things).
I will simply remove this mkdir in v2 as it is done already done in
ALCHEMY_INSTALL_LIB_SDK_FILE macro.
>
> > +$(eval $(host-generic-package))
> > +
> > +# Variables used by other packages
> > +
> > +ALCHEMY_HOME = $(HOST_DIR)/usr/bin/alchemy
> > +ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake
> > +
> > +ALCHEMY_TARGET_CONFIGURE_ENV = \
>
> You never have any CONFIGURE_CMDS in alchemy based packages, and this
> variable gets used in BUILD_CMDS, so the name
> ALCHEMY_TARGET_CONFIGURE_ENV doesn't look very good. Perhaps just
> ALCHEMY_TARGET_ENV ?
I will change in v2 to ALCHEMY_TARGET_ENV.
>
> > + $(TARGET_MAKE_ENV) \
> > + ALCHEMY_HOME=$(ALCHEMY_HOME) \
> > + ALCHEMY_WORKSPACE_DIR="$(@D)" \
> > + ALCHEMY_TARGET_OUT=alchemy-out \
> > + TARGET_OS=linux \
> > + TARGET_OS_FLAVOUR=buildroot \
> > + TARGET_CROSS="$(TARGET_CROSS)" \
> > + TARGET_ARCH=xxx \
>
> Is this intended ?
Yes, it is to avoid the internal Alchemy arch management.
It can lead to incorrect results with the toolchain we
provided in TARGET_CROSS. Indeed they add some CFLAGS
depending on given TARGET_ARCH.
To avoid issues, this was the simplest way I found to say
'Hey Alchemy, do not care about the arch, I do it for you'.
Maybe this breaks some internal parts such as building a
CMake or an autotools package but in the buildroot context,
A CMake or an autotools package will not be built by Alchemy.
I will add a comment in v2.
>
> > + TARGET_GLOBAL_CXXFLAGS="$(TARGET_CXXFLAGS)" \
> > + TARGET_GLOBAL_LDFLAGS="$(TARGET_LDFLAGS)" \
> > + TARGET_GLOBAL_FFLAGS="$(TARGET_FCFLAGS)" \
> > + TARGET_GLOBAL_FCFLAGS="$(TARGET_FCFLAGS)"
> > +
> > +ifeq ($(BR2_STATIC_LIBS),y)
> > +ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_FORCE_STATIC=1
> > +ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS)"
>
> Just one assignment:
>
> FOOBAR += \
> THIS=1 \
> THAT=2
Will be changed in v2.
>
> > +else
> > +ALCHEMY_TARGET_CONFIGURE_ENV += TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS) -fPIC"
> > +endif
> > +
> > +# Configure Alchemy package dependencies.
> > +# This macro can be used by Alchemy packages
> > +# $1: List of Buildroot alchemy package the caller depends on
> > +define ALCHEMY_TARGET_CONFIGURE_SDKS
> > + ALCHEMY_TARGET_SDK_DIRS="$(addprefix $(ALCHEMY_SDK_BASEDIR)/,$(1))"
> > +endef
>
> I don't really like this idiom, I don't think we have constructs like
> this in Buildroot so far, and I find it quite confusing. I think I
> would prefer to keep it explicit, i.e in libfutils:
>
> +define LIBFUTILS_BUILD_CMDS
> + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> + ALCHEMY_TARGET_SDK_DIRS="$(addprefix $(ALCHEMY_SDK_BASEDIR)/,ulog)"
> + $(LIBFUTILS_CONF_ENV) \
> + $(ALCHEMY_MAKE) libfutils
> +endef
>
> Indeed, this macro which generates an assignment that should be added
> in the environment of ALCHEMY_MAKE feels too tricky.
I will remove the macro in v2 and make the explicit assignment in each
packages.
>
> > +# Install an Alchemy SDK file.
> > +# This macro can be used by Alchemy packages
> > +# $1: Buildroot package name
> > +# $2: Alchemy module name
> > +# $3: Alchemy module file name
> > +define ALCHEMY_INSTALL_LIB_SDK_FILE
> > + mkdir -p $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))
> > + ( \
> > + echo 'LOCAL_PATH := $$(call my-dir)'; \
> > + echo 'include $$(CLEAR_VARS)'; \
> > + echo 'LOCAL_MODULE := $(strip $(2))'; \
> > + echo 'LOCAL_SDK := $(STAGING_DIR)'; \
> > + echo 'LOCAL_DESTDIR := usr/lib'; \
> > + echo 'LOCAL_MODULE_FILENAME := $(strip $(3))'; \
> > + echo 'include $$(BUILD_LIBRARY)'; \
> > + ) > $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk
> > +endef
>
> Thanks!
>
> Thomas
Thanks for the review.
Hervé
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 1/5] package/alchemy: new host package
2021-11-03 17:20 ` Herve Codina
@ 2021-11-03 17:30 ` Thomas Petazzoni
0 siblings, 0 replies; 15+ messages in thread
From: Thomas Petazzoni @ 2021-11-03 17:30 UTC (permalink / raw)
To: Herve Codina; +Cc: buildroot
Hello Hervé,
On Wed, 3 Nov 2021 18:20:47 +0100
Herve Codina <herve.codina@bootlin.com> wrote:
> > The kconfig code is under GPL-2.0.
>
> I missed this one.
>
> The GPL-2.0 license file is not provided by Alchemy.
> They mention 'kconfig source code is GPLv2' in their README file.
>
> ALCHEMY_LICENSE = BSD-3-Clause (Alchemy), GPL-2.0 (kconfig)
> ALCHEMY_LICENSE_FILES = COPYING README
>
> Is that correct from Buildroot even if the GLP-2.0 license file is not
> provided ?
Yes, that's fine.
> > > + $(TARGET_MAKE_ENV) \
> > > + ALCHEMY_HOME=$(ALCHEMY_HOME) \
> > > + ALCHEMY_WORKSPACE_DIR="$(@D)" \
> > > + ALCHEMY_TARGET_OUT=alchemy-out \
> > > + TARGET_OS=linux \
> > > + TARGET_OS_FLAVOUR=buildroot \
> > > + TARGET_CROSS="$(TARGET_CROSS)" \
> > > + TARGET_ARCH=xxx \
> >
> > Is this intended ?
>
> Yes, it is to avoid the internal Alchemy arch management.
>
> It can lead to incorrect results with the toolchain we
> provided in TARGET_CROSS. Indeed they add some CFLAGS
> depending on given TARGET_ARCH.
> To avoid issues, this was the simplest way I found to say
> 'Hey Alchemy, do not care about the arch, I do it for you'.
>
> Maybe this breaks some internal parts such as building a
> CMake or an autotools package but in the buildroot context,
> A CMake or an autotools package will not be built by Alchemy.
>
> I will add a comment in v2.
Thanks for the explanation. Adding a comment in the code will
definitely be useful to clear up what's happening with this TARGET_ARCH
variable.
Thanks!
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 2/5] package/ulog: new package
2021-11-03 7:36 [Buildroot] [PATCH 0/5] Add Alchemy build system and some related libs Herve Codina
2021-11-03 7:36 ` [Buildroot] [PATCH 1/5] package/alchemy: new host package Herve Codina
@ 2021-11-03 7:36 ` Herve Codina
2021-11-03 15:47 ` Thomas Petazzoni
2021-11-03 7:36 ` [Buildroot] [PATCH 3/5] package/libfutils: " Herve Codina
` (2 subsequent siblings)
4 siblings, 1 reply; 15+ messages in thread
From: Herve Codina @ 2021-11-03 7:36 UTC (permalink / raw)
To: buildroot; +Cc: Hervé Codina, Thomas Petazzoni
The ulog library is a minimalistic logging library derived from
Android logger.
https://github.com/Parrot-Developers/ulog
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/ulog/Config.in | 12 ++++++++++++
package/ulog/ulog.hash | 3 +++
package/ulog/ulog.mk | 44 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 61 insertions(+)
create mode 100644 package/ulog/Config.in
create mode 100644 package/ulog/ulog.hash
create mode 100644 package/ulog/ulog.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 778c5c7e08..33e77285d2 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1152,6 +1152,7 @@ F: package/dtbocfg/
F: package/libdbi/
F: package/libdbi-drivers/
F: package/lua-augeas/
+F: package/ulog/
F: support/testing/tests/package/test_dtbocfg.py
F: support/testing/tests/package/test_lua_augeas.py
diff --git a/package/Config.in b/package/Config.in
index c23755a421..bbf4ea0477 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1704,6 +1704,7 @@ menu "Logging"
source "package/log4qt/Config.in"
source "package/opentracing-cpp/Config.in"
source "package/spdlog/Config.in"
+ source "package/ulog/Config.in"
source "package/zlog/Config.in"
endmenu
diff --git a/package/ulog/Config.in b/package/ulog/Config.in
new file mode 100644
index 0000000000..ef155005c2
--- /dev/null
+++ b/package/ulog/Config.in
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_ULOG
+ bool "ulog"
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ help
+ This is a minimalistic logging library derived from
+ Android logger.
+
+ https://github.com/Parrot-Developers/ulog
+
+comment "ulog needs a toolchain w/ C++, threads"
+ depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/ulog/ulog.hash b/package/ulog/ulog.hash
new file mode 100644
index 0000000000..47adc093b9
--- /dev/null
+++ b/package/ulog/ulog.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 14e5773b32a79fa5380bdc7ac73a39a7cd3ab182830f57cf6f2994fb49cf38dc ulog-0389d243352255f6182326dccdae3d56dadc078f.tar.gz
+sha256 cbb97dd2528af2aa2b9aee6c1b3ff1caed758044c17b2c811cf44b2528c496da COPYING
diff --git a/package/ulog/ulog.mk b/package/ulog/ulog.mk
new file mode 100644
index 0000000000..e84598701b
--- /dev/null
+++ b/package/ulog/ulog.mk
@@ -0,0 +1,44 @@
+################################################################################
+#
+# ulog
+#
+################################################################################
+
+ULOG_VERSION = 0389d243352255f6182326dccdae3d56dadc078f
+ULOG_SITE = $(call github,Parrot-Developers,ulog,$(ULOG_VERSION))
+ULOG_LICENSE = Apache-2.0
+ULOG_LICENSE_FILES = COPYING
+ULOG_DEPENDENCIES = host-alchemy
+ULOG_INSTALL_STAGING = YES
+
+define ULOG_BUILD_CMDS
+ $(ALCHEMY_TARGET_CONFIGURE_ENV) \
+ $(ALCHEMY_MAKE) libulog
+endef
+
+define ULOG_INSTALL_STATIC_LIBS
+ $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a $(strip $(1))/usr/lib/
+endef
+
+define ULOG_INSTALL_HEADERS
+ cp -Raf $(@D)/libulog/include/* $(strip $(1))/usr/include/
+endef
+
+ifeq ($(BR2_STATIC_LIBS),)
+define ULOG_INSTALL_SHARED_LIBS
+ $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libulog.so* $(strip $(1))/usr/lib/
+endef
+endif
+
+define ULOG_INSTALL_TARGET_CMDS
+ $(call ULOG_INSTALL_SHARED_LIBS, $(TARGET_DIR))
+endef
+
+define ULOG_INSTALL_STAGING_CMDS
+ $(call ULOG_INSTALL_STATIC_LIBS, $(STAGING_DIR))
+ $(call ULOG_INSTALL_SHARED_LIBS, $(STAGING_DIR))
+ $(call ULOG_INSTALL_HEADERS, $(STAGING_DIR))
+ $(call ALCHEMY_INSTALL_LIB_SDK_FILE, ulog, libulog, libulog.so)
+endef
+
+$(eval $(generic-package))
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 2/5] package/ulog: new package
2021-11-03 7:36 ` [Buildroot] [PATCH 2/5] package/ulog: new package Herve Codina
@ 2021-11-03 15:47 ` Thomas Petazzoni
2021-11-03 17:24 ` Herve Codina
0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-11-03 15:47 UTC (permalink / raw)
To: Herve Codina; +Cc: buildroot
On Wed, 3 Nov 2021 08:36:53 +0100
Herve Codina <herve.codina@bootlin.com> wrote:
> +ULOG_VERSION = 0389d243352255f6182326dccdae3d56dadc078f
> +ULOG_SITE = $(call github,Parrot-Developers,ulog,$(ULOG_VERSION))
> +ULOG_LICENSE = Apache-2.0
> +ULOG_LICENSE_FILES = COPYING
> +ULOG_DEPENDENCIES = host-alchemy
> +ULOG_INSTALL_STAGING = YES
> +
> +define ULOG_BUILD_CMDS
> + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> + $(ALCHEMY_MAKE) libulog
Please indent the continuation line.
> +define ULOG_INSTALL_STATIC_LIBS
> + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a $(strip $(1))/usr/lib/
> +endef
I am not entirely sure we need to $(strip ...) the $(1) argument here
and in other macros. We have several other places in Buildroot for
similar situations where we don't strip $(1). (Note: this is not a very
important comment.)
Thanks,
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 2/5] package/ulog: new package
2021-11-03 15:47 ` Thomas Petazzoni
@ 2021-11-03 17:24 ` Herve Codina
0 siblings, 0 replies; 15+ messages in thread
From: Herve Codina @ 2021-11-03 17:24 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hi,
On Wed, 3 Nov 2021 16:47:01 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> On Wed, 3 Nov 2021 08:36:53 +0100
> Herve Codina <herve.codina@bootlin.com> wrote:
>
> > +ULOG_VERSION = 0389d243352255f6182326dccdae3d56dadc078f
> > +ULOG_SITE = $(call github,Parrot-Developers,ulog,$(ULOG_VERSION))
> > +ULOG_LICENSE = Apache-2.0
> > +ULOG_LICENSE_FILES = COPYING
> > +ULOG_DEPENDENCIES = host-alchemy
> > +ULOG_INSTALL_STAGING = YES
> > +
> > +define ULOG_BUILD_CMDS
> > + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> > + $(ALCHEMY_MAKE) libulog
>
> Please indent the continuation line.
Will be done in v2.
>
> > +define ULOG_INSTALL_STATIC_LIBS
> > + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a $(strip $(1))/usr/lib/
> > +endef
>
> I am not entirely sure we need to $(strip ...) the $(1) argument here
> and in other macros. We have several other places in Buildroot for
> similar situations where we don't strip $(1). (Note: this is not a very
> important comment.)
I will remove this kind of $(strip ...) in v2.
>
> Thanks,
>
> Thomas
Thanks fr the review.
Hervé
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 3/5] package/libfutils: new package
2021-11-03 7:36 [Buildroot] [PATCH 0/5] Add Alchemy build system and some related libs Herve Codina
2021-11-03 7:36 ` [Buildroot] [PATCH 1/5] package/alchemy: new host package Herve Codina
2021-11-03 7:36 ` [Buildroot] [PATCH 2/5] package/ulog: new package Herve Codina
@ 2021-11-03 7:36 ` Herve Codina
2021-11-03 15:47 ` Thomas Petazzoni
2021-11-03 7:36 ` [Buildroot] [PATCH 4/5] package/libshdata: " Herve Codina
2021-11-03 7:36 ` [Buildroot] [PATCH 5/5] support/testing/tests/package/test_libshdata: new test Herve Codina
4 siblings, 1 reply; 15+ messages in thread
From: Herve Codina @ 2021-11-03 7:36 UTC (permalink / raw)
To: buildroot; +Cc: Hervé Codina, Thomas Petazzoni
The libfutils library is a library that contains some common
useful functions (list, hash, time).
https://github.com/Parrot-Developers/libfutils
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
package/libfutils/Config.in | 14 +++++++++
package/libfutils/libfutils.hash | 3 ++
package/libfutils/libfutils.mk | 50 ++++++++++++++++++++++++++++++++
5 files changed, 69 insertions(+)
create mode 100644 package/libfutils/Config.in
create mode 100644 package/libfutils/libfutils.hash
create mode 100644 package/libfutils/libfutils.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index 33e77285d2..d0207b5136 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1151,6 +1151,7 @@ F: package/alchemy/
F: package/dtbocfg/
F: package/libdbi/
F: package/libdbi-drivers/
+F: package/libfutils/
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 bbf4ea0477..b805b87e0a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1947,6 +1947,7 @@ menu "Other"
source "package/libevdev/Config.in"
source "package/libevent/Config.in"
source "package/libffi/Config.in"
+ source "package/libfutils/Config.in"
source "package/libgee/Config.in"
source "package/libgeos/Config.in"
source "package/libglib2/Config.in"
diff --git a/package/libfutils/Config.in b/package/libfutils/Config.in
new file mode 100644
index 0000000000..0329dd065c
--- /dev/null
+++ b/package/libfutils/Config.in
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_LIBFUTILS
+ bool "libfutils"
+ depends on BR2_TOOLCHAIN_HAS_ATOMIC
+ depends on BR2_INSTALL_LIBSTDCPP # ulog
+ depends on BR2_TOOLCHAIN_HAS_THREADS # ulog
+ select BR2_PACKAGE_ULOG
+ help
+ This library contains some common useful functions (list,
+ hash, time)
+
+ https://github.com/Parrot-Developers/libfutils
+
+comment "libfutils needs a toolchain w/ C++, threads"
+ depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/libfutils/libfutils.hash b/package/libfutils/libfutils.hash
new file mode 100644
index 0000000000..1fdcd84b13
--- /dev/null
+++ b/package/libfutils/libfutils.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 b38d40c46b83e448d8c1716ddfb04b7ecd384f5cd2cb773db5c26c0589accdb3 libfutils-c326ce0cc2a7354381265a7664bb215be587fac6.tar.gz
+sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING
diff --git a/package/libfutils/libfutils.mk b/package/libfutils/libfutils.mk
new file mode 100644
index 0000000000..2048247db6
--- /dev/null
+++ b/package/libfutils/libfutils.mk
@@ -0,0 +1,50 @@
+################################################################################
+#
+# libfutils
+#
+################################################################################
+
+LIBFUTILS_VERSION = c326ce0cc2a7354381265a7664bb215be587fac6
+LIBFUTILS_SITE = $(call github,Parrot-Developers,libfutils,$(LIBFUTILS_VERSION))
+LIBFUTILS_LICENSE = BSD-3-Clause
+LIBFUTILS_LICENSE_FILES = COPYING
+LIBFUTILS_DEPENDENCIES = ulog host-alchemy
+LIBFUTILS_INSTALL_STAGING = YES
+
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+LIBFUTILS_CONF_ENV += TARGET_GLOBAL_LDLIBS='-latomic'
+endif
+
+define LIBFUTILS_BUILD_CMDS
+ $(ALCHEMY_TARGET_CONFIGURE_ENV) \
+ $(call ALCHEMY_TARGET_CONFIGURE_SDKS, ulog) \
+ $(LIBFUTILS_CONF_ENV) \
+ $(ALCHEMY_MAKE) libfutils
+endef
+
+define LIBFUTILS_INSTALL_STATIC_LIBS
+ $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libfutils.a $(strip $(1))/usr/lib/
+endef
+
+define LIBFUTILS_INSTALL_HEADERS
+ cp -Raf $(@D)/include/* $(strip $(1))/usr/include/
+endef
+
+ifeq ($(BR2_STATIC_LIBS),)
+define LIBFUTILS_INSTALL_SHARED_LIBS
+ $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libfutils.so* $(strip $(1))/usr/lib/
+endef
+endif
+
+define LIBFUTILS_INSTALL_TARGET_CMDS
+ $(call LIBFUTILS_INSTALL_SHARED_LIBS, $(TARGET_DIR))
+endef
+
+define LIBFUTILS_INSTALL_STAGING_CMDS
+ $(call LIBFUTILS_INSTALL_STATIC_LIBS, $(STAGING_DIR))
+ $(call LIBFUTILS_INSTALL_SHARED_LIBS, $(STAGING_DIR))
+ $(call LIBFUTILS_INSTALL_HEADERS, $(STAGING_DIR))
+ $(call ALCHEMY_INSTALL_LIB_SDK_FILE, libfutils, libfutils, libfutils.so)
+endef
+
+$(eval $(generic-package))
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 3/5] package/libfutils: new package
2021-11-03 7:36 ` [Buildroot] [PATCH 3/5] package/libfutils: " Herve Codina
@ 2021-11-03 15:47 ` Thomas Petazzoni
2021-11-03 17:31 ` Herve Codina
0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-11-03 15:47 UTC (permalink / raw)
To: Herve Codina; +Cc: buildroot
Hello,
On Wed, 3 Nov 2021 08:36:54 +0100
Herve Codina <herve.codina@bootlin.com> wrote:
"
> diff --git a/package/libfutils/Config.in b/package/libfutils/Config.in
> new file mode 100644
> index 0000000000..0329dd065c
> --- /dev/null
> +++ b/package/libfutils/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_LIBFUTILS
> + bool "libfutils"
> + depends on BR2_TOOLCHAIN_HAS_ATOMIC
> + depends on BR2_INSTALL_LIBSTDCPP # ulog
> + depends on BR2_TOOLCHAIN_HAS_THREADS # ulog
> + select BR2_PACKAGE_ULOG
> + help
> + This library contains some common useful functions (list,
> + hash, time)
> +
> + https://github.com/Parrot-Developers/libfutils
> +
> +comment "libfutils needs a toolchain w/ C++, threads"
You need:
depends on BR2_TOOLCHAIN_HAS_ATOMIC
> + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
> diff --git a/package/libfutils/libfutils.hash b/package/libfutils/libfutils.hash
> new file mode 100644
> index 0000000000..1fdcd84b13
> --- /dev/null
> +++ b/package/libfutils/libfutils.hash
> @@ -0,0 +1,3 @@
> +# Locally computed:
> +sha256 b38d40c46b83e448d8c1716ddfb04b7ecd384f5cd2cb773db5c26c0589accdb3 libfutils-c326ce0cc2a7354381265a7664bb215be587fac6.tar.gz
> +sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING
> diff --git a/package/libfutils/libfutils.mk b/package/libfutils/libfutils.mk
> new file mode 100644
> index 0000000000..2048247db6
> --- /dev/null
> +++ b/package/libfutils/libfutils.mk
> @@ -0,0 +1,50 @@
> +################################################################################
> +#
> +# libfutils
> +#
> +################################################################################
> +
> +LIBFUTILS_VERSION = c326ce0cc2a7354381265a7664bb215be587fac6
> +LIBFUTILS_SITE = $(call github,Parrot-Developers,libfutils,$(LIBFUTILS_VERSION))
> +LIBFUTILS_LICENSE = BSD-3-Clause
> +LIBFUTILS_LICENSE_FILES = COPYING
> +LIBFUTILS_DEPENDENCIES = ulog host-alchemy
> +LIBFUTILS_INSTALL_STAGING = YES
> +
> +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> +LIBFUTILS_CONF_ENV += TARGET_GLOBAL_LDLIBS='-latomic'
> +endif
> +
> +define LIBFUTILS_BUILD_CMDS
> + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> + $(call ALCHEMY_TARGET_CONFIGURE_SDKS, ulog) \
> + $(LIBFUTILS_CONF_ENV) \
> + $(ALCHEMY_MAKE) libfutils
Indentation of continuation lines.
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 3/5] package/libfutils: new package
2021-11-03 15:47 ` Thomas Petazzoni
@ 2021-11-03 17:31 ` Herve Codina
0 siblings, 0 replies; 15+ messages in thread
From: Herve Codina @ 2021-11-03 17:31 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hi,
On Wed, 3 Nov 2021 16:47:56 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 3 Nov 2021 08:36:54 +0100
> Herve Codina <herve.codina@bootlin.com> wrote:
> "
> > diff --git a/package/libfutils/Config.in b/package/libfutils/Config.in
> > new file mode 100644
> > index 0000000000..0329dd065c
> > --- /dev/null
> > +++ b/package/libfutils/Config.in
> > @@ -0,0 +1,14 @@
> > +config BR2_PACKAGE_LIBFUTILS
> > + bool "libfutils"
> > + depends on BR2_TOOLCHAIN_HAS_ATOMIC
> > + depends on BR2_INSTALL_LIBSTDCPP # ulog
> > + depends on BR2_TOOLCHAIN_HAS_THREADS # ulog
> > + select BR2_PACKAGE_ULOG
> > + help
> > + This library contains some common useful functions (list,
> > + hash, time)
> > +
> > + https://github.com/Parrot-Developers/libfutils
> > +
> > +comment "libfutils needs a toolchain w/ C++, threads"
>
> You need:
>
> depends on BR2_TOOLCHAIN_HAS_ATOMIC
Indeed.
Will be added in v2.
>
> > + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
> > diff --git a/package/libfutils/libfutils.hash b/package/libfutils/libfutils.hash
> > new file mode 100644
> > index 0000000000..1fdcd84b13
> > --- /dev/null
> > +++ b/package/libfutils/libfutils.hash
> > @@ -0,0 +1,3 @@
> > +# Locally computed:
> > +sha256 b38d40c46b83e448d8c1716ddfb04b7ecd384f5cd2cb773db5c26c0589accdb3 libfutils-c326ce0cc2a7354381265a7664bb215be587fac6.tar.gz
> > +sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING
> > diff --git a/package/libfutils/libfutils.mk b/package/libfutils/libfutils.mk
> > new file mode 100644
> > index 0000000000..2048247db6
> > --- /dev/null
> > +++ b/package/libfutils/libfutils.mk
> > @@ -0,0 +1,50 @@
> > +################################################################################
> > +#
> > +# libfutils
> > +#
> > +################################################################################
> > +
> > +LIBFUTILS_VERSION = c326ce0cc2a7354381265a7664bb215be587fac6
> > +LIBFUTILS_SITE = $(call github,Parrot-Developers,libfutils,$(LIBFUTILS_VERSION))
> > +LIBFUTILS_LICENSE = BSD-3-Clause
> > +LIBFUTILS_LICENSE_FILES = COPYING
> > +LIBFUTILS_DEPENDENCIES = ulog host-alchemy
> > +LIBFUTILS_INSTALL_STAGING = YES
> > +
> > +ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
> > +LIBFUTILS_CONF_ENV += TARGET_GLOBAL_LDLIBS='-latomic'
> > +endif
> > +
> > +define LIBFUTILS_BUILD_CMDS
> > + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> > + $(call ALCHEMY_TARGET_CONFIGURE_SDKS, ulog) \
> > + $(LIBFUTILS_CONF_ENV) \
> > + $(ALCHEMY_MAKE) libfutils
>
> Indentation of continuation lines.
Will be changed in v2.
>
> Thomas
Thanks for the review.
Hervé
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 4/5] package/libshdata: new package
2021-11-03 7:36 [Buildroot] [PATCH 0/5] Add Alchemy build system and some related libs Herve Codina
` (2 preceding siblings ...)
2021-11-03 7:36 ` [Buildroot] [PATCH 3/5] package/libfutils: " Herve Codina
@ 2021-11-03 7:36 ` Herve Codina
2021-11-03 15:50 ` Thomas Petazzoni
2021-11-03 7:36 ` [Buildroot] [PATCH 5/5] support/testing/tests/package/test_libshdata: new test Herve Codina
4 siblings, 1 reply; 15+ messages in thread
From: Herve Codina @ 2021-11-03 7:36 UTC (permalink / raw)
To: buildroot; +Cc: Hervé Codina, Thomas Petazzoni
The libshdata library provides lock free shared-memory tools.
https://github.com/Parrot-Developers/libshdata
The provided patch was submitted upstream.
https://github.com/Parrot-Developers/libshdata/issues/1
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
DEVELOPERS | 1 +
package/Config.in | 1 +
...01-backend-Add-missing-include-files.patch | 44 ++++++++++++++
package/libshdata/Config.in | 23 ++++++++
package/libshdata/libshdata.hash | 3 +
package/libshdata/libshdata.mk | 59 +++++++++++++++++++
6 files changed, 131 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 d0207b5136..64a2098343 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1152,6 +1152,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 b805b87e0a..95371dbebb 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1988,6 +1988,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..75abddbee4
--- /dev/null
+++ b/package/libshdata/0001-backend-Add-missing-include-files.patch
@@ -0,0 +1,44 @@
+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.
+
+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..730fb34dff
--- /dev/null
+++ b/package/libshdata/Config.in
@@ -0,0 +1,23 @@
+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
+
+comment "libshdata needs a toolchain w/ C++, threads"
+ depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
+
+if BR2_PACKAGE_LIBSHDATA
+
+config BR2_PACKAGE_LIBSHDATA_STRESS
+ bool "libshdata-stress binary"
+ help
+ Install libshdata-stress binary as well
+
+endif
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..2506b16c42
--- /dev/null
+++ b/package/libshdata/libshdata.mk
@@ -0,0 +1,59 @@
+################################################################################
+#
+# 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_CONFIGURE_ENV) \
+ $(call ALCHEMY_TARGET_CONFIGURE_SDKS, libfutils) \
+ $(LIBSHDATA_CONF_ENV) \
+ $(ALCHEMY_MAKE) $(LIBSHDATA_TARGETS)
+endef
+
+define LIBSHDATA_INSTALL_STATIC_LIBS
+ $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata.a $(strip $(1))/usr/lib/
+ $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata-section-lookup.a $(strip $(1))/usr/lib/
+endef
+
+define LIBSHDATA_INSTALL_HEADERS
+ cp -Raf $(@D)/include/* $(strip $(1))/usr/include/
+endef
+
+ifeq ($(BR2_STATIC_LIBS),)
+define LIBSHDATA_INSTALL_SHARED_LIBS
+ $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libshdata.so* $(strip $(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 $(strip $(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
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 4/5] package/libshdata: new package
2021-11-03 7:36 ` [Buildroot] [PATCH 4/5] package/libshdata: " Herve Codina
@ 2021-11-03 15:50 ` Thomas Petazzoni
2021-11-03 17:49 ` Herve Codina
0 siblings, 1 reply; 15+ messages in thread
From: Thomas Petazzoni @ 2021-11-03 15:50 UTC (permalink / raw)
To: Herve Codina; +Cc: buildroot
Hello,
On Wed, 3 Nov 2021 08:36:55 +0100
Herve Codina <herve.codina@bootlin.com> wrote:
> The libshdata library provides lock free shared-memory tools.
>
> https://github.com/Parrot-Developers/libshdata
>
> The provided patch was submitted upstream.
> https://github.com/Parrot-Developers/libshdata/issues/1
This should rather go in the patch itself.
> diff --git a/package/libshdata/Config.in b/package/libshdata/Config.in
> new file mode 100644
> index 0000000000..730fb34dff
> --- /dev/null
> +++ b/package/libshdata/Config.in
> @@ -0,0 +1,23 @@
> +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
> +
> +comment "libshdata needs a toolchain w/ C++, threads"
> + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
This needs to go *after* the if ... endif block, or the indentation of
the if ... endif block is broken in menuconfig. Also, you need to
account for the HAS_SYNC_4 and HAS_ATOMIC dependencies.
> +define LIBSHDATA_BUILD_CMDS
> + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> + $(call ALCHEMY_TARGET_CONFIGURE_SDKS, libfutils) \
> + $(LIBSHDATA_CONF_ENV) \
> + $(ALCHEMY_MAKE) $(LIBSHDATA_TARGETS)
Indentation.
> +endef
> +
> +define LIBSHDATA_INSTALL_STATIC_LIBS
> + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata.a $(strip $(1))/usr/lib/
> + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata-section-lookup.a $(strip $(1))/usr/lib/
> +endef
> +
> +define LIBSHDATA_INSTALL_HEADERS
> + cp -Raf $(@D)/include/* $(strip $(1))/usr/include/
> +endef
> +
> +ifeq ($(BR2_STATIC_LIBS),)
> +define LIBSHDATA_INSTALL_SHARED_LIBS
> + $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libshdata.so* $(strip $(1))/usr/lib/
Sot here are two separate static libraries, but only one shared library ?
Thomas
--
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [Buildroot] [PATCH 4/5] package/libshdata: new package
2021-11-03 15:50 ` Thomas Petazzoni
@ 2021-11-03 17:49 ` Herve Codina
0 siblings, 0 replies; 15+ messages in thread
From: Herve Codina @ 2021-11-03 17:49 UTC (permalink / raw)
To: Thomas Petazzoni; +Cc: buildroot
Hi,
On Wed, 3 Nov 2021 16:50:00 +0100
Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 3 Nov 2021 08:36:55 +0100
> Herve Codina <herve.codina@bootlin.com> wrote:
>
> > The libshdata library provides lock free shared-memory tools.
> >
> > https://github.com/Parrot-Developers/libshdata
> >
> > The provided patch was submitted upstream.
> > https://github.com/Parrot-Developers/libshdata/issues/1
>
> This should rather go in the patch itself.
Will be moved to the patch in v2.
>
>
> > diff --git a/package/libshdata/Config.in b/package/libshdata/Config.in
> > new file mode 100644
> > index 0000000000..730fb34dff
> > --- /dev/null
> > +++ b/package/libshdata/Config.in
> > @@ -0,0 +1,23 @@
> > +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
> > +
> > +comment "libshdata needs a toolchain w/ C++, threads"
> > + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS
>
> This needs to go *after* the if ... endif block, or the indentation of
> the if ... endif block is broken in menuconfig. Also, you need to
> account for the HAS_SYNC_4 and HAS_ATOMIC dependencies.
Ok,
Will be changed in v2.
>
>
> > +define LIBSHDATA_BUILD_CMDS
> > + $(ALCHEMY_TARGET_CONFIGURE_ENV) \
> > + $(call ALCHEMY_TARGET_CONFIGURE_SDKS, libfutils) \
> > + $(LIBSHDATA_CONF_ENV) \
> > + $(ALCHEMY_MAKE) $(LIBSHDATA_TARGETS)
>
> Indentation.
Will be changed in v2.
>
> > +endef
> > +
> > +define LIBSHDATA_INSTALL_STATIC_LIBS
> > + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata.a $(strip $(1))/usr/lib/
> > + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libshdata-section-lookup.a $(strip $(1))/usr/lib/
> > +endef
> > +
> > +define LIBSHDATA_INSTALL_HEADERS
> > + cp -Raf $(@D)/include/* $(strip $(1))/usr/include/
> > +endef
> > +
> > +ifeq ($(BR2_STATIC_LIBS),)
> > +define LIBSHDATA_INSTALL_SHARED_LIBS
> > + $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libshdata.so* $(strip $(1))/usr/lib/
>
> Sot here are two separate static libraries, but only one shared library ?
Yes, that's what libshdata provides.
libshdata-section-lookup is only a static lib (include $(BUILD_STATIC_LIBRARY) in atom.mk).
>
> Thomas
Thanks for the review.
Hervé
--
Hervé Codina, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [PATCH 5/5] support/testing/tests/package/test_libshdata: new test
2021-11-03 7:36 [Buildroot] [PATCH 0/5] Add Alchemy build system and some related libs Herve Codina
` (3 preceding siblings ...)
2021-11-03 7:36 ` [Buildroot] [PATCH 4/5] package/libshdata: " Herve Codina
@ 2021-11-03 7:36 ` Herve Codina
4 siblings, 0 replies; 15+ messages in thread
From: Herve Codina @ 2021-11-03 7:36 UTC (permalink / raw)
To: buildroot; +Cc: Hervé Codina, Thomas Petazzoni
This new test ensures that libraries and binaries generated
using Parrot Alchemy build system are correct.
Indeed, the test uses libshdata-stress.
This binary depends on libshdata.
libshdata depends on libfutils and libfutils depends on ulog.
All of these binaries and libraries are built using Alchemy.
Signed-off-by: Herve Codina <herve.codina@bootlin.com>
---
DEVELOPERS | 1 +
.../testing/tests/package/test_libshdata.py | 25 +++++++++++++++++++
2 files changed, 26 insertions(+)
create mode 100644 support/testing/tests/package/test_libshdata.py
diff --git a/DEVELOPERS b/DEVELOPERS
index 64a2098343..3a5b24f73d 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1156,6 +1156,7 @@ F: package/libshdata/
F: package/lua-augeas/
F: package/ulog/
F: support/testing/tests/package/test_dtbocfg.py
+F: support/testing/tests/package/test_libshdata.py
F: support/testing/tests/package/test_lua_augeas.py
N: Hervé Codina <herve.codina@bootlin.com>
diff --git a/support/testing/tests/package/test_libshdata.py b/support/testing/tests/package/test_libshdata.py
new file mode 100644
index 0000000000..80b032ac69
--- /dev/null
+++ b/support/testing/tests/package/test_libshdata.py
@@ -0,0 +1,25 @@
+import os
+
+import infra.basetest
+
+
+class TestLibshdata(infra.basetest.BRTest):
+ config = infra.basetest.BASIC_TOOLCHAIN_CONFIG + \
+ """
+ BR2_PACKAGE_LIBSHDATA=y
+ BR2_PACKAGE_LIBSHDATA_STRESS=y
+ BR2_TARGET_ROOTFS_CPIO=y
+ # BR2_TARGET_ROOTFS_TAR is not set
+ """
+
+ def test_run(self):
+ img = os.path.join(self.builddir, "images", "rootfs.cpio")
+ self.emulator.boot(arch="armv5",
+ kernel="builtin",
+ options=["-initrd", img])
+ self.emulator.login()
+
+ # Just run libshdata-stress.
+ # This ensures that library are well compiled and that all dependencies
+ # are met using Parrot Alchemy build system.
+ self.assertRunOk("libshdata-stress")
--
2.31.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 15+ messages in thread