Add Alchemy build system and some related libs
v2 cover Add Alchemy build system and some related libs
Hi,
This patch series introduces the Parrot Alchemy build system as a host tool (patch 1).
This tool is then used to build several libs (patch 2, 3 and 4). Finaly (patch 5), a test is provided to check that the binaries were correctly built.
As it was mentionned by Thomas Peteazzoni in the previous review, a new package infrastructure was not added for the Alchemy 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.
Best regards,
Hervé Codina
Herve Codina (5):
package/alchemy: new host package package/ulog: new package
package/libfutils: new package package/libshdata: new package support/testing/tests/package/test_libshdata: new test
DEVELOPERS | 5 ++ package/Config.in | 3 + ...lchains-remove-hash-style-management.patch | 36 ++++++++++ package/alchemy/alchemy.hash | 4 ++ package/alchemy/alchemy.mk | 71 +++++++++++++++++++ package/libfutils/Config.in | 15 ++++ package/libfutils/libfutils.hash | 3 + package/libfutils/libfutils.mk | 50 +++++++++++++ ...01-backend-Add-missing-include-files.patch | 47 ++++++++++++ package/libshdata/Config.in | 25 +++++++ package/libshdata/libshdata.hash | 3 + package/libshdata/libshdata.mk | 58 +++++++++++++++ package/ulog/Config.in | 12 ++++ package/ulog/ulog.hash | 3 + package/ulog/ulog.mk | 44 ++++++++++++ .../testing/tests/package/test_libshdata.py | 25 +++++++ 16 files changed, 404 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 create mode 100644 package/libfutils/Config.in create mode 100644 package/libfutils/libfutils.hash create mode 100644 package/libfutils/libfutils.mk 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 create mode 100644 package/ulog/Config.in create mode 100644 package/ulog/ulog.hash create mode 100644 package/ulog/ulog.mk create mode 100644 support/testing/tests/package/test_libshdata.py
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 1/5 package/alchemy: new host package
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
---
Changes v1 -> v2
- Fixed missing license information related to kconfig
- Installed Alchemy in $(HOST_DIR)/opt/alchemy
- Renamed ALCHEMY_TARGET_CONFIGURE_ENV to ALCHEMY_TARGET_ENV
- Removed ALCHEMY_TARGET_CONFIGURE_SDKS macro
DEVELOPERS | 1 + ...lchains-remove-hash-style-management.patch | 36 ++++++++++ package/alchemy/alchemy.hash | 4 ++ package/alchemy/alchemy.mk | 72 +++++++++++++++++++ 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
DEVELOPERS +1 -0
@@ -1149,6 +1149,7 @@ N: Henrique Camargo <[email protected]> F: package/json-glib/ N: Hervé Codina <[email protected]> +F: package/alchemy/ F: package/dtbocfg/ F: package/libdbi/ F: package/libdbi-drivers/
package/alchemy/0001-toolchains-remove-hash-style-management.patch new file +36 -0
@@ -0,0 +1,36 @@ +From 4cb9681ab99db3d8e330ac789e17ec69583aecd4 Mon Sep 17 00:00:00 2001 +From: Herve Codina <[email protected]> +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 <[email protected]> +--- + 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 +
package/alchemy/alchemy.hash new file +4 -0
@@ -0,0 +1,4 @@ +# Locally computed: +sha256 346c06b9317691a9371d878b850e61f8bcec4f20132ac95340b9d2571be25ee8 alchemy-d95b3c38cd37814a1b98d0bbf813de7adaaecfbc.tar.gz +sha256 542f44eecd9f8806ec1ae285201e442ab547c82d9f8c70e44c977d6332a2bea0 COPYING +sha256 49872815ee3de163f07a83737c996e77a5bffa186d06b1e3bb969bfb68c251df README
package/alchemy/alchemy.mk new file +72 -0
72 lines not on this page · raw message
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v2 1/5] package/alchemy: new host package
Hervé, All,
On 2021-11-12 14:12 +0100, Herve Codina spake thusly:
Quoted 9 lines
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 <[email protected]>
I was about to push this, with a few changes, but I have some questions about the packages, so here's the patch of the changes I did:
[[email protected]: - use ALCHEMY_HOME everywhere rather than repeating the location in the install macro - don't remove install dir before installing - use a template for atom.mk, not in-line in alchemy.mk ] diff --git a/package/alchemy/alchemy.mk b/package/alchemy/alchemy.mk index 63d5a941c5..f802c62425 100644 --- a/package/alchemy/alchemy.mk +++ b/package/alchemy/alchemy.mk @@ -10,19 +10,19 @@ ALCHEMY_LICENSE = BSD-3-Clause (Alchemy), GPL-2.0 (kconfig) ALCHEMY_LICENSE_FILES = COPYING README HOST_ALCHEMY_DEPENDENCIES = host-python3 +ALCHEMY_HOME = $(HOST_DIR)/opt/alchemy ALCHEMY_SDK_BASEDIR = $(STAGING_DIR)/usr/lib/alchemy/sdk define HOST_ALCHEMY_INSTALL_CMDS - rm -rf $(HOST_DIR)/opt/alchemy - mkdir -p $(HOST_DIR)/opt/alchemy - cp -rf $(@D)/* $(HOST_DIR)/opt/alchemy/ + mkdir -p $(ALCHEMY_HOME) + cp -rf $(@D)/* $(ALCHEMY_HOME) + cp $(ALCHEMY_PKGDIR)/atom.mk.in $(ALCHEMY_HOM E)/atom.mk.in endef $(eval $(host-generic-package)) # Variables used by other packages -ALCHEMY_HOME = $(HOST_DIR)/opt/alchemy ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake # TARGET_ARCH is set to 'xxx' to avoid Alchemy managing the architecture. @@ -59,14 +59,11 @@ endif # $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 + $(INSTALL) -m 0644 -D \ + $(ALCHEMY_HOME)/atom.mk.in \ + $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk + $(SED) 's#@STAGING_DIR@#$(STAGING_DIR)#' \ + -e 's#@MODULE@#$(strip $(2))#' \ + -e 's#@MODULE_FILENAME@#$(strip $(3))#' \ + $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk endef diff --git a/package/alchemy/atom.mk.in b/package/alchemy/atom.mk.in new file mode 100644 index 0000000000..30eb6d5e23 --- /dev/null +++ b/package/alchemy/atom.mk.in @@ -0,0 +1,7 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) +LOCAL_MODULE := @MODULE@ +LOCAL_SDK := @STAGING_DIR@ +LOCAL_DESTDIR := usr/lib +LOCAL_MODULE_FILENAME := @MODULE_FILENAME@ +include $(BUILD_LIBRARY)
Regards,
Yann E. MORIN.
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v2 1/5] package/alchemy: new host package
Hi Yann,
Quoted 78 lines · On Sat, 1 Jan 2022 16:50:22 +0100 "Yann E. MORIN" <[email protected]>…
Hervé, All,
On 2021-11-12 14:12 +0100, Herve Codina spake thusly:
Quoted 9 lines
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 <[email protected]>I was about to push this, with a few changes, but I have some questions about the packages, so here's the patch of the changes I did:
[[email protected]: - use ALCHEMY_HOME everywhere rather than repeating the location in the install macro - don't remove install dir before installing - use a template for atom.mk, not in-line in alchemy.mk ] diff --git a/package/alchemy/alchemy.mk b/package/alchemy/alchemy.mk index 63d5a941c5..f802c62425 100644 --- a/package/alchemy/alchemy.mk +++ b/package/alchemy/alchemy.mk @@ -10,19 +10,19 @@ ALCHEMY_LICENSE = BSD-3-Clause (Alchemy), GPL-2.0 (kconfig) ALCHEMY_LICENSE_FILES = COPYING README HOST_ALCHEMY_DEPENDENCIES = host-python3 +ALCHEMY_HOME = $(HOST_DIR)/opt/alchemy ALCHEMY_SDK_BASEDIR = $(STAGING_DIR)/usr/lib/alchemy/sdk define HOST_ALCHEMY_INSTALL_CMDS - rm -rf $(HOST_DIR)/opt/alchemy - mkdir -p $(HOST_DIR)/opt/alchemy - cp -rf $(@D)/* $(HOST_DIR)/opt/alchemy/ + mkdir -p $(ALCHEMY_HOME) + cp -rf $(@D)/* $(ALCHEMY_HOME) + cp $(ALCHEMY_PKGDIR)/atom.mk.in $(ALCHEMY_HOM E)/atom.mk.in endef $(eval $(host-generic-package)) # Variables used by other packages -ALCHEMY_HOME = $(HOST_DIR)/opt/alchemy ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake # TARGET_ARCH is set to 'xxx' to avoid Alchemy managing the architecture. @@ -59,14 +59,11 @@ endif # $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 + $(INSTALL) -m 0644 -D \ + $(ALCHEMY_HOME)/atom.mk.in \ + $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk + $(SED) 's#@STAGING_DIR@#$(STAGING_DIR)#' \ + -e 's#@MODULE@#$(strip $(2))#' \ + -e 's#@MODULE_FILENAME@#$(strip $(3))#' \ + $(ALCHEMY_SDK_BASEDIR)/$(strip $(1))/atom.mk endef diff --git a/package/alchemy/atom.mk.in b/package/alchemy/atom.mk.in new file mode 100644 index 0000000000..30eb6d5e23 --- /dev/null +++ b/package/alchemy/atom.mk.in
Quoted 9 lines
@@ -0,0 +1,7 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+LOCAL_MODULE := @MODULE@
+LOCAL_SDK := @STAGING_DIR@
+LOCAL_DESTDIR := usr/lib
+LOCAL_MODULE_FILENAME := @MODULE_FILENAME@
+include $(BUILD_LIBRARY)I take these modifications with a few changes.
They will be part of the v3 series.
Thanks,
Hervé
Signature · 7 lines
Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 2/5 package/ulog: new package
In reply to Herve CodinaThe ulog library is a minimalistic logging library derived from Android logger.
https://github.com/Parrot-Developers/ulog
---
Changes v1 -> v2
- Renamed ALCHEMY_TARGET_CONFIGURE_ENV to ALCHEMY_TARGET_ENV
- Removed $(strip ...)
- Fixed indentation
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
DEVELOPERS +1 -0
@@ -1154,6 +1154,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
package/Config.in +1 -0
@@ -1706,6 +1706,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
package/ulog/Config.in new file +12 -0
@@ -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
package/ulog/ulog.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed: +sha256 14e5773b32a79fa5380bdc7ac73a39a7cd3ab182830f57cf6f2994fb49cf38dc ulog-0389d243352255f6182326dccdae3d56dadc078f.tar.gz +sha256 cbb97dd2528af2aa2b9aee6c1b3ff1caed758044c17b2c811cf44b2528c496da COPYING
package/ulog/ulog.mk new file +44 -0
44 lines not on this page · raw message
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v2 2/5] package/ulog: new package
Hervé, All,
On 2021-11-12 14:12 +0100, Herve Codina spake thusly:
Quoted 6 lines
The ulog library is a minimalistic logging library derived from Android logger.
https://github.com/Parrot-Developers/ulog
Signed-off-by Herve Codina <[email protected]>
[--SNIP--]
Quoted 17 lines
package/ulog/ulog.mk new file +11
-0@@ -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
package/ulog/ulog.mk line 21
Quoted 10 lines
package/ulog/ulog.mk new file +10
-0+ULOG_INSTALL_STAGING = YES + +define ULOG_BUILD_CMDS + $(ALCHEMY_TARGET_ENV) \ + $(ALCHEMY_MAKE) libulog +endef + +define ULOG_INSTALL_STATIC_LIBS + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a $(1)/usr/lib/ +endef
So, it looks like you are always going to install the static library, but the package does not have: depends on !BR2_STATIC_LIBS
package/ulog/ulog.mk line 29
Quoted 8 lines
package/ulog/ulog.mk new file +8
-0+ +define ULOG_INSTALL_HEADERS + cp -Raf $(@D)/libulog/include/* $(1)/usr/include/ +endef + +ifeq ($(BR2_STATIC_LIBS),) +define ULOG_INSTALL_SHARED_LIBS + $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libulog.so* $(1)/usr/lib/
Although it is very improbable that the destination directory does not already exist, that is still a possibility, especially in target/. And for consistency with all the other packages, you must create the destination directory first before you start copying multiple files in there.
Also for consistency, use either 'cp' or '$(INSTALL)', not both , in the same .mk (you used 'cp' for headers, and '$(INSTALL)' for libs, although I don't see a reason not to use them consistently).
Oh, and shared libraries do not need to be +x, so -m 644 is enough.
package/ulog/ulog.mk line 41
Quoted 12 lines
package/ulog/ulog.mk new file +12
-0+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)
So, what happens with BR2_STATIC_LIBS=y? The .so would not exist in that case, would it? But then, this is what would be registered in the atom.mk...
And with BR2_STATIC_LIBS not set, then the .a should not be built (or at least not installed!), yet the installation of the static lib is unconditional (and see the first comment too).
It is difficult to understand if all of the static-shared combinations are supported, so could you please check/clarify this?
If the three combinations are indeed supported, then both the shared and the staic install macros should be conditional. Otherwise, proper guards should be added in the Config.in.
Those comments apply to all the pakcages in this series.
Regards,
Yann E. MORIN.
Quoted 10 lines
package/ulog/ulog.mk new file +3
-0+endef + +$(eval $(generic-package))Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v2 2/5] package/ulog: new package
Hi Yann,
Quoted 32 lines · On Sat, 1 Jan 2022 17:05:33 +0100 "Yann E. MORIN" <[email protected]>…
Hervé, All,
On 2021-11-12 14:12 +0100, Herve Codina spake thusly:
Quoted 6 lines
The ulog library is a minimalistic logging library derived from Android logger.
https://github.com/Parrot-Developers/ulog
Signed-off-by Herve Codina <[email protected]>[--SNIP--]
Quoted 22 lines
package/ulog/ulog.mk new file +16
-0@@ -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_ENV) \ + $(ALCHEMY_MAKE) libulog
Quoted 8 lines
package/ulog/ulog.mk line 21
Quoted 5 lines
package/ulog/ulog.mk new file +5
-0+endef + +define ULOG_INSTALL_STATIC_LIBS + $(INSTALL) -m 644 $(@D)/alchemy-out/staging/usr/lib/libulog.a $(1)/usr/lib/ +endefSo, it looks like you are always going to install the static library, but the package does not have: depends on !BR2_STATIC_LIBS
The v3 series will take care of BR2_STATIC_LIBS.
Quoted 15 lines
package/ulog/ulog.mk line 29
Quoted 9 lines
package/ulog/ulog.mk new file +8
-0+ +define ULOG_INSTALL_HEADERS + cp -Raf $(@D)/libulog/include/* $(1)/usr/include/ +endef + +ifeq ($(BR2_STATIC_LIBS),) +define ULOG_INSTALL_SHARED_LIBS + $(INSTALL) -m 755 $(@D)/alchemy-out/staging/usr/lib/libulog.so* $(1)/usr/lib/Although it is very improbable that the destination directory does not already exist, that is still a possibility, especially in target/. And for consistency with all the other packages, you must create the destination directory first before you start copying multiple files in there.
Will be fixed in v3
Quoted 6 lines
Also for consistency, use either 'cp' or '$(INSTALL)', not both , in the same .mk (you used 'cp' for headers, and '$(INSTALL)' for libs, although I don't see a reason not to use them consistently).
Oh, and shared libraries do not need to be +x, so -m 644 is enough.
Ok, I will use '$(INSTALL) -m 644 ' in v3 series
Quoted 17 lines
package/ulog/ulog.mk line 41
Quoted 13 lines
package/ulog/ulog.mk new file +12
-0+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)So, what happens with BR2_STATIC_LIBS=y? The .so would not exist in that case, would it? But then, this is what would be registered in the atom.mk...
The file passed to Alchemy must be the .so.
Internally, the static name will be deduced by replacing the shared suffix (.so) by the static suffix (.a)
Quoted 11 lines
And with
BR2_STATIC_LIBSnot set, then the .a should not be built (or at least not installed!), yet the installation of the static lib is unconditional (and see the first comment too).It is difficult to understand if all of the static-shared combinations are supported, so could you please check/clarify this?
If the three combinations are indeed supported, then both the shared and the staic install macros should be conditional. Otherwise, proper guards should be added in the Config.in.
In the next version (v3) of this series, I will install .a and .so according to flags set (BR2_{STATIC,SHARED}_LIBS).
I will have one exception: libshdata, libshdata-section-lookup.a. This static lib is needed to use libshdata and cannot be a shared library. It is forced as static in libshdata atom.mk file (include $(BUILD_STATIC_LIBRARY))
So, I choose to install it even if we supposed to be shared library only (ie BR2_SHARED_LIBS=y)
Quoted 3 lines
Those comments apply to all the pakcages in this series.
Thanks for the review,
Hervé
Signature · 7 lines
Hervé Codina, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 3/5 package/libfutils: new package
In reply to Herve CodinaThe libfutils library is a library that contains some common useful functions (list, hash, time).
https://github.com/Parrot-Developers/libfutils
---
Changes v1 -> v2
- 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
DEVELOPERS | 1 + package/Config.in | 1 + package/libfutils/Config.in | 15 ++++++++++ package/libfutils/libfutils.hash | 3 ++ package/libfutils/libfutils.mk | 50 ++++++++++++++++++++++++++++++++ 5 files changed, 70 insertions(+) create mode 100644 package/libfutils/Config.in create mode 100644 package/libfutils/libfutils.hash create mode 100644 package/libfutils/libfutils.mk
DEVELOPERS +1 -0
@@ -1153,6 +1153,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
package/Config.in +1 -0
@@ -1950,6 +1950,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"
package/libfutils/Config.in new file +15 -0
@@ -0,0 +1,15 @@ +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 + depends on BR2_TOOLCHAIN_HAS_ATOMIC
package/libfutils/libfutils.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed: +sha256 b38d40c46b83e448d8c1716ddfb04b7ecd384f5cd2cb773db5c26c0589accdb3 libfutils-c326ce0cc2a7354381265a7664bb215be587fac6.tar.gz +sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING
package/libfutils/libfutils.mk new file +50 -0
50 lines not on this page · raw message
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 4/5 package/libshdata: new package
In reply to Herve CodinaThe libshdata library provides lock free shared-memory tools.
https://github.com/Parrot-Developers/libshdata
---
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
DEVELOPERS +1 -0
@@ -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
package/Config.in +1 -0
@@ -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"
package/libshdata/0001-backend-Add-missing-include-files.patch new file +47 -0
47 lines not on this page · raw message
package/libshdata/Config.in new file +25 -0
@@ -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
package/libshdata/libshdata.hash new file +3 -0
@@ -0,0 +1,3 @@ +# Locally computed: +sha256 1ae83ac73c2b5b17c726067737b8d446b99f190e16fe6198eb464368796ecce3 libshdata-d9ec4bdba834d8f3daf6bf9aa6da374bc462961f.tar.gz +sha256 eca11a1c62fae8d64a1247d93271375baecff8396141d7ff8d89671ee7e3ed0d COPYING
package/libshdata/libshdata.mk new file +58 -0
58 lines not on this page · raw message
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v2 5/5 support/testing/tests/package/test_libshdata: new test
In reply to Herve CodinaThis 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.
---
Changed v1 -> v2:
none
DEVELOPERS | 1 + .../testing/tests/package/test_libshdata.py | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 support/testing/tests/package/test_libshdata.py
DEVELOPERS +1 -0
@@ -1158,6 +1158,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 <[email protected]>
support/testing/tests/package/test_libshdata.py new file +25 -0
@@ -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")
Signature · 6 lines
2.31.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot