[ghc-rpm-macros] turn off _hardened_build for libs since it breaks linking

Jens Petersen petersen at fedoraproject.org
Fri Feb 27 13:57:24 UTC 2015


commit 47247e41504a55fedf36cf5cf529de1add533497
Author: Jens Petersen <petersen at fedoraproject.org>
Date:   Fri Feb 27 22:57:15 2015 +0900

    turn off _hardened_build for libs since it breaks linking
    
    With "%_hardened_build 1" errors like:
    
      /usr/bin/ld: -r and -shared may not be used together
    
    and
    
      /usr/bin/ld.gold: fatal error: -pie and -r are incompatible
    
    occur when building libraries

 ghc-rpm-macros.spec | 4 ++++
 macros.ghc          | 1 +
 2 files changed, 5 insertions(+)
---
diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec
index 8f8d9b9..adca694 100644
--- a/ghc-rpm-macros.spec
+++ b/ghc-rpm-macros.spec
@@ -88,6 +88,10 @@ install -p -D -m 0755 %{SOURCE5} %{buildroot}/%{_bindir}/cabal-tweak-flag
 
 
 %changelog
+* Fri Feb 27 2015 Jens Petersen <petersen at fedoraproject.org> - 1.4.2-1
+- turn off _hardened_build for libraries since it breaks linking
+  <https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code>
+
 * Sun Feb  1 2015 Jens Petersen <petersen at redhat.com> - 1.4.8-1
 - drop cabal_tests_not_working since not all tests failing on ARMv7
 
diff --git a/macros.ghc b/macros.ghc
index 7bf522c..5f213b2 100644
--- a/macros.ghc
+++ b/macros.ghc
@@ -105,6 +105,7 @@ install -D --mode=0644 %{pkgnamever}.conf %{buildroot}%{ghclibdir}/package.conf.
 # ghc_lib_build_without_haddock [name] [version]
 %ghc_lib_build_without_haddock()\
 %global debug_package %{nil}\
+%global _hardened_build 0\
 %cabal_configure %{!?without_prof:-p} %{!?ghc_without_shared:--enable-shared} %{?pkg_name:--htmldir=%{ghclibdocdir}/%{pkg_name}-%{version}} %{?1:--docdir=%{_docdir}/ghc-%1%{!?fedora:-%2} --htmldir=%{ghclibdocdir}/%1-%2} %{!?1:--global} %{?ghc_with_lib_for_ghci:--enable-library-for-ghci}\
 %cabal build\
 %{nil}


More information about the scm-commits mailing list