From: Arnout Vandecappelle <arnout@mind.be>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>, buildroot@buildroot.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [Buildroot] [PATCH] package/gnu-efi: fix build on mips64el
Date: Thu, 21 Apr 2022 21:19:35 +0200 [thread overview]
Message-ID: <414ce8aa-6d93-d64a-e605-7ec0a3e7b350@mind.be> (raw)
In-Reply-To: <20220415164947.13025-1-fontaine.fabrice@gmail.com>
On 15/04/2022 18:49, Fabrice Fontaine wrote:
> Drop -Werror to fix the following build failure on mips64el raised since
> commit 11b347c03ab0b38389ec11b48f63236a3b4d6547:
>
> /nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/dpath.c: In function 'FileDevicePath':
> /nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/../inc/efilink.h:145:46: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> 145 | #define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(intptr_t)(&(((TYPE *) 0)->Field)))
> | ^
> /nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/../inc/efidevp.h:404:38: note: in expansion of macro 'EFI_FIELD_OFFSET'
> 404 | #define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
> | ^~~~~~~~~~~~~~~~
> /nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/dpath.c:250:41: note: in expansion of macro 'SIZE_OF_FILEPATH_DEVICE_PATH'
> 250 | FilePath = AllocateZeroPool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + sizeof(EFI_DEVICE_PATH));
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Fixes:
> - http://autobuild.buildroot.org/results/d19e57004c36f2904c5eea988e0c38fbdb557c7e
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> .../0002-Make.defaults-drop-Werror.patch | 48 +++++++++++++++++++
> 1 file changed, 48 insertions(+)
> create mode 100644 package/gnu-efi/0002-Make.defaults-drop-Werror.patch
>
> diff --git a/package/gnu-efi/0002-Make.defaults-drop-Werror.patch b/package/gnu-efi/0002-Make.defaults-drop-Werror.patch
> new file mode 100644
> index 0000000000..79c847d178
> --- /dev/null
> +++ b/package/gnu-efi/0002-Make.defaults-drop-Werror.patch
> @@ -0,0 +1,48 @@
> +From 0e43bcb3876d4000790b0a6784453f333c1db701 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Fri, 15 Apr 2022 18:42:36 +0200
> +Subject: [PATCH] Make.defaults: drop -Werror
> +
> +Drop -Werror to avoid the following build failure on mips64el:
> +
> +/nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/dpath.c: In function 'FileDevicePath':
> +/nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/../inc/efilink.h:145:46: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> + 145 | #define EFI_FIELD_OFFSET(TYPE,Field) ((UINTN)(intptr_t)(&(((TYPE *) 0)->Field)))
Ignoring this warning seems like a dangerous fix. I guess UINTN is 32 bits but
intptr_t would be 64 bits on mips64, so the cast is possibly narrowing.
My first reaction was: upstream seems pretty dead, let's just disable it on
mips64. However, there seems to be a lot of active forks, and you just added
mips64 a couple of months ago...
So, I think it would be better to look for a better fix. Maybe one of the
myriad forks has it.
Regards,
Arnout
> + | ^
> +/nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/../inc/efidevp.h:404:38: note: in expansion of macro 'EFI_FIELD_OFFSET'
> + 404 | #define SIZE_OF_FILEPATH_DEVICE_PATH EFI_FIELD_OFFSET(FILEPATH_DEVICE_PATH,PathName)
> + | ^~~~~~~~~~~~~~~~
> +/nvmedata/autobuild/instance-9/output-1/build/gnu-efi-3.0.10//lib/dpath.c:250:41: note: in expansion of macro 'SIZE_OF_FILEPATH_DEVICE_PATH'
> + 250 | FilePath = AllocateZeroPool (Size + SIZE_OF_FILEPATH_DEVICE_PATH + sizeof(EFI_DEVICE_PATH));
> + | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/d19e57004c36f2904c5eea988e0c38fbdb557c7e
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status: not sent yet]
> +---
> + Make.defaults | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Make.defaults b/Make.defaults
> +index 47ed361..d43c3ff 100755
> +--- a/Make.defaults
> ++++ b/Make.defaults
> +@@ -168,11 +168,11 @@ ifneq (mingw32,$(findstring mingw32, $(GCCMACHINE)))
> + endif
> +
> + ifeq (FreeBSD, $(findstring FreeBSD, $(OS)))
> +-CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
> ++CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra \
> + -fshort-wchar -fno-strict-aliasing \
> + -ffreestanding -fno-stack-protector
> + else
> +-CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra -Werror \
> ++CFLAGS += $(ARCH3264) -g -O2 -Wall -Wextra \
> + -fshort-wchar -fno-strict-aliasing \
> + -ffreestanding -fno-stack-protector -fno-stack-check \
> + -fno-stack-check \
> +--
> +2.35.1
> +
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-04-21 19:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-15 16:49 [Buildroot] [PATCH] package/gnu-efi: fix build on mips64el Fabrice Fontaine
2022-04-21 19:19 ` Arnout Vandecappelle [this message]
2022-07-24 12:13 ` 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=414ce8aa-6d93-d64a-e605-7ec0a3e7b350@mind.be \
--to=arnout@mind.be \
--cc=buildroot@buildroot.org \
--cc=fontaine.fabrice@gmail.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.