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

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