Lines 23-29
Link Here
|
23 |
#There is only one issue: ghci will be successfully built only if ghc is bootstrapped from the same version. |
23 |
#There is only one issue: ghci will be successfully built only if ghc is bootstrapped from the same version. |
24 |
#Thus we need to detect presently installed one and bootstrap in one or two stages.. |
24 |
#Thus we need to detect presently installed one and bootstrap in one or two stages.. |
25 |
|
25 |
|
26 |
inherit base |
26 |
inherit base flag-o-matic eutils |
27 |
|
27 |
|
28 |
IUSE="doc tetex opengl" |
28 |
IUSE="doc tetex opengl" |
29 |
|
29 |
|
Lines 67-83
Link Here
|
67 |
# extend path to /opt/ghc/bin to guarantee that ghc-bin is found |
67 |
# extend path to /opt/ghc/bin to guarantee that ghc-bin is found |
68 |
GHCPATH="${PATH}:/opt/ghc/bin" |
68 |
GHCPATH="${PATH}:/opt/ghc/bin" |
69 |
|
69 |
|
|
|
70 |
SUPPORTED_CFLAGS="" |
71 |
|
72 |
# Setup supported CFLAGS. |
73 |
setup_cflag() { |
74 |
OLD_CFLAGS="${CFLAGS}" |
75 |
CFLAGS="${CFLAGS} $1" |
76 |
strip-unsupported-flags |
77 |
|
78 |
if [ "${OLD_CFLAGS}" != "${CFLAGS}" ]; |
79 |
then |
80 |
SUPPORTED_CFLAGS="$1 ${SUPPORTED_CFLAGS}" |
81 |
fi |
82 |
} |
83 |
|
84 |
setup_cflags() { |
85 |
setup_cflag "-fno-pic" |
86 |
setup_cflag "-fno-stack-protector" |
87 |
} |
88 |
|
70 |
src_unpack() { |
89 |
src_unpack() { |
71 |
base_src_unpack |
90 |
base_src_unpack |
72 |
|
91 |
|
73 |
# hardened-gcc needs to be disabled, because the |
92 |
# hardened-gcc needs to be disabled, because the |
74 |
# mangler doesn't accept its output; yes, the 6.2 version |
93 |
# mangler doesn't accept its output; yes, the 6.2 version |
75 |
# should do ... |
94 |
# should do ... |
76 |
cd ${S} |
95 |
cd ${S}/ghc |
77 |
bzcat ${FILESDIR}/ghc-6.2.hardened.patch.bz2 | patch -p1 |
96 |
pushd driver |
78 |
pushd ghc/compiler/ghci |
97 |
setup_cflags |
79 |
bzcat ${FILESDIR}/ghc-6.2.1-linker.patch.bz2 | patch -p0 |
98 |
epatch ${FILESDIR}/${P}-hardened.patch |
|
|
99 |
sed -i -e "s|@GHC_CFLAGS@|${SUPPORTED_CFLAGS//-f/-optc-f}|" ghc/ghc.sh |
100 |
sed -i -e "s|@GHC_CFLAGS@|${SUPPORTED_CFLAGS//-f/-optc-f}|" ghci/ghci.sh |
80 |
popd |
101 |
popd |
|
|
102 |
cd compiler/ghci |
103 |
bzcat ${FILESDIR}/ghc-6.2.1-linker.patch.bz2 | patch -p0 |
81 |
} |
104 |
} |
82 |
|
105 |
|
83 |
src_compile() { |
106 |
src_compile() { |
Lines 91-98
Link Here
|
91 |
# (this is still necessary, even though we have the patch, because |
114 |
# (this is still necessary, even though we have the patch, because |
92 |
# we might be bootstrapping from a version that didn't have the |
115 |
# we might be bootstrapping from a version that didn't have the |
93 |
# patch included) |
116 |
# patch included) |
94 |
echo "SRC_CC_OPTS+=-fno-pic -fno-stack-protector" >> mk/build.mk |
117 |
setup_cflags |
95 |
echo "SRC_HC_OPTS+=-optc-fno-pic -optc-fno-stack-protector" >> mk/build.mk |
118 |
echo "SRC_CC_OPTS+=${SUPPORTED_CFLAGS}" >> mk/build.mk |
|
|
119 |
echo "SRC_HC_OPTS+=${SUPPORTED_CFLAGS//-f/-optc-f}" >> mk/build.mk |
96 |
|
120 |
|
97 |
# force the config variable ArSupportsInput to be unset; |
121 |
# force the config variable ArSupportsInput to be unset; |
98 |
# ar in binutils >= 2.14.90.0.8-r1 seems to be classified |
122 |
# ar in binutils >= 2.14.90.0.8-r1 seems to be classified |