From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: "Sven Püschel" <s.pueschel@pengutronix.de>
Subject: Re: [ptxdist] [APPLIED] libbsd: patch sanitize disable flag
Date: Fri, 7 Nov 2025 09:53:23 +0100 [thread overview]
Message-ID: <20251107085323.2208553-1-m.olbrich@pengutronix.de> (raw)
In-Reply-To: <20251028114621.2420792-1-s.pueschel@pengutronix.de>
Thanks, applied as 0bbbf26ae7db43349003ecfd367620542cfb0d16.
Michael
[sent from post-receive hook]
On Fri, 07 Nov 2025 09:53:23 +0100, Sven Püschel <s.pueschel@pengutronix.de> wrote:
> 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 <s.pueschel@pengutronix.de>
> Message-Id: <20251028114621.2420792-1-s.pueschel@pengutronix.de>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
>
> 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 6dbf20c2aea1..ddcf049c0034 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 <m.olbrich@pengutronix.de>
> 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 000000000000..27cdd4032e49
> --- /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?= <s.pueschel@pengutronix.de>
> +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 <s.pueschel@pengutronix.de>
> +---
> + 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 4e941d98e636..c47d9d254ebd 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
prev parent reply other threads:[~2025-11-07 8:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 11:46 [ptxdist] [PATCH] " Sven Püschel
2025-11-07 8:53 ` Michael Olbrich [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251107085323.2208553-1-m.olbrich@pengutronix.de \
--to=m.olbrich@pengutronix.de \
--cc=ptxdist@pengutronix.de \
--cc=s.pueschel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox