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

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