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