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