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

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