* [Buildroot] [PATCH 1/1] package/perl: apply perl-cross patch only on target perl
@ 2026-08-31 19:49 Julien Olivain via buildroot
2026-08-31 20:40 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Julien Olivain via buildroot @ 2026-08-31 19:49 UTC (permalink / raw)
To: buildroot; +Cc: Francois Perrad, Julien Olivain
Buildroot commit [1] (package/perl: fix build issue with musl)
introduced a patch that is meant to be applied on top of perl-cross,
which is extracted on top of perl only in the target variant.
Since the patch was introduced as a normal package patch, the Buildroot
infra is trying to always apply it, even for the host package variant.
Since perl-cross is not extracted for the host variant, some patched
files are missing. In that case, the host-perl is failing with error:
>>> host-perl 5.42.3 Patching
Applying 0001-configure-keep-_GNU_SOURCE-in-build-flags.patch using patch:
can't find file to patch at input line 46
This commit fixes the issue by moving the package patch in a dedicated
"perl-cross" subdirectory, to make sure it will no longer be applied by
the infra. We apply the patch only for the target package variant using
a _POST_PATCH_HOOKS hook.
Fixes:
- [1]
- https://gitlab.com/buildroot.org/buildroot/-/jobs/16185948610 (TestPerlXMLLibXML)
- ...and few other tests requiring host-perl
[1] https://gitlab.com/buildroot.org/buildroot/-/commit/d950fff290b1318fd72c7f09fedbd1b87b96155f
Signed-off-by: Julien Olivain <ju.o@free.fr>
---
.../0001-configure-keep-_GNU_SOURCE-in-build-flags.patch | 0
package/perl/perl.mk | 9 +++++++++
2 files changed, 9 insertions(+)
rename package/perl/{ => perl-cross}/0001-configure-keep-_GNU_SOURCE-in-build-flags.patch (100%)
diff --git a/package/perl/0001-configure-keep-_GNU_SOURCE-in-build-flags.patch b/package/perl/perl-cross/0001-configure-keep-_GNU_SOURCE-in-build-flags.patch
similarity index 100%
rename from package/perl/0001-configure-keep-_GNU_SOURCE-in-build-flags.patch
rename to package/perl/perl-cross/0001-configure-keep-_GNU_SOURCE-in-build-flags.patch
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 912445ccc8..43820cfcc3 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -32,6 +32,15 @@ define PERL_CROSS_EXTRACT
endef
PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT
+# We need to patch perl-cross, but perl-cross is extracted over the
+# target perl sources only (and not the host variant). So we apply the
+# patch only for the target case using a post patch hook.
+define PERL_CROSS_PATCH
+ $(APPLY_PATCHES) $(@D) $(PERL_PKGDIR)/perl-cross \
+ 0001-configure-keep-_GNU_SOURCE-in-build-flags.patch
+endef
+PERL_POST_PATCH_HOOKS += PERL_CROSS_PATCH
+
# Even though perl is not an autotools-package, it uses config.sub and
# config.guess. Up-to-date versions of these files may be needed to build perl
# on newer host architectures, so we borrow the hook which updates them from the
--
2.55.0
_______________________________________________
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 1/1] package/perl: apply perl-cross patch only on target perl
2026-08-31 19:49 [Buildroot] [PATCH 1/1] package/perl: apply perl-cross patch only on target perl Julien Olivain via buildroot
@ 2026-08-31 20:40 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2026-08-31 20:40 UTC (permalink / raw)
To: Julien Olivain via buildroot; +Cc: Julien Olivain, Francois Perrad
>>>>> "Julien" == Julien Olivain via buildroot <buildroot@buildroot.org> writes:
> Buildroot commit [1] (package/perl: fix build issue with musl)
> introduced a patch that is meant to be applied on top of perl-cross,
> which is extracted on top of perl only in the target variant.
> Since the patch was introduced as a normal package patch, the Buildroot
> infra is trying to always apply it, even for the host package variant.
> Since perl-cross is not extracted for the host variant, some patched
> files are missing. In that case, the host-perl is failing with error:
>>>> host-perl 5.42.3 Patching
> Applying 0001-configure-keep-_GNU_SOURCE-in-build-flags.patch using patch:
> can't find file to patch at input line 46
> This commit fixes the issue by moving the package patch in a dedicated
> "perl-cross" subdirectory, to make sure it will no longer be applied by
> the infra. We apply the patch only for the target package variant using
> a _POST_PATCH_HOOKS hook.
> Fixes:
> - [1]
> - https://gitlab.com/buildroot.org/buildroot/-/jobs/16185948610 (TestPerlXMLLibXML)
> - ...and few other tests requiring host-perl
> [1] https://gitlab.com/buildroot.org/buildroot/-/commit/d950fff290b1318fd72c7f09fedbd1b87b96155f
> Signed-off-by: Julien Olivain <ju.o@free.fr>
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:[~2026-08-31 20:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31 19:49 [Buildroot] [PATCH 1/1] package/perl: apply perl-cross patch only on target perl Julien Olivain via buildroot
2026-08-31 20:40 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox