ppisar pushed to perl (master). "Store distribution's linker and compiler flags to more Config's options (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Thu Jul 9 14:57:21 UTC 2015


From b3c6b36d56d7547accc34e63895552e8bd4270b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar at redhat.com>
Date: Fri, 3 Jul 2015 13:14:50 +0200
Subject: Store distribution's linker and compiler flags to more Config's
 options

We want all programs and libraries produced by perl.spec and other
Perl packages to respect distribution's CFLAGS and LDFLAGS.

This change ensures it. Especially for /usr/bin/perl as well as
non-installed miniperl. The only drawback is /usr/bin/perl gets the
flags twice.

We could poke upstream to fix ExtUtils::MakeMaker and
ExtUtils::CBuilder to respect ldflags what does not happen now. They
use lddlflags only. But we cannot patch them not to diverge from the
world.

Also we disable optimize because optimize is not used everywhere.

This change makes other Perl packages' Makefile.PL's OPTIMIZE argument
redundant. Please note the Build.PL's optimize argument is completly
ignored by Build.PL.

diff --git a/perl.spec b/perl.spec
index 4bdfa77..53483ae 100644
--- a/perl.spec
+++ b/perl.spec
@@ -30,7 +30,7 @@
 Name:           perl
 Version:        %{perl_version}
 # release number must be even higher, because dual-lived modules will be broken otherwise
-Release:        346%{?dist}
+Release:        347%{?dist}
 Epoch:          %{perl_epoch}
 Summary:        Practical Extraction and Report Language
 Group:          Development/Languages
@@ -1957,9 +1957,16 @@ echo "RPM Build arch: %{_arch}"
 # For perl-5.14.2-large-repeat-heap-abuse.patch 
 perl regen.pl -v
 
-/bin/sh Configure -des -Doptimize="$RPM_OPT_FLAGS" \
-        -Dccdlflags="-Wl,--enable-new-dtags" \
-        -Dlddlflags="-shared $RPM_OPT_FLAGS $RPM_LD_FLAGS" \
+# ldflags is not used when linking XS modules.
+# Only ldflags is used when linking miniperl.
+# Only ccflags and ldflags are used for Configure's compiler checks.
+# Set optimize=none to prevent from injecting upstream's value.
+/bin/sh Configure -des \
+        -Doptimize="none" \
+        -Dccflags="$RPM_OPT_FLAGS" \
+        -Dldflags="$RPM_LD_FLAGS" \
+        -Dccdlflags="-Wl,--enable-new-dtags $RPM_LD_FLAGS" \
+        -Dlddlflags="-shared $RPM_LD_FLAGS" \
         -Dshrpdir="%{_libdir}" \
         -DDEBUGGING=-g \
         -Dversion=%{perl_version} \
@@ -3656,6 +3663,10 @@ popd
 
 # Old changelog entries are preserved in CVS.
 %changelog
+* Wed Jul 08 2015 Petr Pisar <ppisar at redhat.com> - 4:5.22.0-347
+- Store distribution's linker and compiler flags to more Config's options
+  in order to apply them when linking executable programs (bug #1238804)
+
 * Thu Jun 18 2015 Petr Pisar <ppisar at redhat.com> - 4:5.22.0-346
 - Subpackage "open" module in order to keep deprecated "encoding" module
   optional (bug #1228378)
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/perl.git/commit/?h=master&id=b3c6b36d56d7547accc34e63895552e8bd4270b4


More information about the perl-devel mailing list