From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Tue, 28 Oct 2025 12:46:39 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vDi9v-00CfmJ-0l for lore@lore.pengutronix.de; Tue, 28 Oct 2025 12:46:39 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1vDi9v-0005q5-2P; Tue, 28 Oct 2025 12:46:39 +0100 Received: from dude04.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::ac]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1vDi9f-0005pZ-5H; Tue, 28 Oct 2025 12:46:23 +0100 From: =?UTF-8?q?Sven=20P=C3=BCschel?= To: ptxdist@pengutronix.de Date: Tue, 28 Oct 2025 12:46:06 +0100 Message-ID: <20251028114621.2420792-1-s.pueschel@pengutronix.de> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [ptxdist] [PATCH] libbsd: patch sanitize disable flag X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: =?UTF-8?q?Sven=20P=C3=BCschel?= Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false libbsd incorrectly checked the sanitize argument and therefore enabled sanitize also when --disable-sanitize was present in the configure call. Created an upstream patch [1] and added it to the patch dir. The first patch was just regenerated as a result of 'git ptx-patches'. [1] https://gitlab.freedesktop.org/libbsd/libbsd/-/merge_requests/31 Fixes: 0d8d99a84218 ("libbsd: version bump 0.11.7 -> 0.12.2") Signed-off-by: Sven Püschel --- ...-I-instead-of-isystem-for-local-path.patch | 14 +++---- ...-build-check-sanitize-argument-value.patch | 42 +++++++++++++++++++ patches/libbsd-0.12.2/series | 3 +- 3 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 patches/libbsd-0.12.2/0002-build-check-sanitize-argument-value.patch diff --git a/patches/libbsd-0.12.2/0001-use-I-instead-of-isystem-for-local-path.patch b/patches/libbsd-0.12.2/0001-use-I-instead-of-isystem-for-local-path.patch index 6dbf20c2a..ddcf049c0 100644 --- a/patches/libbsd-0.12.2/0001-use-I-instead-of-isystem-for-local-path.patch +++ b/patches/libbsd-0.12.2/0001-use-I-instead-of-isystem-for-local-path.patch @@ -12,7 +12,7 @@ Signed-off-by: Michael Olbrich 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile.am b/src/Makefile.am -index 7ef2013a5ff9..167ad58ce747 100644 +index 00181bd9607b..9caf57d6a4a8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -2,7 +2,7 @@ @@ -23,17 +23,17 @@ index 7ef2013a5ff9..167ad58ce747 100644 + -I$(top_srcdir)/include/bsd/ \ -include $(top_builddir)/config.h \ -DLIBBSD_OVERLAY -DLIBBSD_DISABLE_DEPRECATED \ - -D__REENTRANT + -D__REENTRANT \ diff --git a/test/Makefile.am b/test/Makefile.am -index 90fe38430bbd..eb54cf39d60d 100644 +index 13c3309c4bb4..a5d5f70449bc 100644 --- a/test/Makefile.am +++ b/test/Makefile.am -@@ -7,7 +7,7 @@ HEADERS_CPPFLAGS = \ - -D__REENTRANT +@@ -8,7 +8,7 @@ HEADERS_CPPFLAGS = \ + # EOL AM_CPPFLAGS = \ - -isystem $(top_srcdir)/include/bsd/ \ + -I$(top_srcdir)/include/bsd/ \ $(HEADERS_CPPFLAGS) \ - -DLIBBSD_OVERLAY - + -DLIBBSD_OVERLAY \ + # EOL diff --git a/patches/libbsd-0.12.2/0002-build-check-sanitize-argument-value.patch b/patches/libbsd-0.12.2/0002-build-check-sanitize-argument-value.patch new file mode 100644 index 000000000..27cdd4032 --- /dev/null +++ b/patches/libbsd-0.12.2/0002-build-check-sanitize-argument-value.patch @@ -0,0 +1,42 @@ +From: =?UTF-8?q?Sven=20P=C3=BCschel?= +Date: Tue, 28 Oct 2025 12:11:36 +0100 +Subject: [PATCH] build: check sanitize argument value +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Check the value of the sanitize argument to determine if sanitize +should be enabled. This fixes that sanitize is enabled when +--disable-sanitize is passed to the configure script. + +The third AC_ARG_ENABLE parameter defines an action, if the parameter is +present, but doesn't check it's value. Therefore it is also invoked if +the parameter is disabled or --enable-foo=no is set. Therefore don't +define these actions and instead check the value with an AS_IF statement +afterwards, as shown in [1]. + +[1] https://autotools.info/autoconf/arguments.html + +Fixes: 257800a03c6b ("build: Add support for sanitizer compiler flags") + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/libbsd/libbsd/-/merge_requests/31] + +Signed-off-by: Sven Püschel +--- + configure.ac | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 2a15d720f9db..c3fed26939a4 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -425,7 +425,8 @@ AS_IF([test "$user_CFLAGS" = unset], [ + CFLAGS="$CFLAGS $LIBBSD_COMPILER_FLAGS" + + AC_ARG_ENABLE([sanitize], +- [AS_HELP_STRING([--enable-sanitize], [enable compiler sanitizer support])], ++ [AS_HELP_STRING([--enable-sanitize], [enable compiler sanitizer support])]) ++ AS_IF([test "x$enable_sanitize" = "xyes"], + [ + LIBBSD_COMPILER_FLAGS='' + LIBBSD_CHECK_COMPILER_FLAG([-fsanitize=address]) diff --git a/patches/libbsd-0.12.2/series b/patches/libbsd-0.12.2/series index 4e941d98e..c47d9d254 100644 --- a/patches/libbsd-0.12.2/series +++ b/patches/libbsd-0.12.2/series @@ -1,4 +1,5 @@ # generated by git-ptx-patches #tag:base --start-number 1 0001-use-I-instead-of-isystem-for-local-path.patch -# 11cd8d3f722f73a2447389987314e113 - git-ptx-patches magic +0002-build-check-sanitize-argument-value.patch +# 3d6c768f28075aeb90ae7547b97f6810 - git-ptx-patches magic -- 2.47.3