Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package
@ 2023-09-24 15:11 Neal Frager via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:11 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new package for building binutils for a bare-metal toolchain.
The cpu architecture is defined by a toolchain-bare-metal virtual package.
While any cpu architecture could be used, the default configuration will be a
Xilinx microblaze little endian architecture, so that buildroot will be able
to build the microblaze firmware applications for zynqmp and versal.

When configured for the Xilinx microblaze architecture, all of the binutils
patches that are applied to the Xilinx distributed toolchain will be applied
in order to generate a toolchain that is equivalent to what Xilinx distributes.

Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - removed default enable to be replaced with toolchain select config
V2->V3:
 - no changes
V3->V4:
 - split tar instruction into multiple lines
 - replaced unnecessary =? with = for assignments
 - changed xlnx-rel-v2023.1.tar.gz hash to sha256
 - improved menuconfig help comment
---
 DEVELOPERS                                    |  4 ++
 package/binutils-bare-metal/Config.in.host    | 12 ++++
 .../binutils-bare-metal.hash                  |  7 +++
 .../binutils-bare-metal.mk                    | 56 +++++++++++++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 package/binutils-bare-metal/Config.in.host
 create mode 100644 package/binutils-bare-metal/binutils-bare-metal.hash
 create mode 100644 package/binutils-bare-metal/binutils-bare-metal.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index e8b78a8d46..046f8f7874 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1350,6 +1350,9 @@ F:	package/mrp/
 N:	Ian Haylock <haylocki@yahoo.co.uk>
 F:	package/python-rpi-gpio/
 
+N:	Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
+F:	package/binutils-bare-metal/
+
 N:	Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
 F:	package/angularjs/
 
@@ -2178,6 +2181,7 @@ F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
+F:	package/binutils-bare-metal/
 F:	package/bootgen/
 F:	package/versal-firmware/
 
diff --git a/package/binutils-bare-metal/Config.in.host b/package/binutils-bare-metal/Config.in.host
new file mode 100644
index 0000000000..3a68c1e02d
--- /dev/null
+++ b/package/binutils-bare-metal/Config.in.host
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
+	bool "host binutils-bare-metal"
+	help
+	  Build GNU binutils for a bare-metal toolchain
+
+if BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
+
+config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION
+	string
+	default "2.39"
+
+endif #BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
diff --git a/package/binutils-bare-metal/binutils-bare-metal.hash b/package/binutils-bare-metal/binutils-bare-metal.hash
new file mode 100644
index 0000000000..c50443e837
--- /dev/null
+++ b/package/binutils-bare-metal/binutils-bare-metal.hash
@@ -0,0 +1,7 @@
+# From https://gcc.gnu.org/pub/binutils/releases/sha512.sum
+sha512  68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3  binutils-2.39.tar.xz
+
+# locally calculated
+sha256  5992ce6865468537b84372480f7593125db754f673dccae1ecf6d6a7c74ed88e  xlnx-rel-v2023.1.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING3
+sha256  56bdea73b6145ef6ac5259b3da390b981d840c24cb03b8e1cbc678de7ecfa18d  COPYING.LIB
diff --git a/package/binutils-bare-metal/binutils-bare-metal.mk b/package/binutils-bare-metal/binutils-bare-metal.mk
new file mode 100644
index 0000000000..de8ddcc9e9
--- /dev/null
+++ b/package/binutils-bare-metal/binutils-bare-metal.mk
@@ -0,0 +1,56 @@
+################################################################################
+#
+# binutils-bare-metal
+#
+################################################################################
+
+HOST_BINUTILS_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION))
+ifeq ($(HOST_BINUTILS_BARE_METAL_VERSION),)
+HOST_BINUTILS_BARE_METAL_VERSION = 2.39
+endif # BINUTILS_VERSION  
+
+HOST_BINUTILS_BARE_METAL_SITE = $(BR2_GNU_MIRROR)/binutils
+HOST_BINUTILS_BARE_METAL_SOURCE = binutils-$(HOST_BINUTILS_BARE_METAL_VERSION).tar.xz
+
+HOST_BINUTILS_BARE_METAL_LICENSE = GPL-3.0+, libiberty LGPL-2.1+
+HOST_BINUTILS_BARE_METAL_LICENSE_FILES = COPYING3 COPYING.LIB
+HOST_BINUTILS_BARE_METAL_CPE_ID_VENDOR = gnu
+
+HOST_BINUTILS_BARE_METAL_DEPENDENCIES = host-zlib
+
+# if toolchain is for microblazeel-xilinx, apply Xilinx patch set
+ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
+HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS = https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v2023.1.tar.gz
+
+define HOST_BINUTILS_BARE_METAL_EXTRACT_PATCHES
+  mkdir -p $(@D)/patches
+  tar -xf $(HOST_BINUTILS_BARE_METAL_DL_DIR)/xlnx-rel-v2023.1.tar.gz \
+      --strip-components=5 \
+      -C $(@D)/patches \
+      meta-xilinx-xlnx-rel-v2023.1/meta-microblaze/recipes-devtools/binutils/binutils
+endef
+HOST_BINUTILS_BARE_METAL_POST_EXTRACT_HOOKS += HOST_BINUTILS_BARE_METAL_EXTRACT_PATCHES
+
+define HOST_BINUTILS_BARE_METAL_APPLY_LOCAL_PATCHES
+	$(APPLY_PATCHES) $(@D) $(@D)/patches *.patch;
+endef
+HOST_BINUTILS_BARE_METAL_POST_PATCH_HOOKS += HOST_BINUTILS_BARE_METAL_APPLY_LOCAL_PATCHES
+endif #ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
+
+# Don't build documentation. It takes up extra space / build time,
+# and sometimes needs specific makeinfo versions to work
+HOST_BINUTILS_BARE_METAL_CONF_ENV += MAKEINFO=true
+HOST_BINUTILS_BARE_METAL_MAKE_OPTS += MAKEINFO=true
+HOST_BINUTILS_BARE_METAL_INSTALL_OPTS += MAKEINFO=true install
+
+HOST_BINUTILS_BARE_METAL_CONF_OPTS = \
+	--target=$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf \
+	--disable-gprof \
+	--disable-shared \
+	--enable-lto \
+	--enable-static \
+	--disable-initfini-array \
+	--disable-multilib \
+	--disable-werror
+
+$(eval $(host-autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-10-19  8:13 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-09-24 15:11 ` [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-09-24 15:11 ` [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-10-18 12:46     ` Frager, Neal via buildroot
2023-10-19  7:19       ` Luca Ceresoli via buildroot
     [not found]         ` <MN0PR12MB6004F504CD8806653C2D244BA0D4A@MN0PR12MB6004.namprd12.prod.outlook.com>
2023-10-19  8:13           ` Frager, Neal via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-10-16 10:11 ` [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Luca Ceresoli via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox