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

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