From 57d73ec8e08e8cef1fe51665bd1ccfc5d53a6eeb Mon Sep 17 00:00:00 2001 From: Neal Frager Date: Mon, 17 Feb 2025 12:49:28 +0000 Subject: [PATCH] package/binutils-bare-metal: add multiple tuple support Add support to binutils-bare-metal to support multiple architecture tuples with the BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH string. To do this, custom configure, build and install commands are needed, so that each step goes through a loop of the architecture tuples in the list. To keep consistency with autotools, all the relevant host configurations have been copied into the HOST_BINUTILS_BARE_METAL_CONF_OPTS while removing any configurations that do not apply to binutils and removing redundant configs. autotools redundant configs covered by $(HOST_CONFIGURE_OPTS): CFLAGS="$$(HOST_CFLAGS)" LDFLAGS="$$(HOST_LDFLAGS)" autotools configs not applicable to binutils: --disable-gtk-doc --disable-gtk-doc-html --disable-doc --disable-docs --disable-documentation --disable-debug --with-xmlto=no --with-fop=no --disable-nls One of the configurations already in the binutils-bare-metal package was not needed. --enable-static -> handled by --disable-shared Signed-off-by: Neal Frager Signed-off-by: Arnout Vandecappelle --- .../binutils-bare-metal.mk | 36 +++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/package/binutils-bare-metal/binutils-bare-metal.mk b/package/binutils-bare-metal/binutils-bare-metal.mk index 3525e9fdf2..709d072765 100644 --- a/package/binutils-bare-metal/binutils-bare-metal.mk +++ b/package/binutils-bare-metal/binutils-bare-metal.mk @@ -22,13 +22,45 @@ HOST_BINUTILS_BARE_METAL_MAKE_OPTS += MAKEINFO=true HOST_BINUTILS_BARE_METAL_INSTALL_OPTS += MAKEINFO=true install HOST_BINUTILS_BARE_METAL_CONF_OPTS = \ - --target=$(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE) \ + --prefix=$(HOST_DIR) \ + --sysconfdir=$(HOST_DIR)/etc \ + --localstatedir=$(HOST_DIR)/var \ + $(if $$($$(PKG)_OVERRIDE_SRCDIR),,--disable-dependency-tracking) \ + $(QUIET) \ --disable-gprof \ --disable-shared \ --enable-lto \ - --enable-static \ --disable-initfini-array \ --disable-multilib \ --disable-werror +define HOST_BINUTILS_BARE_METAL_CONFIGURE_CMDS + $(foreach arch_tuple, $(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE), \ + mkdir -p $(@D)/build-$(arch_tuple) && \ + cd $(@D)/build-$(arch_tuple) && \ + $(HOST_CONFIGURE_OPTS) \ + $(HOST_BINUTILS_BARE_METAL_CONF_ENV) \ + CONFIG_SITE=/dev/null \ + $(@D)/configure \ + $(HOST_BINUTILS_BARE_METAL_CONF_OPTS) \ + --target=$(arch_tuple) + ) +endef + +define HOST_BINUTILS_BARE_METAL_BUILD_CMDS + $(foreach arch_tuple, $(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE), \ + $(HOST_MAKE_ENV) $(MAKE) \ + $(HOST_BINUTILS_BARE_METAL_MAKE_OPTS) \ + -C $(@D)/build-$(arch_tuple) + ) +endef + +define HOST_BINUTILS_BARE_METAL_INSTALL_CMDS + $(foreach arch_tuple, $(TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH_TUPLE), \ + $(HOST_MAKE_ENV) $(MAKE) \ + $(HOST_BINUTILS_BARE_METAL_INSTALL_OPTS) \ + -C $(@D)/build-$(arch_tuple) + ) +endef + $(eval $(host-autotools-package))