For now, disable PIE in GHC. This will be revisited later on by kili@ in the

next update.  And again, calling stuff "PIC" is a bad idea ...

ok kili@
This commit is contained in:
pascal 2012-08-12 11:31:33 +00:00
parent b118d4e770
commit 167aa2e265
8 changed files with 100 additions and 2 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.70 2012/06/29 05:52:01 kili Exp $
# $OpenBSD: Makefile,v 1.71 2012/08/12 11:31:33 pascal Exp $
COMMENT-main = compiler for the functional language Haskell
COMMENT-doc = documentation for GHC
DISTNAME = ghc-${MODGHC_VER}
PKGNAME-main = ghc-${MODGHC_VER}
REVISION-main = 8
REVISION-main = 9
PKGNAME-doc = ghc-doc-${MODGHC_VER}
REVISION-doc = 0
CATEGORIES = lang devel
@ -76,6 +76,15 @@ CONFIGURE_ARGS += --with-gmp-includes=${LOCALBASE}/include \
--with-gmp-libraries=${LOCALBASE}/lib \
--with-iconv-includes=${LOCALBASE}/include \
--with-iconv-libraries=${LOCALBASE}/lib
CONFIGURE_ENV = CONF_CC_OPTS_STAGE0="-fno-pie" \
CONF_CC_OPTS_STAGE1="-fno-pie" \
CONF_CC_OPTS_STAGE2="-fno-pie" \
CONF_GCC_LINKER_OPTS_STAGE0="-fno-pie" \
CONF_GCC_LINKER_OPTS_STAGE1="-fno-pie" \
CONF_GCC_LINKER_OPTS_STAGE2="-fno-pie" \
CONF_GCC_LD_OPTS_STAGE0="-fno-pie" \
CONF_GCC_LD_OPTS_STAGE1="-fno-pie" \
CONF_GCC_LD_OPTS_STAGE2="-fno-pie"
MAKE_FLAGS += StripLibraries=YES \
INSTALL_BIN_OPTS=-s \
@ -119,6 +128,8 @@ post-extract:
cp ${WRKSRC}/libraries/xhtml/GNUmakefile ${WRKDIR}/xhtml-${XHTML_VER}
mv ${WRKSRC}/libraries/xhtml{,-ghcdist}
mv ${WRKDIR}/xhtml-${XHTML_VER} ${WRKSRC}/libraries/xhtml
perl -pi -e 's/(\S+ \S+)/\1 -optl -fno-pie/ if /^exec /' \
${WRKDIR}/bin/ghc
post-patch:
${SUBST_CMD} ${WRKSRC}/docs/index.html

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-compiler_nativeGen_AsmCodeGen_lhs,v 1.1 2012/08/12 11:31:33 pascal Exp $
--- compiler/nativeGen/AsmCodeGen.lhs.orig Sat Aug 11 22:00:05 2012
+++ compiler/nativeGen/AsmCodeGen.lhs Sat Aug 11 22:00:20 2012
@@ -19,6 +19,9 @@ module AsmCodeGen ( nativeCodeGen ) where
#include "HsVersions.h"
#include "nativeGen/NCG.h"
+#ifdef PIC
+#undef PIC
+#endif
#if alpha_TARGET_ARCH
import Alpha.CodeGen

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-compiler_nativeGen_PIC_hs,v 1.1 2012/08/12 11:31:33 pascal Exp $
--- compiler/nativeGen/PIC.hs.orig Sat Aug 11 22:00:37 2012
+++ compiler/nativeGen/PIC.hs Sat Aug 11 22:00:55 2012
@@ -38,6 +38,10 @@
and ppc-linux).
-}
+#ifdef PIC
+#undef PIC
+#endif
+
module PIC (
cmmMakeDynamicReference,
ReferenceKind(..),

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-compiler_nativeGen_PPC_CodeGen_hs,v 1.1 2012/08/12 11:31:33 pascal Exp $
--- compiler/nativeGen/PPC/CodeGen.hs.orig Sat Aug 11 22:01:50 2012
+++ compiler/nativeGen/PPC/CodeGen.hs Sat Aug 11 22:02:13 2012
@@ -24,6 +24,10 @@ where
#include "nativeGen/NCG.h"
#include "../includes/MachDeps.h"
+#ifdef PIC
+#undef PIC
+#endif
+
-- NCG stuff:
import PPC.Instr
import PPC.Cond

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-compiler_nativeGen_SPARC_CodeGen_CCall_hs,v 1.1 2012/08/12 11:31:33 pascal Exp $
--- compiler/nativeGen/SPARC/CodeGen/CCall.hs.orig Sat Aug 11 22:02:33 2012
+++ compiler/nativeGen/SPARC/CodeGen/CCall.hs Sat Aug 11 22:02:48 2012
@@ -5,6 +5,10 @@ module SPARC.CodeGen.CCall (
where
+#ifdef PIC
+#undef PIC
+#endif
+
import SPARC.CodeGen.Gen64
import SPARC.CodeGen.Gen32
import SPARC.CodeGen.Base

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-compiler_nativeGen_X86_CodeGen_hs,v 1.1 2012/08/12 11:31:33 pascal Exp $
--- compiler/nativeGen/X86/CodeGen.hs.orig Sat Aug 11 22:01:14 2012
+++ compiler/nativeGen/X86/CodeGen.hs Sat Aug 11 22:01:31 2012
@@ -29,6 +29,10 @@ where
#include "nativeGen/NCG.h"
#include "../includes/MachDeps.h"
+#ifdef PIC
+#undef PIC
+#endif
+
-- NCG stuff:
import X86.Instr
import X86.Cond

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-configure,v 1.10 2012/08/12 11:31:33 pascal Exp $
--- configure.orig Sat Aug 11 23:34:26 2012
+++ configure Sat Aug 11 23:34:46 2012
@@ -3779,7 +3779,7 @@ fi
$as_echo "$as_me: Building in-tree ghc-pwd" >&6;}
rm -rf utils/ghc-pwd/dist-boot
mkdir utils/ghc-pwd/dist-boot
- if ! "$WithGhc" -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
+ if ! "$WithGhc" -optl -fno-pie -v0 -no-user-package-conf -hidir utils/ghc-pwd/dist-boot -odir utils/ghc-pwd/dist-boot -stubdir utils/ghc-pwd/dist-boot --make utils/ghc-pwd/Main.hs -o utils/ghc-pwd/dist-boot/ghc-pwd
then
as_fn_error "Building ghc-pwd failed" "$LINENO" 5
fi

View File

@ -0,0 +1,6 @@
$OpenBSD: patch-extra-gcc-opts_in,v 1.1 2012/08/12 11:31:33 pascal Exp $
--- extra-gcc-opts.in.orig Sat Aug 11 21:04:38 2012
+++ extra-gcc-opts.in Sat Aug 11 21:04:44 2012
@@ -1 +1 @@
-@GccExtraViaCOpts@
+@GccExtraViaCOpts@ -fno-pie