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

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