All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Neal Frager via buildroot <buildroot@buildroot.org>
Cc: michal.simek@amd.com, ibai.erkiaga-elorza@amd.com,
	luca.ceresoli@bootlin.com, Neal Frager <neal.frager@amd.com>
Subject: Re: [Buildroot] [PATCH v6 02/10] package/gcc-bare-metal: new package
Date: Tue, 31 Oct 2023 13:41:52 +0100	[thread overview]
Message-ID: <20231031134152.792af099@windsurf> (raw)
In-Reply-To: <20231020114236.4129636-2-neal.frager@amd.com>

Hello,

On Fri, 20 Oct 2023 12:42:28 +0100
Neal Frager via buildroot <buildroot@buildroot.org> wrote:

> diff --git a/package/gcc-bare-metal/Config.in.host b/package/gcc-bare-metal/Config.in.host
> new file mode 100644
> index 0000000000..ca7735340c
> --- /dev/null
> +++ b/package/gcc-bare-metal/Config.in.host
> @@ -0,0 +1,12 @@
> +config BR2_PACKAGE_HOST_GCC_BARE_METAL
> +	bool "host gcc-bare-metal"
> +	help
> +	  Build GCC for a bare-metal toolchain
> +
> +if BR2_PACKAGE_HOST_GCC_BARE_METAL
> +
> +config BR2_PACKAGE_HOST_GCC_BARE_METAL_VERSION
> +	string
> +	default "13.2.0"

Both of these options are useless, they should be dropped.


> diff --git a/package/gcc-bare-metal/gcc-bare-metal.hash b/package/gcc-bare-metal/gcc-bare-metal.hash
> new file mode 100644
> index 0000000000..5c5c28fa7e
> --- /dev/null
> +++ b/package/gcc-bare-metal/gcc-bare-metal.hash

Symlink to package/gcc/gcc.hash ?


> diff --git a/package/gcc-bare-metal/gcc-bare-metal.mk b/package/gcc-bare-metal/gcc-bare-metal.mk
> new file mode 100644
> index 0000000000..fe6f931008
> --- /dev/null
> +++ b/package/gcc-bare-metal/gcc-bare-metal.mk
> @@ -0,0 +1,68 @@
> +################################################################################
> +#
> +# gcc-bare-metal
> +#
> +################################################################################
> +
> +HOST_GCC_BARE_METAL_VERSION = \
> +	$(call qstrip,$(BR2_PACKAGE_HOST_GCC_BARE_METAL_VERSION))
> +ifeq ($(HOST_GCC_BARE_METAL_VERSION),)
> +HOST_GCC_BARE_METAL_VERSION = 13.2.0
> +endif

Just harcode the version.

> +
> +HOST_GCC_BARE_METAL_SITE = \
> +	https://ftp.gnu.org/gnu/gcc/gcc-$(HOST_GCC_BARE_METAL_VERSION)
> +HOST_GCC_BARE_METAL_SOURCE = gcc-$(HOST_GCC_BARE_METAL_VERSION).tar.xz
> +
> +HOST_GCC_BARE_METAL_LICENSE = GPL-2.0, GPL-3.0, LGPL-2.1, LGPL-3.0
> +HOST_GCC_BARE_METAL_LICENSE_FILES = COPYING COPYING3 COPYING.LIB COPYING3.LIB
> +
> +HOST_GCC_BARE_METAL_DEPENDENCIES = \
> +	host-binutils-bare-metal \
> +	host-gmp \
> +	host-mpc \
> +	host-mpfr \
> +	host-isl
> +
> +# gcc doesn't support in-tree build, so we create a 'build'
> +# subdirectory in the gcc sources, and build from there.
> +define GCC_BARE_METAL_CONFIGURE_SYMLINK
> +	mkdir -p $(@D)/build
> +	ln -sf ../configure $(@D)/build/configure
> +endef
> +
> +HOST_GCC_BARE_METAL_PRE_CONFIGURE_HOOKS += GCC_BARE_METAL_CONFIGURE_SYMLINK
> +HOST_GCC_BARE_METAL_SUBDIR = build
> +
> +HOST_GCC_BARE_METAL_MAKE_OPTS = \
> +	$(HOST_GCC_COMMON_MAKE_OPTS) \
> +	all-gcc \
> +	all-target-libgcc
> +
> +HOST_GCC_BARE_METAL_INSTALL_OPTS = install-gcc install-target-libgcc
> +
> +GCC_BARE_METAL_ARCH = \
> +	$(call qstrip,$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH))

From a patch sequencing perspective, this is a bit weird because
BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH does not even
exist yet. But I don't have a very good suggestion on how to handle
this, so it's fine as is.

Should the variable be named HOST_GCC_BARE_METAL_ARCH, for consistency
with the other variables?

> +HOST_GCC_BARE_METAL_CONF_OPTS = \
> +	--target=$(GCC_BARE_METAL_ARCH)-elf \

I'm wondering if BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH
shouldn't be the full tuple, instead of assuming it's also going to end
in -elf. Whenever we've assumed things like this, it sometimes turned
out to be wrong. So I would suggest that
BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH carry the full
tuple instead.

> +	--disable-initfini_array \
> +	--disable-__cxa_atexit \
> +	--disable-libstdcxx-pch \
> +	--with-newlib \
> +	--disable-threads \
> +	--enable-plugins \
> +	--with-gnu-as \
> +	--disable-libitm \
> +	--without-long-double-128 \
> +	--without-headers \
> +	--enable-languages=c \
> +	--disable-multilib \
> +	--with-gmp=$(HOST_DIR) \
> +	--with-mpc=$(HOST_DIR) \
> +	--with-mpfr=$(HOST_DIR) \
> +	--with-isl=$(HOST_DIR) \
> +	AR_FOR_TARGET=$(O)/host/bin/$(GCC_BARE_METAL_ARCH)-elf-ar \
> +	RANLIB_FOR_TARGET=$(O)/host/bin/$(GCC_BARE_METAL_ARCH)-elf-ranlib

$(HOST_DIR) instead of $(O)/host/bin

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-10-31 12:42 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 11:42 [Buildroot] [PATCH v6 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
2023-10-26 16:06   ` Luca Ceresoli via buildroot
2023-10-31 12:41   ` Thomas Petazzoni via buildroot [this message]
2023-10-20 11:42 ` [Buildroot] [PATCH v6 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-31 12:43   ` Thomas Petazzoni via buildroot
2023-11-01 11:43     ` Frager, Neal via buildroot
2023-11-01 11:50       ` Thomas Petazzoni via buildroot
2023-11-01 13:23         ` Frager, Neal via buildroot
2023-11-01 13:42           ` Yann E. MORIN
2023-11-02  9:35             ` Frager, Neal via buildroot
2023-11-02  9:37               ` Thomas Petazzoni via buildroot
2023-11-02 10:27                 ` Frager, Neal via buildroot
2023-11-14  5:47             ` Frager, Neal via buildroot
2023-11-15 18:12               ` Yann E. MORIN
2023-11-16 10:20                 ` Frager, Neal via buildroot
2023-11-16 11:32                   ` Frager, Neal via buildroot
2023-10-31 12:52   ` Thomas Petazzoni via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 04/10] toolchain/toolchain-bare-metal-buildroot: new toolchain Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-31 12:51   ` Thomas Petazzoni via buildroot
2023-11-02  9:47     ` Frager, Neal via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-31 12:54   ` Thomas Petazzoni via buildroot
2023-10-31 19:07     ` Frager, Neal via buildroot
2023-11-01  9:24       ` Thomas Petazzoni via buildroot
2023-11-01 10:18         ` Frager, Neal via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
2023-10-26 16:07   ` Luca Ceresoli via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
2023-10-26 16:08   ` Luca Ceresoli via buildroot
2023-10-31 12:57   ` Thomas Petazzoni via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
2023-10-26 16:08   ` Luca Ceresoli via buildroot
2023-10-20 11:42 ` [Buildroot] [PATCH v6 10/10] package/versal-firmware: remove package Neal Frager via buildroot
2023-10-26 16:08   ` Luca Ceresoli via buildroot
2023-10-26 11:59 ` [Buildroot] [PATCH v6 01/10] package/binutils-bare-metal: new package Frager, Neal via buildroot
2023-10-26 16:06 ` Luca Ceresoli via buildroot
2023-10-31  7:32   ` Frager, Neal via buildroot
2023-10-31 12:37 ` Thomas Petazzoni via buildroot

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=20231031134152.792af099@windsurf \
    --to=buildroot@buildroot.org \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.