Add Alchemy build system and some related libs
v3 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.
This v3 series takes care of the Yann Morin's review.
Changes v2->v3 are detailed in each patch.
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/alchemy/atom.mk.in | 8 ++ package/libfutils/Config.in | 15 ++++ package/libfutils/libfutils.hash | 3 + package/libfutils/libfutils.mk | 56 ++++++++++++++ ...01-backend-Add-missing-include-files.patch | 47 ++++++++++++ ...stress_test-Fix-build-with-musl-libc.patch | 34 +++++++++ package/libshdata/Config.in | 29 +++++++ package/libshdata/libshdata.hash | 3 + package/libshdata/libshdata.mk | 75 +++++++++++++++++++ package/ulog/Config.in | 12 +++ package/ulog/ulog.hash | 3 + package/ulog/ulog.mk | 50 +++++++++++++ .../testing/tests/package/test_libshdata.py | 25 +++++++ 18 files changed, 479 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/alchemy/atom.mk.in 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/0002-examples-stress_test-Fix-build-with-musl-libc.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.33.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 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
Changes v2 -> v3
- Introduced atom.mk.in as suggested by Yann
- Added LIBRARIES in atom.mk.in to set Alchemy dependencies chain. This is needed to have a complete .a file list for the link command in case of static lib only.
DEVELOPERS | 1 + ...lchains-remove-hash-style-management.patch | 36 ++++++++++ package/alchemy/alchemy.hash | 4 ++ package/alchemy/alchemy.mk | 71 +++++++++++++++++++ package/alchemy/atom.mk.in | 8 +++ 5 files changed, 120 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/alchemy/atom.mk.in
DEVELOPERS +1 -0
@@ -1187,6 +1187,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 +71 -0
71 lines not on this page · raw message
package/alchemy/atom.mk.in new file +8 -0
@@ -0,0 +1,8 @@ +LOCAL_PATH := $(call my-dir) +include $(CLEAR_VARS) +LOCAL_MODULE := @MODULE@ +LOCAL_SDK := @STAGING_DIR@ +LOCAL_DESTDIR := usr/lib +LOCAL_MODULE_FILENAME := @MODULE_FILENAME@ +LOCAL_LIBRARIES := @LIBRARIES@ +include $(BUILD_LIBRARY)
Signature · 6 lines
2.33.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 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
Changes v2 -> v3
- Installed .a files when needed (ie not shared lib only)
- Used $(INSTALL) in all installation commands
- Created installation directories when needed
DEVELOPERS | 1 + package/Config.in | 1 + package/ulog/Config.in | 12 ++++++++++ package/ulog/ulog.hash | 3 +++ package/ulog/ulog.mk | 50 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 67 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
@@ -1197,6 +1197,7 @@ F: package/php-apcu/ F: package/php-lua/ F: package/php-pam/ F: package/php-pecl-dbus/ +F: package/ulog/ F: support/testing/tests/package/test_dtbocfg.py F: support/testing/tests/package/test_lua_augeas.py F: support/testing/tests/package/test_php_apcu.py
package/Config.in +1 -0
@@ -1738,6 +1738,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 +50 -0
50 lines not on this page · raw message
Signature · 6 lines
2.33.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 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
Changes v2 -> v3
- Installed .a files when needed (ie not shared lib only)
- Used $(INSTALL) in all installation commands
- Created installation directories when needed
- Fixed dependencies chain in Alchemy atom.mk
DEVELOPERS | 1 + package/Config.in | 1 + package/libfutils/Config.in | 15 +++++++++ package/libfutils/libfutils.hash | 3 ++ package/libfutils/libfutils.mk | 56 ++++++++++++++++++++++++++++++++ 5 files changed, 76 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
@@ -1191,6 +1191,7 @@ F: package/alchemy/ F: package/dtbocfg/ F: package/libdbi/ F: package/libdbi-drivers/ +F: package/libfutils/ F: package/lua-augeas/ F: package/modsecurity2/ F: package/php-apcu/
package/Config.in +1 -0
@@ -1986,6 +1986,7 @@ menu "Other" source "package/libevent/Config.in" source "package/libexecinfo/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 +56 -0
56 lines not on this page · raw message
Signature · 6 lines
2.33.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 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
Changed v2 -> v3:
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
@@ -1201,6 +1201,7 @@ F: package/php-pam/ F: package/php-pecl-dbus/ 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 F: support/testing/tests/package/test_php_apcu.py F: support/testing/tests/package/test_php_lua.py
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.33.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 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
libshdata-stress utility does not compile using static libs only (BR2_STATIC_LIBS=y). The issue was raised upstream:
https://github.com/Parrot-Developers/libshdata/issues/2
For now, libshdata-stress simply depends on !BR2_STATIC_LIBS.
---
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
Changes v2 -> v3
- Installed .a files when needed (ie not shared lib only)
- Used $(INSTALL) in all installation commands
- Created installation directories when needed
- Added ulog as buildroot package dependency and fixed the dependencies chain in Alchemy atom.mk
- Added 0002-examples-stress_test-Fix-build-with-musl-libc.patch
- Added 'depends on !BR2_STATIC_LIBS' for libshdata-stress
DEVELOPERS | 1 + package/Config.in | 1 + ...01-backend-Add-missing-include-files.patch | 47 ++++++++++++ ...stress_test-Fix-build-with-musl-libc.patch | 37 +++++++++ package/libshdata/Config.in | 30 ++++++++ package/libshdata/libshdata.hash | 3 + package/libshdata/libshdata.mk | 75 +++++++++++++++++++ 7 files changed, 194 insertions(+) create mode 100644 package/libshdata/0001-backend-Add-missing-include-files.patch create mode 100644 package/libshdata/0002-examples-stress_test-Fix-build-with-musl-libc.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
@@ -1192,6 +1192,7 @@ F: package/dtbocfg/ F: package/libdbi/ F: package/libdbi-drivers/ F: package/libfutils/ +F: package/libshdata/ F: package/lua-augeas/ F: package/modsecurity2/ F: package/php-apcu/
package/Config.in +1 -0
@@ -2030,6 +2030,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/0002-examples-stress_test-Fix-build-with-musl-libc.patch new file +37 -0
@@ -0,0 +1,37 @@ +From ddded7337812a2797d31f276624da98932d8e17f Mon Sep 17 00:00:00 2001 +From: Herve Codina <[email protected]> +Date: Sun, 9 Jan 2022 14:59:27 +0100 +Subject: [PATCH] examples/stress_test: Fix build with musl libc + +The musl C library uses sched_priority instead of +__sched_priority as GNU libc and uClibc do. +Use sched_priority instead. + +This does not break compilation with GNU libc and uClibc +because they both define in sched.h: + #define sched_priority __sched_priority + +This patch was submitted upstream. +https://github.com/Parrot-Developers/libshdata/issues/3 + +Signed-off-by: Herve Codina <[email protected]> +--- + examples/stress_test.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/examples/stress_test.c b/examples/stress_test.c +index a859115..cfb5418 100644 +--- a/examples/stress_test.c ++++ b/examples/stress_test.c +@@ -617,7 +617,7 @@ static void launch_test(int timer_fd, struct test_setup *setup) + if (ret < 0) + ULOGI("Error setting the timer : %s", strerror(errno)); + struct sched_param sched_params; +- sched_params.__sched_priority = sched_get_priority_max(SCHED_RR); ++ sched_params.sched_priority = sched_get_priority_max(SCHED_RR); + + pid_t pid = fork(); + +-- +2.33.1 +
package/libshdata/Config.in new file +30 -0
@@ -0,0 +1,30 @@ +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 + select BR2_PACKAGE_ULOG + 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" + depends on !BR2_STATIC_LIBS + help + Install libshdata-stress binary as well + +comment "libshdata-stress needs a toolchain w/ dynamic library" + depends on BR2_STATIC_LIBS + +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 +75 -0
75 lines not on this page · raw message
Signature · 6 lines
2.33.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot