Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 59709 | Differences between
and this patch

Collapse All | Expand All

(-)ghc-6.2.2.ebuild.orig (-12 / +9 lines)
Lines 61-80 Link Here
61
SUPPORTED_CFLAGS=""
61
SUPPORTED_CFLAGS=""
62
62
63
# Setup supported CFLAGS.
63
# Setup supported CFLAGS.
64
setup_cflag() {
64
check_cflags() {
65
	OLD_CFLAGS="${CFLAGS}"
65
	OLD_CFLAGS="${CFLAGS}"
66
	CFLAGS="${CFLAGS} $1"
66
	CFLAGS="$1"
67
	strip-unsupported-flags
67
	strip-unsupported-flags
68
68
	SUPPORTED_CFLAGS="${SUPPORTED_CFLAGS} ${CFLAGS}"
69
	if [ "${OLD_CFLAGS}" != "${CFLAGS}" ];
69
	CFLAGS="${OLD_CFLAGS}"
70
	then
71
		SUPPORTED_CFLAGS="$1 ${SUPPORTED_CFLAGS}"
72
	fi
73
}
70
}
74
71
75
setup_cflags() {
72
setup_cflags() {
76
	setup_cflag "-fno-pic"
73
	check_cflags "-nopie -fno-stack-protector -fno-stack-protector-all"
77
	setup_cflag "-fno-stack-protector"
78
}
74
}
79
75
80
src_unpack() {
76
src_unpack() {
Lines 86-94 Link Here
86
	cd ${S}/ghc
82
	cd ${S}/ghc
87
	pushd driver
83
	pushd driver
88
	setup_cflags
84
	setup_cflags
85
        
89
	epatch ${FILESDIR}/${PN}-6.2.hardened.patch
86
	epatch ${FILESDIR}/${PN}-6.2.hardened.patch
90
	sed -i -e "s|@GHC_CFLAGS@|${SUPPORTED_CFLAGS//-f/-optc-f}|" ghc/ghc.sh
87
	sed -i -e "s|@GHC_CFLAGS@|${SUPPORTED_CFLAGS// -/ -optc-}|" ghc/ghc.sh
91
	sed -i -e "s|@GHC_CFLAGS@|${SUPPORTED_CFLAGS//-f/-optc-f}|" ghci/ghci.sh
88
	sed -i -e "s|@GHC_CFLAGS@|${SUPPORTED_CFLAGS// -/ -optc-}|" ghci/ghci.sh
92
	popd
89
	popd
93
}
90
}
94
91
Lines 105-111 Link Here
105
	# patch included)
102
	# patch included)
106
	setup_cflags
103
	setup_cflags
107
	echo "SRC_CC_OPTS+=${SUPPORTED_CFLAGS}" >> mk/build.mk
104
	echo "SRC_CC_OPTS+=${SUPPORTED_CFLAGS}" >> mk/build.mk
108
	echo "SRC_HC_OPTS+=${SUPPORTED_CFLAGS//-f/-optc-f}" >> mk/build.mk
105
	echo "SRC_HC_OPTS+=${SUPPORTED_CFLAGS// -/ -optc-}" >> mk/build.mk
109
106
110
	# force the config variable ArSupportsInput to be unset;
107
	# force the config variable ArSupportsInput to be unset;
111
	# ar in binutils >= 2.14.90.0.8-r1 seems to be classified
108
	# ar in binutils >= 2.14.90.0.8-r1 seems to be classified

Return to bug 59709