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

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