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

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