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