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