Blame SOURCES/ExtUtils-CBuilder-0.280219-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch

9199d9
From 0c575416d2889e92c6c0d487ec2b52b45882557a Mon Sep 17 00:00:00 2001
9199d9
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
9199d9
Date: Wed, 3 Jul 2013 11:01:02 +0200
9199d9
Subject: [PATCH] Link XS modules to libperl.so with EU::CBuilder on Linux
9199d9
MIME-Version: 1.0
9199d9
Content-Type: text/plain; charset=UTF-8
9199d9
Content-Transfer-Encoding: 8bit
9199d9
9199d9
<https://bugzilla.redhat.com/show_bug.cgi?id=960048>
9199d9
<http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=327585#50>
9199d9
9199d9
Signed-off-by: Petr Písař <ppisar@redhat.com>
9199d9
---
9199d9
 MANIFEST                                |  1 +
9199d9
 lib/ExtUtils/CBuilder/Platform/linux.pm | 26 ++++++++++++++++++++++++++
9199d9
 2 files changed, 27 insertions(+)
9199d9
 create mode 100644 lib/ExtUtils/CBuilder/Platform/linux.pm
9199d9
9199d9
diff --git a/MANIFEST b/MANIFEST
9199d9
index eb71c93..5be739e 100644
9199d9
--- a/MANIFEST
9199d9
+++ b/MANIFEST
9199d9
@@ -24,6 +24,7 @@ lib/ExtUtils/CBuilder/Platform/android.pm
9199d9
 lib/ExtUtils/CBuilder/Platform/cygwin.pm
9199d9
 lib/ExtUtils/CBuilder/Platform/darwin.pm
9199d9
 lib/ExtUtils/CBuilder/Platform/dec_osf.pm
9199d9
+lib/ExtUtils/CBuilder/Platform/linux.pm
9199d9
 lib/ExtUtils/CBuilder/Platform/os2.pm
9199d9
 t/00-have-compiler.t
9199d9
 t/01-basic.t
9199d9
diff --git a/lib/ExtUtils/CBuilder/Platform/linux.pm b/lib/ExtUtils/CBuilder/Platform/linux.pm
9199d9
new file mode 100644
9199d9
index 0000000..e3251c4
9199d9
--- /dev/null
9199d9
+++ b/lib/ExtUtils/CBuilder/Platform/linux.pm
9199d9
@@ -0,0 +1,26 @@
9199d9
+package ExtUtils::CBuilder::Platform::linux;
9199d9
+
9199d9
+use strict;
9199d9
+use ExtUtils::CBuilder::Platform::Unix;
9199d9
+use File::Spec;
9199d9
+
9199d9
+use vars qw($VERSION @ISA);
9199d9
+$VERSION = '0.280206';
9199d9
+@ISA = qw(ExtUtils::CBuilder::Platform::Unix);
9199d9
+
9199d9
+sub link {
9199d9
+  my ($self, %args) = @_;
9199d9
+  my $cf = $self->{config};
9199d9
+
9199d9
+  # Link XS modules to libperl.so explicitly because multiple
9199d9
+  # dlopen(, RTLD_LOCAL) hides libperl symbols from XS module.
9199d9
+  local $cf->{lddlflags} = $cf->{lddlflags};
9199d9
+  if ($ENV{PERL_CORE}) {
9199d9
+    $cf->{lddlflags} .= ' -L' . $self->perl_inc();
9199d9
+  }
9199d9
+  $cf->{lddlflags} .= ' -lperl';
9199d9
+
9199d9
+  return $self->SUPER::link(%args);
9199d9
+}
9199d9
+
9199d9
+1;
9199d9
-- 
9199d9
1.9.3
9199d9