* [Buildroot] [PATCH] package/libcap: fix static builds
@ 2025-11-20 20:43 Thomas Petazzoni via buildroot
2025-12-03 19:56 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Petazzoni via buildroot @ 2025-11-20 20:43 UTC (permalink / raw)
To: buildroot; +Cc: Thomas Petazzoni, Bernd Kuhls
Since libcap has been updated to version 2.77 in Buildroot commit
42f2b480a5a81c7443f177bf541632b0fe501720, the build fails for
statically-linked configurations when the host system doesn't have a
static version of libc installed:
/usr/bin/ld: cannot find -lc: No such file or directory
/usr/bin/ld: have you installed the static version of the c library ?
This is because the -static flag that is supposed to be used when
building target code also gets passed to the host compiler... which is
obviously incorrect and leads to the build failure.
This issue was introduced by upstream commit
c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50, which was reverted right
after the 2.77 release in commit
542d7d86ecd2129dd5fe7e5b31ba307304f5b319, which we are simply
backporting here.
Fixes:
https://autobuild.buildroot.net/results/f6d/f6dc61a9d57e282691b87a3a8fadcb5d5ea8fd8b/
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
This is IMO an improved version of Bernd's proposal at
https://lore.kernel.org/buildroot/20251109080011.481333-1-bernd@kuhls.net/
for two reasons:
- A clearer/more correct explanation (the issue is not Fedora related)
- Backport an upstream commit
---
...Add-build-ldflags-to-_makenames-rule.patch | 34 +++++++++++++++++++
1 file changed, 34 insertions(+)
create mode 100644 package/libcap/0001-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
diff --git a/package/libcap/0001-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch b/package/libcap/0001-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
new file mode 100644
index 0000000000..ae9655fd57
--- /dev/null
+++ b/package/libcap/0001-Revert-libcap-Add-build-ldflags-to-_makenames-rule.patch
@@ -0,0 +1,34 @@
+From 542d7d86ecd2129dd5fe7e5b31ba307304f5b319 Mon Sep 17 00:00:00 2001
+From: "Andrew G. Morgan" <morgan@kernel.org>
+Date: Mon, 10 Nov 2025 18:26:34 -0800
+Subject: [PATCH] Revert "libcap: Add build ldflags to _makenames rule"
+
+This reverts commit c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50.
+
+The details of what this broke are here:
+
+ https://bugzilla.kernel.org/show_bug.cgi?id=220691#c2
+
+Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
+Upstream: 542d7d86ecd2129dd5fe7e5b31ba307304f5b319
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ libcap/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libcap/Makefile b/libcap/Makefile
+index f0eb87e..e90a950 100644
+--- a/libcap/Makefile
++++ b/libcap/Makefile
+@@ -80,7 +80,7 @@ $(PSXTITLE).pc: $(PSXTITLE).pc.in
+ $< >$@
+
+ _makenames: _makenames.c cap_names.list.h
+- $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@ $(BUILD_LDFLAGS)
++ $(BUILD_CC) $(BUILD_CFLAGS) $(BUILD_CPPFLAGS) $< -o $@
+
+ cap_names.h: _makenames
+ ./_makenames > cap_names.h
+--
+2.51.1
+
--
2.51.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] package/libcap: fix static builds
2025-11-20 20:43 [Buildroot] [PATCH] package/libcap: fix static builds Thomas Petazzoni via buildroot
@ 2025-12-03 19:56 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2025-12-03 19:56 UTC (permalink / raw)
To: Thomas Petazzoni via buildroot; +Cc: Thomas Petazzoni, Bernd Kuhls
>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:
> Since libcap has been updated to version 2.77 in Buildroot commit
> 42f2b480a5a81c7443f177bf541632b0fe501720, the build fails for
> statically-linked configurations when the host system doesn't have a
> static version of libc installed:
> /usr/bin/ld: cannot find -lc: No such file or directory
> /usr/bin/ld: have you installed the static version of the c library ?
> This is because the -static flag that is supposed to be used when
> building target code also gets passed to the host compiler... which is
> obviously incorrect and leads to the build failure.
> This issue was introduced by upstream commit
> c3ddf45d9afaab85d3b7db0dc7bfd1aafb8fde50, which was reverted right
> after the 2.77 release in commit
> 542d7d86ecd2129dd5fe7e5b31ba307304f5b319, which we are simply
> backporting here.
> Fixes:
> https://autobuild.buildroot.net/results/f6d/f6dc61a9d57e282691b87a3a8fadcb5d5ea8fd8b/
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> ---
> This is IMO an improved version of Bernd's proposal at
> https://lore.kernel.org/buildroot/20251109080011.481333-1-bernd@kuhls.net/
> for two reasons:
> - A clearer/more correct explanation (the issue is not Fedora related)
> - Backport an upstream commit
Committed, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
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:[~2025-12-03 19:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-20 20:43 [Buildroot] [PATCH] package/libcap: fix static builds Thomas Petazzoni via buildroot
2025-12-03 19:56 ` Peter Korsgaard
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.