From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Baruch Siach <baruch@tkos.co.il>
Cc: buildroot@busybox.net
Subject: Re: [Buildroot] [PATCH] boot/mv-ddr-marvell: fix build with gcc 12
Date: Sat, 12 Aug 2023 16:23:59 +0200 [thread overview]
Message-ID: <20230812142359.GM421096@scaer> (raw)
In-Reply-To: <d4e505a059b4d69ab3d54b1aa034e877066a155b.1691743703.git.baruch@tkos.co.il>
Baruch, All,
On 2023-08-11 11:48 +0300, Baruch Siach via buildroot spake thusly:
> gcc 12 added a warning that triggers on access to low addresses. Add a
> patch to allow access since this is normal for low level code.
>
> Rebase our existing patch on top. While at it, add also a proper
> Upstream tag.
>
> Fixes:
> https://gitlab.com/buildroot.org/buildroot/-/jobs/4795673785
>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Applied to master, thanks.
Regards,
Yann E. MORIN.
> ---
> .checkpackageignore | 1 -
> ...-access-to-low-addresses-with-gcc-12.patch | 49 +++++++++++++++++++
> ...2-Makefile-disable-stack-protection.patch} | 11 ++---
> 3 files changed, 54 insertions(+), 7 deletions(-)
> create mode 100644 boot/mv-ddr-marvell/0001-Allow-access-to-low-addresses-with-gcc-12.patch
> rename boot/mv-ddr-marvell/{0001-Makefile-disable-stack-protection.patch => 0002-Makefile-disable-stack-protection.patch} (80%)
>
> diff --git a/.checkpackageignore b/.checkpackageignore
> index 627b0cc92b52..dfc1ba900194 100644
> --- a/.checkpackageignore
> +++ b/.checkpackageignore
> @@ -108,7 +108,6 @@ boot/at91dataflashboot/0001-do-not-install.patch Upstream
> boot/at91dataflashboot/0002-eabi-fixes.patch Upstream
> boot/grub2/0001-Makefile-Make-grub_fstest.pp-depend-on-config-util.h.patch Upstream
> boot/grub2/0002-grub-mkconfig-Restore-umask-for-the-grub.cfg.patch Upstream
> -boot/mv-ddr-marvell/0001-Makefile-disable-stack-protection.patch Upstream
> boot/optee-os/3.13.0/0001-core-zlib-fix-build-warning-when-_LFS64_LARGEFILE-is.patch Upstream
> boot/syslinux/0001-bios-Fix-alignment-change-with-gcc-5.patch Upstream
> boot/syslinux/0002-Disable-PIE-to-avoid-FTBFS-on-amd64.patch Upstream
> diff --git a/boot/mv-ddr-marvell/0001-Allow-access-to-low-addresses-with-gcc-12.patch b/boot/mv-ddr-marvell/0001-Allow-access-to-low-addresses-with-gcc-12.patch
> new file mode 100644
> index 000000000000..5a623f28f95d
> --- /dev/null
> +++ b/boot/mv-ddr-marvell/0001-Allow-access-to-low-addresses-with-gcc-12.patch
> @@ -0,0 +1,49 @@
> +From 4796a1eacc6a5ccb623e7d2e46a5196f8335e496 Mon Sep 17 00:00:00 2001
> +From: Baruch Siach <baruch@tkos.co.il>
> +Date: Fri, 11 Aug 2023 11:19:49 +0300
> +Subject: [PATCH] Allow access to low addresses with gcc 12
> +
> +gcc 12 added a warning that triggers on access to low addresses. Add a
> +compile option that allows access to lower addresses.
> +
> +Add the 'cc_option' macro to avoid the compile option when the compiler
> +does not support it.
> +
> +This fixes build with TF-A. TF-A added a similar fix in commit
> +dea23e245fb89.
> +
> +See some more details in
> +https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
> +
> +Upstream: https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/42
> +Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> +---
> + Makefile | 5 +++++
> + 1 file changed, 5 insertions(+)
> +
> +diff --git a/Makefile b/Makefile
> +index 3f0dd89a7381..045284c30cbc 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -108,6 +108,10 @@ MV_DDR_VER_CSRC = mv_ddr_build_message.c
> + # create mv_ddr build message and version string source file
> + $(shell $(MV_DDR_ROOT)/scripts/localversion.sh $(MV_DDR_ROOT) $(MV_DDR_VER_CSRC) 2> /dev/null)
> +
> ++define cc_option
> ++ $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/null 2>&1; then echo $(1); fi )
> ++endef
> ++
> + # ******************
> + # U-BOOT SPL SUPPORT
> + # ******************
> +@@ -331,6 +335,7 @@ OBJ_DIR ?= $(MV_DDR_ROOT)
> + CFLAGS = -DMV_DDR_ATF -DCONFIG_DDR4
> + CFLAGS += -Wall -Werror -Os -ffreestanding -mlittle-endian -g -gdwarf-2 -nostdinc
> + CFLAGS += -march=armv8-a -fpie
> ++CFLAGS += $(call cc_option, --param=min-pagesize=0)
> +
> + # PLATFORM is set in ble/ble.mk
> + ifneq ($(findstring a80x0,$(PLATFORM)),)
> +--
> +2.40.1
> +
> diff --git a/boot/mv-ddr-marvell/0001-Makefile-disable-stack-protection.patch b/boot/mv-ddr-marvell/0002-Makefile-disable-stack-protection.patch
> similarity index 80%
> rename from boot/mv-ddr-marvell/0001-Makefile-disable-stack-protection.patch
> rename to boot/mv-ddr-marvell/0002-Makefile-disable-stack-protection.patch
> index 62b1000727f8..626279eb4714 100644
> --- a/boot/mv-ddr-marvell/0001-Makefile-disable-stack-protection.patch
> +++ b/boot/mv-ddr-marvell/0002-Makefile-disable-stack-protection.patch
> @@ -10,25 +10,24 @@ routines.
> The mv-ddr-marvell Makefile provides no way to add custom CFLAGS. Patch
> Makefile to disable stack protection.
>
> +Upstream: not applicable; Buildroot specific
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ----
> -Upstream status: not applicable; Buildroot specific
> ---
> Makefile | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> -index 3f0dd89a7381..feae75cc16e4 100644
> +index 045284c30cbc..9641354bcf86 100644
> --- a/Makefile
> +++ b/Makefile
> -@@ -331,6 +331,7 @@ OBJ_DIR ?= $(MV_DDR_ROOT)
> - CFLAGS = -DMV_DDR_ATF -DCONFIG_DDR4
> +@@ -336,6 +336,7 @@ CFLAGS = -DMV_DDR_ATF -DCONFIG_DDR4
> CFLAGS += -Wall -Werror -Os -ffreestanding -mlittle-endian -g -gdwarf-2 -nostdinc
> CFLAGS += -march=armv8-a -fpie
> + CFLAGS += $(call cc_option, --param=min-pagesize=0)
> +CFLAGS += -fno-stack-protector
>
> # PLATFORM is set in ble/ble.mk
> ifneq ($(findstring a80x0,$(PLATFORM)),)
> --
> -2.35.1
> +2.40.1
>
> --
> 2.40.1
>
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2023-08-12 14:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-11 8:48 [Buildroot] [PATCH] boot/mv-ddr-marvell: fix build with gcc 12 Baruch Siach via buildroot
2023-08-12 14:23 ` Yann E. MORIN [this message]
2023-09-12 6:22 ` Peter Korsgaard
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=20230812142359.GM421096@scaer \
--to=yann.morin.1998@free.fr \
--cc=baruch@tkos.co.il \
--cc=buildroot@busybox.net \
/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