[GHC] #11780: GHC stage-2 build fails with "relocation R_X86_64_PC32 against `exitStaticPtrTable' can not be used when making a shared object"
GHC
ghc-devs at haskell.org
Fri Apr 1 03:57:03 UTC 2016
#11780: GHC stage-2 build fails with "relocation R_X86_64_PC32 against
`exitStaticPtrTable' can not be used when making a shared object"
-------------------------------------+-------------------------------------
Reporter: zadarnowski | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.10.3
Keywords: | Operating System: Linux
Architecture: x86_64 | Type of failure: Building GHC
(amd64) | failed
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Rev(s): | Wiki Page:
-------------------------------------+-------------------------------------
On very old versions of CentOS (5.x) running GCC 4.1.2, GHC fails to build
with the following error:
{{{
/usr/bin/ld: rts/dist/build/RtsStartup.dyn_o: relocation R_X86_64_PC32
against `exitStaticPtrTable' can not be used when making a shared object;
recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
}}}
This appears to be caused by #pragma GCC visibility push(hidden) in
BeginPrivate.h. Removing the HAS_VISIBILITY_HIDDEN macro from mk/config.h
results in a successful build.
BeginPrivate.h contains a comment which seems to indicate similar problem
occurs with GCC 4.2.1 on FreeBSD. I suggest that the #if directive in
{Begin,End}Private.h be changed to cover both systems, by enabling
visibility pragmas only on GCC versions higher than 4.2 as follows:
{{{
#if defined(HAS_VISIBLITY_HIDDEN) && (__GNUC__ > 4 || (__GNUC__ == 4 &&
__GNUC_MINOR__ > 2)
}}}
Old versions of CentOS are still prolific in enterprise environments so it
would be great for advocacy reasons to get that fix into the next release
of GHC.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11780>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list