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

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
[yann.morin.1998@free.fr: implicit package name with $($(PKG)_NAME)]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Herve Codina 2022-01-10 15:50:03 +01:00 committed by Yann E. MORIN
parent 24d07fdc14
commit 7f1f3f8786
5 changed files with 119 additions and 0 deletions

View File

@ -1190,6 +1190,7 @@ F: package/netopeer2/
F: package/sysrepo/
N: Hervé Codina <herve.codina@bootlin.com>
F: package/alchemy/
F: package/dtbocfg/
F: package/libdbi/
F: package/libdbi-drivers/

View File

@ -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

View File

@ -0,0 +1,4 @@
# Locally computed:
sha256 346c06b9317691a9371d878b850e61f8bcec4f20132ac95340b9d2571be25ee8 alchemy-d95b3c38cd37814a1b98d0bbf813de7adaaecfbc.tar.gz
sha256 542f44eecd9f8806ec1ae285201e442ab547c82d9f8c70e44c977d6332a2bea0 COPYING
sha256 49872815ee3de163f07a83737c996e77a5bffa186d06b1e3bb969bfb68c251df README

View File

@ -0,0 +1,70 @@
################################################################################
#
# 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: Alchemy module name
# $2: Alchemy module file name
# $3: 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)/$($(PKG)_NAME)/atom.mk
$(SED) 's#@STAGING_DIR@#$(STAGING_DIR)#' \
-e 's#@MODULE@#$(strip $(1))#' \
-e 's#@MODULE_FILENAME@#$(strip $(2))#' \
-e 's#@LIBRARIES@#$(strip $(3))#' \
$(ALCHEMY_SDK_BASEDIR)/$($(PKG)_NAME)/atom.mk
endef

View File

@ -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)