From 9f6c257638cf2598cad123afa8cdbf84437de072 Mon Sep 17 00:00:00 2001 From: Fabrice Fontaine Date: Mon, 7 Nov 2022 23:41:05 +0100 Subject: [PATCH] package/libkcapi: disable -Werror 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 Signed-off-by: Thomas Petazzoni --- .../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 +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 +Signed-off-by: Stephan Mueller +[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)