Skip to content

PIE-enabled hardened gcc might broke GHC.

emerge --info:
Portage 2.1.7.4 (hardened/linux/x86/10.0/desktop, gcc-4.3.4, glibc-2.10.1-r0, 2.6.31-11-generic i686)
=================================================================
System uname: Linux-2.6.31-11-generic-i686-Genuine_Intel-R-_CPU_T2050_@_1.60GHz-with-gentoo-2.0.1
Timestamp of tree: Sat, 14 Nov 2009 05:45:01 +0000
app-shells/bash:     4.0_p35
dev-lang/python:     2.6.4, 3.1.1-r1
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.5.2-r1
sys-apps/sandbox:    2.2
sys-devel/autoconf:  2.63-r1
sys-devel/automake:  1.9.6-r2, 1.10.2, 1.11
sys-devel/binutils:  2.20
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6a
virtual/os-headers:  2.6.30-r1
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CXXFLAGS="-O2 -march=native -pipe -fomit-frame-pointer"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="*"
MAKEOPTS="-j3"

While I am building yi-editor, I get:

Building yi-0.6.1...
[  1 of 119] Compiling System.FriendlyPath ( System/FriendlyPath.hs,
dist/build/System/FriendlyPath.o )
[  2 of 119] Compiling Shim.ProjectContent ( Shim/ProjectContent.hs,
dist/build/Shim/ProjectContent.o )
[  3 of 119] Compiling Parser.Incremental ( Parser/Incremental.hs,
dist/build/Parser/Incremental.o )
[  4 of 119] Compiling Data.Trie        ( Data/Trie.hs, dist/build/Data/Trie.o
)
[  5 of 119] Compiling Data.DelayList   ( Data/DelayList.hs,
dist/build/Data/DelayList.o )
[  6 of 119] Compiling Data.Rope        ( Data/Rope.hs, dist/build/Data/Rope.o
)
[  7 of 119] Compiling Data.Prototype   ( Data/Prototype.hs,
dist/build/Data/Prototype.o )
[  8 of 119] Compiling HConf.Utils      ( HConf/Utils.hs,
dist/build/HConf/Utils.o )
[  9 of 119] Compiling HConf.Paths      ( HConf/Paths.hs,
dist/build/HConf/Paths.o )
[ 10 of 119] Compiling Paths_yi         ( dist/build/autogen/Paths_yi.hs,
dist/build/Paths_yi.o )
[ 11 of 119] Compiling HConf            ( HConf.hs, dist/build/HConf.o )
[ 12 of 119] Compiling Yi.Char.Unicode  ( Yi/Char/Unicode.hs,
dist/build/Yi/Char/Unicode.o )
[ 13 of 119] Compiling Yi.UI.Common[boot] ( Yi/UI/Common.hs-boot,
dist/build/Yi/UI/Common.o-boot )
[ 14 of 119] Compiling Yi.String        ( Yi/String.hs, dist/build/Yi/String.o
)
[ 15 of 119] Compiling Yi.Monad         ( Yi/Monad.hs, dist/build/Yi/Monad.o )
[ 16 of 119] Compiling Yi.Keymap.Completion ( Yi/Keymap/Completion.hs,
dist/build/Yi/Keymap/Completion.o )
[ 17 of 119] Compiling Yi.Editor[boot]  ( Yi/Editor.hs-boot,
dist/build/Yi/Editor.o-boot )
[ 18 of 119] Compiling Yi.Debug         ( Yi/Debug.hs, dist/build/Yi/Debug.o )
[ 19 of 119] Compiling Yi.Prelude       ( Yi/Prelude.hs,
dist/build/Yi/Prelude.o )
[ 20 of 119] Compiling Yi.Dynamic       ( Yi/Dynamic.hs,
dist/build/Yi/Dynamic.o )
[ 21 of 119] Compiling Yi.Event         ( Yi/Event.hs, dist/build/Yi/Event.o )
[ 22 of 119] Compiling Yi.Interact      ( Yi/Interact.hs,
dist/build/Yi/Interact.o )
[ 23 of 119] Compiling Yi.Keymap[boot]  ( Yi/Keymap.hs-boot,
dist/build/Yi/Keymap.o-boot )
[ 24 of 119] Compiling Yi.Style         ( Yi/Style.hs, dist/build/Yi/Style.o )
[ 25 of 119] Compiling Yi.Style.Library ( Yi/Style/Library.hs,
dist/build/Yi/Style/Library.o )
[ 26 of 119] Compiling Yi.Interpreter   ( Yi/Interpreter.hs,
dist/build/Yi/Interpreter.o )
[ 27 of 119] Compiling Shim.Utils       ( Shim/Utils.hs,
dist/build/Shim/Utils.o )
[ 28 of 119] Compiling Shim.CabalInfo   ( Shim/CabalInfo.hs,
dist/build/Shim/CabalInfo.o )
[ 29 of 119] Compiling Yi.Buffer.Misc[boot] ( Yi/Buffer/Misc.hs-boot,
dist/build/Yi/Buffer/Misc.o-boot )
[ 30 of 119] Compiling Yi.Buffer.Basic  ( Yi/Buffer/Basic.hs,
dist/build/Yi/Buffer/Basic.o )
ghc: /usr/lib/ghc-6.10.4/ghc-prim-0.1.0.0/HSghc-prim-0.1.0.0.o: unknown symbol
`_GLOBAL_OFFSET_TABLE_'
Loading package ghc-prim ... linking ... ghc: unable to load package `ghc-prim'

mk/build.mk:

# Gentoo changes
docdir = /usr/share/doc/ghc-6.10.4
htmldir = /usr/share/doc/ghc-6.10.4
SRC_HC_OPTS+= -optc-march=native -opta-march=native -optc-nopie -optl-nopie -optc-fno-PIE -opta-Wa,--noexecstack
SRC_CC_OPTS+=-O2 -march=native -pipe -nopie -Wa,--noexecstack
XMLDocWays=
HADDOCK_DOCS=NO
SRC_HC_OPTS+=-w
Edited by Ian Lynagh -
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information