From 4e3e8f4b7c546f585ae68ff40b821126e004d209 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Jul 10 2013 02:07:23 +0000 Subject: turn off executable stack flag in executables (#973512) - reported by Dhiru Kholia - upstream patch by Edward Zhang: see http://ghc.haskell.org/trac/ghc/ticket/703 and https://github.com/ghc/ghc/commit/08a38628f29df63ac842f4d083efb414f42d7bff - this affects both ghc 7.4 and 7.6 --- diff --git a/ghc-NCG-no-execstack.patch b/ghc-NCG-no-execstack.patch new file mode 100644 index 0000000..40b6ba6 --- /dev/null +++ b/ghc-NCG-no-execstack.patch @@ -0,0 +1,32 @@ +commit 08a38628f29df63ac842f4d083efb414f42d7bff +Author: Edward Z. Yang +Date: Tue Jul 9 00:01:43 2013 -0700 + + Disable executable stack for the linker note, fixing #703 (again) + + Signed-off-by: Edward Z. Yang + + Modified compiler/main/DriverPipeline.hs +diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs +index 67377e6..26425ae 100644 +--- a/compiler/main/DriverPipeline.hs ++++ b/compiler/main/DriverPipeline.hs +@@ -1640,7 +1640,17 @@ mkNoteObjsToLinkIntoBinary dflags dep_packages = do + text elfSectionNote, + text "\n", + +- text "\t.ascii \"", info', text "\"\n" ] ++ text "\t.ascii \"", info', text "\"\n", ++ ++ -- ALL generated assembly must have this section to disable ++ -- executable stacks. See also ++ -- compiler/nativeGen/AsmCodeGen.lhs for another instance ++ -- where we need to do this. ++ (if platformHasGnuNonexecStack (targetPlatform dflags) ++ then text ".section .note.GNU-stack,\"\",@progbits\n" ++ else empty) ++ ++ ] + where + info' = text $ escape info + diff --git a/ghc.spec b/ghc.spec index 3951741..af89833 100644 --- a/ghc.spec +++ b/ghc.spec @@ -29,7 +29,7 @@ Version: 7.6.3 # - release can only be reset if *all* library versions get bumped simultaneously # (sometimes after a major release) # - minor release numbers for a branch should be incremented monotonically -Release: 14%{?dist} +Release: 15%{?dist} Summary: Glasgow Haskell Compiler License: %BSDHaskellReport @@ -52,6 +52,8 @@ Patch10: ghc-wrapper-libffi-include.patch Patch12: ghc-7.4.2-Cabal-disable-ghci-libs.patch # fix compilation with llvm-3.3 Patch13: ghc-llvmCodeGen-empty-array.patch +# disable executable stack +Patch14: ghc-NCG-no-execstack.patch # fedora ghc has been bootstrapped on # %{ix86} x86_64 ppc alpha sparcv9 ppc64 armv7hl armv5tel s390 s390x @@ -224,8 +226,8 @@ ln -s $(pkg-config --variable=includedir libffi)/*.h rts/dist/build %endif %patch12 -p1 -b .orig - %patch13 -p1 -b .orig +%patch14 -p1 -b .orig %build @@ -439,6 +441,10 @@ fi %changelog +* Wed Jul 10 2013 Jens Petersen - 7.6.3-15 +- turn off executable stack flag in executables (#973512) + (thanks Edward Zhang for upstream patch and Dhiru Kholia for report) + * Tue Jun 25 2013 Jens Petersen - 7.6.3-14 - fix compilation with llvm-3.3 (#977652) see http://hackage.haskell.org/trac/ghc/ticket/7996 @@ -453,8 +459,7 @@ fi * Thu Jun 20 2013 Jens Petersen - 7.6.3-12 - bootstrap 7.6.3 - all library versions bumped except pretty -- Cabal-fix-dynamic-exec-for-TH.patch, - ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch, and +- ghc-7.4-add-support-for-ARM-hard-float-ABI-fixes-5914.patch, and ghc-7.4-silence-gen_contents_index.patch are no longer needed - build with ghc-rpm-macros-extra - no longer filter type-level package from haddock index