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

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