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

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