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> --- Libtmp/Minuit/Makefile.PL | 3 +-- Libtmp/Slatec/Makefile.PL | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff -up PDL-2.008/Libtmp/Minuit/Makefile.PL.orig PDL-2.008/Libtmp/Minuit/Makefile.PL --- PDL-2.008/Libtmp/Minuit/Makefile.PL.orig 2015-05-25 10:40:25.504280235 +0200 +++ PDL-2.008/Libtmp/Minuit/Makefile.PL 2015-05-25 10:41:31.262090495 +0200 @@ -120,9 +120,8 @@ undef &MY::postamble; # suppress warning my $mycompiler = $f77->compiler(); my $mycflags = $f77->cflags(); my $orig = pdlpp_postamble_int(@pack); - my $hack_64bit = ($Config{archname}=~m/x86_64|i686/ ?" -fPIC " : ""); $orig =~ s/:\s*minuit\.pd/: minuit.pd/; - $orig .= "FFLAGS = $hack_64bit $mycflags \$(OPTIMIZE)\n"; + $orig .= "FFLAGS = -fPIC $mycflags \$(OPTIMIZE)\n"; $orig .= join "\n",map { ("minuitlib/$_\$(OBJ_EXT): minuitlib/$_.f $mycompiler -c \$(FFLAGS) -o minuitlib/$_\$(OBJ_EXT) minuitlib/$_.f diff -up PDL-2.008/Libtmp/Slatec/Makefile.PL.orig PDL-2.008/Libtmp/Slatec/Makefile.PL --- PDL-2.008/Libtmp/Slatec/Makefile.PL.orig 2015-05-25 10:41:48.991308954 +0200 +++ PDL-2.008/Libtmp/Slatec/Makefile.PL 2015-05-25 10:42:20.934702247 +0200 @@ -81,9 +81,8 @@ undef &MY::postamble; # suppress warning my $mycompiler = $f77->compiler(); my $mycflags = $f77->cflags(); my $orig = pdlpp_postamble_int(@pack); - my $hack_64bit = $Config{archname}=~m/x86_64|i686/ ?" -fPIC " : ""; $orig =~ s/:\s*slatec\.pd/: slatec.pd/; - $orig .= "FFLAGS = $hack_64bit $mycflags \$(OPTIMIZE)\n"; + $orig .= "FFLAGS = -fPIC $mycflags \$(OPTIMIZE)\n"; join "\n", $orig, map "$_\$(OBJ_EXT): $_.f $mycompiler -c \$(FFLAGS) -o $_\$(OBJ_EXT) $_.f", @slatecfiles; };