All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/libkcapi: disable -Werror
@ 2022-11-07 22:41 Fabrice Fontaine
  2022-11-08 13:26 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Fabrice Fontaine @ 2022-11-07 22:41 UTC (permalink / raw)
  To: buildroot; +Cc: Tan En De, Fabrice Fontaine

Fix the following musl build failure (disabling -Werror seems to be the
only "solution": https://github.com/smuellerDD/libkcapi/issues/136):

lib/kcapi-kernel-if.c: In function '_kcapi_common_send_meta':
lib/kcapi-kernel-if.c:212:12: error: unsigned conversion from 'long int' to 'long unsigned int' changes value from '-4' to '4294967292' [-Werror=sign-conversion]
  212 |   header = CMSG_NXTHDR(&msg, header);
      |            ^~~~~~~~~~~

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

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 .../libkcapi/0002-Add-disable-werror.patch    | 46 +++++++++++++++++++
 package/libkcapi/libkcapi.mk                  |  1 +
 2 files changed, 47 insertions(+)
 create mode 100644 package/libkcapi/0002-Add-disable-werror.patch

diff --git a/package/libkcapi/0002-Add-disable-werror.patch b/package/libkcapi/0002-Add-disable-werror.patch
new file mode 100644
index 0000000000..4f2f55f145
--- /dev/null
+++ b/package/libkcapi/0002-Add-disable-werror.patch
@@ -0,0 +1,46 @@
+From c27b154f03ad7e94447c7114d73aee60f0098093 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 7 Nov 2022 13:38:06 +0100
+Subject: [PATCH] Add --disable-werror
+
+Allow the user to disable -Werror through --disable-werror
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Signed-off-by: Stephan Mueller <smueller@chronox.de>
+[Retrieved from:
+https://github.com/smuellerDD/libkcapi/commit/c27b154f03ad7e94447c7114d73aee60f0098093]
+---
+ Makefile.am  | 5 ++++-
+ configure.ac | 3 +++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index 1c95d3d..cddedac 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,7 +2,10 @@ ACLOCAL_AMFLAGS = -I m4
+ AUTOMAKE_OPTIONS = subdir-objects
+ lib_LTLIBRARIES = libkcapi.la
+ 
+-COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param ssp-buffer-size=4 -O2 -Werror -std=gnu99 -Wconversion
++COMMON_CPPFLAGS = -Wextra -Wall -pedantic -fwrapv --param ssp-buffer-size=4 -O2 -std=gnu99 -Wconversion
++if ENABLE_WERROR
++COMMON_CPPFLAGS += -Werror
++endif
+ COMMON_LDFLAGS =  -Wl,-z,relro,-z,now
+ 
+ libtool: $(LIBTOOL_DEPS)
+diff --git a/configure.ac b/configure.ac
+index cb910e2..e230577 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -76,6 +76,9 @@ AX_ADD_FORTIFY_SOURCE
+ 
+ AC_CHECK_API_VERSION
+ 
++AC_ARG_ENABLE([werror], [AS_HELP_STRING([--disable-werror], [Disable -Werror])], [with_werror=$enableval], [with_werror=yes])
++AM_CONDITIONAL([ENABLE_WERROR], [test "x$with_werror" = "xyes"])
++
+ AC_ARG_ENABLE([kcapi-test], [AS_HELP_STRING([--enable-kcapi-test], [Compile kcapi test program])], [with_kcapi_test=$enableval])
+ AM_CONDITIONAL([ENABLE_KCAPI_TEST], [test "x$with_kcapi_test" = "xyes"])
+ 
diff --git a/package/libkcapi/libkcapi.mk b/package/libkcapi/libkcapi.mk
index e88928a74d..c6251c286c 100644
--- a/package/libkcapi/libkcapi.mk
+++ b/package/libkcapi/libkcapi.mk
@@ -15,6 +15,7 @@ LIBKCAPI_CONF_ENV = \
 	ac_cv_path_DB2PDF="" \
 	ac_cv_path_DB2PS="" \
 	ac_cv_path_XMLTO=""
+LIBKCAPI_CONF_OPTS = --disable-werror
 LIBKCAPI_MAKE_OPTS = CPPFLAGS="$(TARGET_CPPFLAGS)"
 
 ifeq ($(BR2_PACKAGE_LIBKCAPI_ASYM),y)
-- 
2.35.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Buildroot] [PATCH 1/1] package/libkcapi: disable -Werror
  2022-11-07 22:41 [Buildroot] [PATCH 1/1] package/libkcapi: disable -Werror Fabrice Fontaine
@ 2022-11-08 13:26 ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2022-11-08 13:26 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Tan En De, buildroot

On Mon,  7 Nov 2022 23:41:05 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following musl build failure (disabling -Werror seems to be the
> only "solution": https://github.com/smuellerDD/libkcapi/issues/136):
> 
> lib/kcapi-kernel-if.c: In function '_kcapi_common_send_meta':
> lib/kcapi-kernel-if.c:212:12: error: unsigned conversion from 'long int' to 'long unsigned int' changes value from '-4' to '4294967292' [-Werror=sign-conversion]
>   212 |   header = CMSG_NXTHDR(&msg, header);
>       |            ^~~~~~~~~~~
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/c789d43e71e6075e297bef58d888228a89055bbc
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  .../libkcapi/0002-Add-disable-werror.patch    | 46 +++++++++++++++++++
>  package/libkcapi/libkcapi.mk                  |  1 +
>  2 files changed, 47 insertions(+)
>  create mode 100644 package/libkcapi/0002-Add-disable-werror.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-08 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-07 22:41 [Buildroot] [PATCH 1/1] package/libkcapi: disable -Werror Fabrice Fontaine
2022-11-08 13:26 ` Thomas Petazzoni via buildroot

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.