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