Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl
@ 2026-08-14 12:06 Alexis Lothoré via buildroot
  2026-08-29 21:14 ` Thomas Petazzoni via buildroot
  2026-08-29 21:16 ` Thomas Petazzoni via buildroot
  0 siblings, 2 replies; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-08-14 12:06 UTC (permalink / raw)
  To: buildroot; +Cc: Thomas Petazzoni, Alexis Lothoré

The openscap build can fail with the following error:

In file included from [...]/src/OVAL/probes/unix/linux/systemdunitproperty_probe.c:38:
[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
      |                                                  ^~~~~~~~
      |                                                  rename
In file included from [...]/src/OVAL/probes/unix/linux/systemdunitdependency_probe.c:37:
[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
      |                                                  ^~~~~~~~
      |                                                  rename

This error happens when:
- dbus is enabled in the configuration, making openscap build probes
  code
- the toolchain uses musl, which does not declare basename() in string.h
  the way glibc does

The build error can be reproduced with the following minimal defconfig:

  BR2_arm=y
  BR2_cortex_a9=y
  BR2_ARM_ENABLE_NEON=y
  BR2_ARM_ENABLE_VFP=y
  BR2_TOOLCHAIN_EXTERNAL=y
  BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
  BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7_EABIHF_MUSL_BLEEDING_EDGE=y
  BR2_PACKAGE_DBUS=y
  BR2_PACKAGE_OPENSCAP=y

Backport the upstream fix to allow openscap to build with such
configuration. The custom patch can be removed once openscap is
re-released on its branch 1.3.x.

Fixes: https://autobuild.buildroot.org/results/a874d4f34d36fa9f8566be90ad2d5facb99aec24/
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
The issue affects master, 2026.05.x and 2025.02.x
---
 ...02-OVAL-probes-add-missing-header-include.patch | 48 ++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/package/openscap/0002-OVAL-probes-add-missing-header-include.patch b/package/openscap/0002-OVAL-probes-add-missing-header-include.patch
new file mode 100644
index 000000000000..0c7598b2b5e1
--- /dev/null
+++ b/package/openscap/0002-OVAL-probes-add-missing-header-include.patch
@@ -0,0 +1,48 @@
+From ab69b76cb40d6f35d252246e965245804b17591f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= <alexis.lothore@bootlin.com>
+Date: Thu, 13 Aug 2026 15:18:15 +0200
+Subject: [PATCH] OVAL/probes: add missing header include
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Openscap build can fail with the following log when
+-Wimplicit-function-declaration is turned into an error:
+
+In file included from [...]/src/OVAL/probes/unix/linux/systemdunitproperty_probe.c:38:
+[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
+[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
+  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
+      |                                                  ^~~~~~~~
+      |                                                  rename
+In file included from [...]/src/OVAL/probes/unix/linux/systemdunitdependency_probe.c:37:
+[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
+[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
+  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
+      |                                                  ^~~~~~~~
+      |                                                  rename
+
+Add the missing header include pointed by `man 3 basename` to fix the
+error.
+
+Upstream: https://github.com/OpenSCAP/openscap/commit/ab69b76cb40d6f35d252246e965245804b17591f
+Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
+---
+ src/OVAL/probes/unix/linux/systemdshared.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/OVAL/probes/unix/linux/systemdshared.h b/src/OVAL/probes/unix/linux/systemdshared.h
+index 879ae5be9d6c..57e94ca6f49e 100644
+--- a/src/OVAL/probes/unix/linux/systemdshared.h
++++ b/src/OVAL/probes/unix/linux/systemdshared.h
+@@ -35,6 +35,7 @@
+ #include <config.h>
+ #endif
+ 
++#include <libgen.h>
+ #include <limits.h>
+ #include <stdio.h>
+ #include "common/debug_priv.h"
+-- 
+2.55.0
+

---
base-commit: 679b9ead7620bbf193620d1ebf56f53c1764d37a
change-id: 20260814-openscap_musl_dbus-32ab8a575a49

Best regards,
--  
Alexis Lothoré <alexis.lothore@bootlin.com>

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

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

* Re: [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl
  2026-08-14 12:06 [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl Alexis Lothoré via buildroot
@ 2026-08-29 21:14 ` Thomas Petazzoni via buildroot
  2026-08-29 21:16 ` Thomas Petazzoni via buildroot
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-29 21:14 UTC (permalink / raw)
  To: Alexis Lothoré; +Cc: buildroot, Titouan Christophe, Thomas Perale

On Fri, Aug 14, 2026 at 02:06:13PM +0200, Alexis Lothoré via buildroot wrote:
> The openscap build can fail with the following error:
> 
> In file included from [...]/src/OVAL/probes/unix/linux/systemdunitproperty_probe.c:38:
> [...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
> [...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
>   188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
>       |                                                  ^~~~~~~~
>       |                                                  rename
> In file included from [...]/src/OVAL/probes/unix/linux/systemdunitdependency_probe.c:37:
> [...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
> [...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
>   188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
>       |                                                  ^~~~~~~~
>       |                                                  rename
> 
> This error happens when:
> - dbus is enabled in the configuration, making openscap build probes
>   code
> - the toolchain uses musl, which does not declare basename() in string.h
>   the way glibc does
> 
> The build error can be reproduced with the following minimal defconfig:
> 
>   BR2_arm=y
>   BR2_cortex_a9=y
>   BR2_ARM_ENABLE_NEON=y
>   BR2_ARM_ENABLE_VFP=y
>   BR2_TOOLCHAIN_EXTERNAL=y
>   BR2_TOOLCHAIN_EXTERNAL_BOOTLIN=y
>   BR2_TOOLCHAIN_EXTERNAL_BOOTLIN_ARMV7_EABIHF_MUSL_BLEEDING_EDGE=y
>   BR2_PACKAGE_DBUS=y
>   BR2_PACKAGE_OPENSCAP=y
> 
> Backport the upstream fix to allow openscap to build with such
> configuration. The custom patch can be removed once openscap is
> re-released on its branch 1.3.x.
> 
> Fixes: https://autobuild.buildroot.org/results/a874d4f34d36fa9f8566be90ad2d5facb99aec24/
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> ---
> The issue affects master, 2026.05.x and 2025.02.x

I believe this information should be part of the commit log itself, so
that when the LTS folks review the commits, they have it as part of
the commit log. Titouan, Thomas, do you agree?



> ---
>  ...02-OVAL-probes-add-missing-header-include.patch | 48 ++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
> 
> diff --git a/package/openscap/0002-OVAL-probes-add-missing-header-include.patch b/package/openscap/0002-OVAL-probes-add-missing-header-include.patch
> new file mode 100644
> index 000000000000..0c7598b2b5e1
> --- /dev/null
> +++ b/package/openscap/0002-OVAL-probes-add-missing-header-include.patch
> @@ -0,0 +1,48 @@
> +From ab69b76cb40d6f35d252246e965245804b17591f Mon Sep 17 00:00:00 2001
> +From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= <alexis.lothore@bootlin.com>
> +Date: Thu, 13 Aug 2026 15:18:15 +0200
> +Subject: [PATCH] OVAL/probes: add missing header include
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Openscap build can fail with the following log when
> +-Wimplicit-function-declaration is turned into an error:
> +
> +In file included from [...]/src/OVAL/probes/unix/linux/systemdunitproperty_probe.c:38:
> +[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
> +[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
> +  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
> +      |                                                  ^~~~~~~~
> +      |                                                  rename
> +In file included from [...]/src/OVAL/probes/unix/linux/systemdunitdependency_probe.c:37:
> +[...]/src/OVAL/probes/unix/linux/systemdshared.h: In function ‘get_all_systemd_units’:
> +[...]/src/OVAL/probes/unix/linux/systemdshared.h:188:50: error: implicit declaration of function ‘basename’; did you mean ‘rename’? [-Wimplicit-function-declaration]
> +  188 |                 char *unit_name_s = oscap_strdup(basename(value.str));
> +      |                                                  ^~~~~~~~
> +      |                                                  rename
> +
> +Add the missing header include pointed by `man 3 basename` to fix the
> +error.
> +
> +Upstream: https://github.com/OpenSCAP/openscap/commit/ab69b76cb40d6f35d252246e965245804b17591f
> +Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> +---
> + src/OVAL/probes/unix/linux/systemdshared.h | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/src/OVAL/probes/unix/linux/systemdshared.h b/src/OVAL/probes/unix/linux/systemdshared.h
> +index 879ae5be9d6c..57e94ca6f49e 100644
> +--- a/src/OVAL/probes/unix/linux/systemdshared.h
> ++++ b/src/OVAL/probes/unix/linux/systemdshared.h
> +@@ -35,6 +35,7 @@
> + #include <config.h>
> + #endif
> + 
> ++#include <libgen.h>
> + #include <limits.h>
> + #include <stdio.h>
> + #include "common/debug_priv.h"
> +-- 
> +2.55.0
> +
> 
> ---
> base-commit: 679b9ead7620bbf193620d1ebf56f53c1764d37a
> change-id: 20260814-openscap_musl_dbus-32ab8a575a49
> 
> Best regards,
> --  
> Alexis Lothoré <alexis.lothore@bootlin.com>
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

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

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

* Re: [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl
  2026-08-14 12:06 [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl Alexis Lothoré via buildroot
  2026-08-29 21:14 ` Thomas Petazzoni via buildroot
@ 2026-08-29 21:16 ` Thomas Petazzoni via buildroot
  2026-08-31  8:03   ` Alexis Lothoré via buildroot
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Petazzoni via buildroot @ 2026-08-29 21:16 UTC (permalink / raw)
  To: Alexis Lothoré; +Cc: buildroot

On Fri, Aug 14, 2026 at 02:06:13PM +0200, Alexis Lothoré via buildroot wrote:

> Fixes: https://autobuild.buildroot.org/results/a874d4f34d36fa9f8566be90ad2d5facb99aec24/
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> ---
> The issue affects master, 2026.05.x and 2025.02.x

Wait, how can this issue affects 2025.02.x, since openscap first
appeared in 2026.02 ?

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

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

* Re: [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl
  2026-08-29 21:16 ` Thomas Petazzoni via buildroot
@ 2026-08-31  8:03   ` Alexis Lothoré via buildroot
  2026-09-02  7:34     ` Alexis Lothoré via buildroot
  0 siblings, 1 reply; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-08-31  8:03 UTC (permalink / raw)
  To: Thomas Petazzoni, Alexis Lothoré; +Cc: buildroot

On Sat Aug 29, 2026 at 11:16 PM CEST, Thomas Petazzoni wrote:
> On Fri, Aug 14, 2026 at 02:06:13PM +0200, Alexis Lothoré via buildroot wrote:
>
>> Fixes: https://autobuild.buildroot.org/results/a874d4f34d36fa9f8566be90ad2d5facb99aec24/
>> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
>> ---
>> The issue affects master, 2026.05.x and 2025.02.x
>
> Wait, how can this issue affects 2025.02.x, since openscap first
> appeared in 2026.02 ?

Ah, good catch, I forgot that that the 2025.02 tree on which I was
working had Openscap because I manually backported the patches
introducing it. Too much coupling between my different BR series, my bad
!

Alexis

> Thomas




-- 
Alexis Lothoré, 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] 5+ messages in thread

* Re: [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl
  2026-08-31  8:03   ` Alexis Lothoré via buildroot
@ 2026-09-02  7:34     ` Alexis Lothoré via buildroot
  0 siblings, 0 replies; 5+ messages in thread
From: Alexis Lothoré via buildroot @ 2026-09-02  7:34 UTC (permalink / raw)
  To: Alexis Lothoré, Thomas Petazzoni; +Cc: buildroot

On Mon Aug 31, 2026 at 10:03 AM CEST, Alexis Lothoré wrote:
> On Sat Aug 29, 2026 at 11:16 PM CEST, Thomas Petazzoni wrote:
>> On Fri, Aug 14, 2026 at 02:06:13PM +0200, Alexis Lothoré via buildroot wrote:
>>
>>> Fixes: https://autobuild.buildroot.org/results/a874d4f34d36fa9f8566be90ad2d5facb99aec24/
>>> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
>>> ---
>>> The issue affects master, 2026.05.x and 2025.02.x
>>
>> Wait, how can this issue affects 2025.02.x, since openscap first
>> appeared in 2026.02 ?
>
> Ah, good catch, I forgot that that the 2025.02 tree on which I was
> working had Openscap because I manually backported the patches
> introducing it. Too much coupling between my different BR series, my bad
> !

So my mistake goes even further: openscap now fails to build, because it
fails to apply the patch. It fails to apply the patch because the issue
is already fixed in 1.4.4 (the original autobuilder issue was raised on
branch 2026.02), but the version bump occured later. So this patch
must be reverted on master. I'll send the revert, my bad for the noise.

> Alexis
>
>> Thomas




-- 
Alexis Lothoré, 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] 5+ messages in thread

end of thread, other threads:[~2026-09-02  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 12:06 [Buildroot] [PATCH] package/openscap: fix build failure with dbus and musl Alexis Lothoré via buildroot
2026-08-29 21:14 ` Thomas Petazzoni via buildroot
2026-08-29 21:16 ` Thomas Petazzoni via buildroot
2026-08-31  8:03   ` Alexis Lothoré via buildroot
2026-09-02  7:34     ` Alexis Lothoré via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox