perl: fixed host compilation of static perl on MacOS
authorJakub Piotr Cłapa <jpc@loee.pl>
Thu, 22 Aug 2019 08:55:03 +0000 (10:55 +0200)
committerJakub Piotr Cłapa <jpc@loee.pl>
Sun, 10 Nov 2019 13:09:56 +0000 (14:09 +0100)
All symbols on MacOS are prefixed with an underscore which
interfered with the filtering mechanism (added in perl 5.28)
for extension libraries to be linked into static perl.

Signed-off-by: Jakub Piotr Cłapa <jpc@loee.pl>
lang/perl/Makefile
lang/perl/patches/301-fix_macos_static_linking.patch [new file with mode: 0644]

index b92b00279631ae07a0f23b063571d97eb8ed3efc..54348927ce53778f94779d291d4044b1e1f7c542 100644 (file)
@@ -11,7 +11,7 @@ include perlver.mk
 
 PKG_NAME:=perl
 PKG_VERSION:=$(PERL_VERSION)
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE_URL:=\
                https://cpan.metacpan.org/src/5.0 \
diff --git a/lang/perl/patches/301-fix_macos_static_linking.patch b/lang/perl/patches/301-fix_macos_static_linking.patch
new file mode 100644 (file)
index 0000000..4b4ef92
--- /dev/null
@@ -0,0 +1,19 @@
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -2738,14 +2738,14 @@ sub _find_static_libs {
+ Called by a utility method of makeaperl. Checks whether a given file
+ is an XS library by seeing whether it defines any symbols starting
+-with C<boot_>.
++with C<boot_> (with an optional leading underscore – needed on MacOS).
+ =cut
+ sub xs_static_lib_is_xs {
+     my ($self, $libfile) = @_;
+     my $devnull = File::Spec->devnull;
+-    return `nm $libfile 2>$devnull` =~ /\bboot_/;
++    return `nm $libfile 2>$devnull` =~ /\b_?boot_/;
+ }
+ =item makefile (o)