Blob Blame History Raw
From ab4b5fcf70149ce6e3f7fb01e6d2e91d8db37acc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Mon, 14 Oct 2013 11:04:02 +0200
Subject: [PATCH] Compile Slatec code as PIC
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This code fails to build on armv7. There was a hack for amd64 to use -fPIC.
The objects are used to produce DSO, so they should be PIC always. See
Debian commit cbca21383acb3e2769da7f886f2aec44d3613675.

Signed-off-by: Petr Písař <ppisar@redhat.com>
---
 Lib/Minuit/Makefile.PL | 3 +--
 Lib/Slatec/Makefile.PL | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/Lib/Minuit/Makefile.PL b/Lib/Minuit/Makefile.PL
index 35dcc44..e59ab9b 100644
--- a/Lib/Minuit/Makefile.PL
+++ b/Lib/Minuit/Makefile.PL
@@ -146,13 +146,12 @@ sub MY::postamble {
         $mycompiler     = $f77->compiler();
         $mycflags       = $f77->cflags();
 	my $orig = pdlpp_postamble_int(@::pack);
-	$hack_64bit = ($Config{archname}=~m/x86_64/ ?" -fPIC " : "");
 	$orig =~ s/:\s*minuit\.pd/: minuit.pd/;
 	$orig .= join "\n",map {
 	    ("
 
 minuitlib/$_\$(OBJ_EXT): minuitlib/$_.f 
-	$mycompiler -c $hack_64bit -o minuitlib/$_\$(OBJ_EXT) $mycflags minuitlib/$_.f
+	$mycompiler -c -fPIC -o minuitlib/$_\$(OBJ_EXT) $mycflags minuitlib/$_.f
 " )} @minuitfiles;
 
 	if (!defined($PDL::Config{MINUIT_LIB})){
diff --git a/Lib/Slatec/Makefile.PL b/Lib/Slatec/Makefile.PL
index 86ad3be..9e716db 100644
--- a/Lib/Slatec/Makefile.PL
+++ b/Lib/Slatec/Makefile.PL
@@ -136,13 +136,12 @@ sub MY::postamble {
         $mycompiler     = $f77->compiler();
         $mycflags       = $f77->cflags();
 	my $orig = pdlpp_postamble_int(@::pack);
-	$hack_64bit = ($Config{archname}=~m/x86_64/ ?" -fPIC " : "");
 	$orig =~ s/:\s*slatec\.pd/: slatec.pd/;
 	$orig .join "\n",map {
 ("
 
 slatec/$_\$(OBJ_EXT): slatec/$_.f 
-	$mycompiler -c $hack_64bit -o slatec/$_\$(OBJ_EXT) $mycflags slatec/$_.f
+	$mycompiler -c -fPIC -o slatec/$_\$(OBJ_EXT) $mycflags slatec/$_.f
 " )} @slatecfiles;
  
 }
-- 
1.8.3.1