Skip to contentSkip to conversation

gnu-efi: Fix build on musl

PATCH Superseded Khem Raj 2 participants 2 messages Aug 8, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 gnu-efi: Fix build on musl

Build with musl emits extra warnings about pointer incompatibility due to different type of wchar_t than glibc which turns to be error in the end, disable -Werror for musl.

---
 .../recipes-bsp/gnu-efi/gnu-efi/no-werror.patch | 17 +++++++++++++++++
 meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb      |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch new file +17 -0
new file mode 100644
index 00000000000..2d7ad740723
@@ -0,0 +1,17 @@
+Do not treat warnings as errors on musl
+
+There are additional warnings found with musl which may not be treated as errors
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Inappropriate [musl specific]
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -187,7 +187,7 @@ CFLAGS  += $(ARCH3264) -g -O2 -Wall -Wex
+            -funsigned-char -fshort-wchar -fno-strict-aliasing \
+            -ffreestanding -fno-stack-protector
+ else
+-CFLAGS  += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign -Werror \
++CFLAGS  += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign \
+            -funsigned-char -fshort-wchar -fno-strict-aliasing \
+ 	   -ffreestanding -fno-stack-protector -fno-stack-check \
+            -fno-stack-check \
meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb +1 -0
index d37d638e097..819d376f9d9 100644
@@ -18,6 +18,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \
            file://0001-riscv64-adjust-type-definitions.patch \
            file://0001-riscv64-ignore-unknown-relocs.patch \
            "
+SRC_URI:append:libc-musl = " file://no-werror.patch"
 
 SRC_URI[sha256sum] = "7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4"
 
Signature · 1 line
2.41.0
#1 lore raw

I think this doesn’t have to be musl specific, werror by default is a bad idea in general and conditional patches are a pain to maintain. Also it should be proposed upstream.

Alex

Quoted 66 lines · Khem Raj

Build with musl emits extra warnings about pointer incompatibility due to different type of wchar_t than glibc which turns to be error in the end, disable -Werror for musl.

---
 .../recipes-bsp/gnu-efi/gnu-efi/no-werror.patch | 17 +++++++++++++++++
 meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb      |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch new file +3 -0
new file mode 100644
index 00000000000..2d7ad740723
@@ -0,0 +1,17 @@
+Do not treat warnings as errors on musl
+
+There are additional warnings found with musl which may not be treated as

errors

meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch new file +14 -0
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream-Status: Inappropriate [musl specific]
+--- a/Make.defaults
++++ b/Make.defaults
+@@ -187,7 +187,7 @@ CFLAGS  += $(ARCH3264) -g -O2 -Wall -Wex
+            -funsigned-char -fshort-wchar -fno-strict-aliasing \
+            -ffreestanding -fno-stack-protector
+ else
+-CFLAGS  += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign -Werror \
++CFLAGS  += $(ARCH3264) -g -O2 -Wall -Wextra -Wno-pointer-sign \
+            -funsigned-char -fshort-wchar -fno-strict-aliasing \
+          -ffreestanding -fno-stack-protector -fno-stack-check \
+            -fno-stack-check \
meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb +1 -0
index d37d638e097..819d376f9d9 100644
@@ -18,6 +18,7 @@ SRC_URI =
 "${SOURCEFORGE_MIRROR}/${BPN}/files/${BP}.tar.bz2 \
            file://0001-riscv64-adjust-type-definitions.patch \
            file://0001-riscv64-ignore-unknown-relocs.patch \
            "
+SRC_URI:append:libc-musl = " file://no-werror.patch"
 
 SRC_URI[sha256sum] =

"7807e903349343a7a142ebb934703a2872235e89688cf586c032b0a1087bcaf4"

--
2.41.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#185671):
https://lists.openembedded.org/g/openembedded-core/message/185671
Mute This Topic: https://lists.openembedded.org/mt/100626020/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-