diff mbox series

gnu-efi: Fix build on musl

Message ID 20230808165009.3282120-1-raj.khem@gmail.com
State New
Headers show
Series gnu-efi: Fix build on musl | expand

Commit Message

Khem Raj Aug. 8, 2023, 4:50 p.m. UTC
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.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../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

Comments

Alexander Kanavin Aug. 8, 2023, 4:56 p.m. UTC | #1
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

On Tue 8. Aug 2023 at 18.50, Khem Raj <raj.khem@gmail.com> wrote:

> 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.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  .../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
>
> diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
> b/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
> new file mode 100644
> index 00000000000..2d7ad740723
> --- /dev/null
> +++ b/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
> @@ -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 <raj.khem@gmail.com>
> +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 \
> diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
> b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
> index d37d638e097..819d376f9d9 100644
> --- a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
> +++ b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
> @@ -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: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
diff mbox series

Patch

diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch b/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
new file mode 100644
index 00000000000..2d7ad740723
--- /dev/null
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi/no-werror.patch
@@ -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 <raj.khem@gmail.com>
+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 \
diff --git a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
index d37d638e097..819d376f9d9 100644
--- a/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
+++ b/meta/recipes-bsp/gnu-efi/gnu-efi_3.0.17.bb
@@ -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"