From: Herve Codina <herve.codina@bootlin.com>
To: buildroot@buildroot.org
Cc: "Hervé Codina" <herve.codina@bootlin.com>,
"Yann E . MORIN" <yann.morin.1998@free.fr>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH v3 1/5] package/alchemy: new host package
Date: Mon, 10 Jan 2022 15:50:03 +0100 [thread overview]
Message-ID: <20220110145007.133329-2-herve.codina@bootlin.com> (raw)
In-Reply-To: <20220110145007.133329-1-herve.codina@bootlin.com>
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>
---
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
diff --git a/DEVELOPERS b/DEVELOPERS
index cd0b54b041..79b33e9f22 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1187,6 +1187,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..33895263cc
--- /dev/null
+++ b/package/alchemy/alchemy.hash
@@ -0,0 +1,4 @@
+# Locally computed:
+sha256 346c06b9317691a9371d878b850e61f8bcec4f20132ac95340b9d2571be25ee8 alchemy-d95b3c38cd37814a1b98d0bbf813de7adaaecfbc.tar.gz
+sha256 542f44eecd9f8806ec1ae285201e442ab547c82d9f8c70e44c977d6332a2bea0 COPYING
+sha256 49872815ee3de163f07a83737c996e77a5bffa186d06b1e3bb969bfb68c251df README
diff --git a/package/alchemy/alchemy.mk b/package/alchemy/alchemy.mk
new file mode 100644
index 0000000000..33d40478b7
--- /dev/null
+++ b/package/alchemy/alchemy.mk
@@ -0,0 +1,71 @@
+################################################################################
+#
+# alchemy
+#
+################################################################################
+
+ALCHEMY_VERSION = d95b3c38cd37814a1b98d0bbf813de7adaaecfbc
+ALCHEMY_SITE = $(call github,Parrot-Developers,alchemy,$(ALCHEMY_VERSION))
+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
+ mkdir -p $(ALCHEMY_HOME)
+ cp -rf $(@D)/* $(ALCHEMY_HOME)
+ cp $(HOST_ALCHEMY_PKGDIR)/atom.mk.in $(ALCHEMY_HOME)/atom.mk.in
+endef
+
+$(eval $(host-generic-package))
+
+# Variables used by other packages
+
+ALCHEMY_MAKE = $(ALCHEMY_HOME)/scripts/alchemake
+
+# TARGET_ARCH is set to 'xxx' to avoid Alchemy managing the architecture.
+# When Alchemy manages the architecture, it can add some flags to CFGLAGS and
+# can lead to incorrect result with the toolchain provided in TARGET_CROSS.
+# 'xxx' is an unknown architecture for Alchemy. Using this value is a simple
+# way to disable the Alchemy architecture management.
+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 \
+ 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_ENV += \
+ TARGET_FORCE_STATIC=1 \
+ TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS)"
+else
+ALCHEMY_TARGET_ENV += \
+ TARGET_GLOBAL_CFLAGS="$(TARGET_CFLAGS) -fPIC"
+endif
+
+# 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
+# $4: Alchemy module libraries this module depends on
+define ALCHEMY_INSTALL_LIB_SDK_FILE
+ $(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))#' \
+ -e 's#@LIBRARIES@#$(strip $(4))#' \
+ $(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..084ae0e89f
--- /dev/null
+++ b/package/alchemy/atom.mk.in
@@ -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)
--
2.33.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-01-10 14:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 14:50 [Buildroot] [PATCH v3 0/5] Add Alchemy build system and some related libs Herve Codina
2022-01-10 14:50 ` Herve Codina [this message]
2022-01-10 14:50 ` [Buildroot] [PATCH v3 2/5] package/ulog: new package Herve Codina
2022-01-10 14:50 ` [Buildroot] [PATCH v3 3/5] package/libfutils: " Herve Codina
2022-01-10 14:50 ` [Buildroot] [PATCH v3 4/5] package/libshdata: " Herve Codina
2022-01-10 14:50 ` [Buildroot] [PATCH v3 5/5] support/testing/tests/package/test_libshdata: new test Herve Codina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220110145007.133329-2-herve.codina@bootlin.com \
--to=herve.codina@bootlin.com \
--cc=buildroot@buildroot.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox