67 lines
2.5 KiB
Diff
67 lines
2.5 KiB
Diff
From 5051aebec66aa530a23c7842f5c77606f208134e Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Jani=20V=C3=A4limaa?= <wally@mageia.org>
|
|
Date: Sat, 18 Jan 2025 15:25:52 +0200
|
|
Subject: [PATCH] Link XS modules to libperl.so with EU::CBuilder on Linux
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Based on patch from Petr Písař <ppisar@redhat.com>
|
|
|
|
Patch is modified to use extra_linker_flags to pass -lperl after object .o files.
|
|
In that way -Wl,--as-needed linker flag doesn't strip libperl dependecy.
|
|
|
|
<https://bugzilla.redhat.com/show_bug.cgi?id=960048>
|
|
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327585#50>
|
|
---
|
|
MANIFEST | 1 +
|
|
.../lib/ExtUtils/CBuilder/Platform/linux.pm | 24 +++++++++++++++++++
|
|
2 files changed, 25 insertions(+)
|
|
create mode 100644 dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
|
|
|
|
diff --git a/MANIFEST b/MANIFEST
|
|
index 2eb9ca4..31bac12 100644
|
|
--- a/MANIFEST
|
|
+++ b/MANIFEST
|
|
@@ -4104,6 +4104,7 @@ dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/android.pm CBuilder method
|
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/cygwin.pm CBuilder methods for cygwin
|
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/darwin.pm CBuilder methods for darwin
|
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/dec_osf.pm CBuilder methods for OSF
|
|
+dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm CBuilder methods for Linux
|
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/os2.pm CBuilder methods for OS/2
|
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/Unix.pm CBuilder methods for Unix
|
|
dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/VMS.pm CBuilder methods for VMS
|
|
diff --git a/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
|
|
new file mode 100644
|
|
index 0000000..060515a
|
|
--- /dev/null
|
|
+++ b/dist/ExtUtils-CBuilder/lib/ExtUtils/CBuilder/Platform/linux.pm
|
|
@@ -0,0 +1,24 @@
|
|
+package ExtUtils::CBuilder::Platform::linux;
|
|
+
|
|
+use strict;
|
|
+use ExtUtils::CBuilder::Platform::Unix;
|
|
+use File::Spec;
|
|
+
|
|
+use vars qw($VERSION @ISA);
|
|
+$VERSION = '0.280206';
|
|
+@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
|
|
+
|
|
+sub link {
|
|
+ my ($self, %args) = @_;
|
|
+
|
|
+ # Link XS modules to libperl.so explicitly because multiple
|
|
+ # dlopen(, RTLD_LOCAL) hides libperl symbols from XS module.
|
|
+ $args{extra_linker_flags} = [
|
|
+ '-lperl',
|
|
+ $self->split_like_shell($args{extra_linker_flags})
|
|
+ ];
|
|
+
|
|
+ return $self->SUPER::link(%args);
|
|
+}
|
|
+
|
|
+1;
|
|
--
|
|
2.47.1
|
|
|