Skip to contentSkip to conversation

package/gnu-efi: fix build on mips64el

PATCH In review Fabrice Fontaine 3 participants 3 messages Apr 15, 2022 – Jul 24, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gnu-efi: fix build on mips64el

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

---
 .../0002-Make.defaults-drop-Werror.patch      | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/gnu-efi/0002-Make.defaults-drop-Werror.patch
package/gnu-efi/0002-Make.defaults-drop-Werror.patch new file +48 -0
new file mode 100644
index 0000000000..79c847d178
@@ -0,0 +1,48 @@
+From 0e43bcb3876d4000790b0a6784453f333c1db701 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+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)))
+      |                                              ^
+/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 <[email protected]>
+[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
+
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 29 lines · Fabrice Fontaine

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

---
  .../0002-Make.defaults-drop-Werror.patch      | 48 +++++++++++++++++++
  1 file changed, 48 insertions(+)

create mode 100644 package/gnu-efi/0002-Make.defaults-drop-Werror.patch

package/gnu-efi/0002-Make.defaults-drop-Werror.patch new file +0 -0
new file mode 100644
index 0000000000..79c847d178

package/gnu-efi/0002-Make.defaults-drop-Werror.patch line 10

Quoted 10 lines
package/gnu-efi/0002-Make.defaults-drop-Werror.patch new file +10 -0
@@ -0,0 +1,48 @@
+From 0e43bcb3876d4000790b0a6784453f333c1db701 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+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

Quoted 28 lines
package/gnu-efi/0002-Make.defaults-drop-Werror.patch new file +28 -0
+      |                                              ^
+/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 <[email protected]>
+[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 \

package/gnu-efi/0002-Make.defaults-drop-Werror.patch line 48

Quoted 10 lines
package/gnu-efi/0002-Make.defaults-drop-Werror.patch new file +10 -0
+            -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
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw
In reply to Fabrice Fontaine

Hello Fabrice,

Quoted 14 lines · On Fri, 15 Apr 2022 18:49:47 +0200 Fabrice Fontaine…

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));
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Quoted 8 lines

Fixes:
- http://autobuild.buildroot.org/results/d19e57004c36f2904c5eea988e0c38fbdb557c7e

---
 .../0002-Make.defaults-drop-Werror.patch      | 48 +++++++++++++++++++
 1 file changed, 48 insertions(+)
 create mode 100644 package/gnu-efi/0002-Make.defaults-drop-Werror.patch

For some reason, this issue no longer appeared recently in the autobuilders. There was another issue, which got fixed by the bump to 3.0.14, and gnu-efi no longer appears in the autobuilder failures.

So I've marked this patch as Superseded, we can revisit later if it turns out to still be needed.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot