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

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