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