[GHC] #9007: fails to build with hardening flags enabled (relocation R_X86_64_32 against `stg_CHARLIKE_closure'...)

GHC ghc-devs at haskell.org
Fri Jun 26 15:36:13 UTC 2015


#9007: fails to build with hardening flags enabled (relocation R_X86_64_32 against
`stg_CHARLIKE_closure'...)
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                   Owner:  nomeata
            Type:  bug               |                  Status:  infoneeded
        Priority:  high              |               Milestone:  7.12.1
       Component:  Compiler          |                 Version:  7.9
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Building GHC      |  Unknown/Multiple
  failed                             |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 If we do so should we apply the options from `-optc-foo` when doing this
 detection?

 I was going to object that the C compiler options can vary between input
 files in a single compilation (with `OPTIONS_GHC`) though technically the
 same is true of the C compiler program and it looks like we don't
 currently handle that correctly either. Probably it would not be
 unreasonably difficult to redo the detection only when the program/options
 have actually changed.

 Does the Debian (or Fedora/Gentoo) build system have some extra magic that
 makes all invocations of gcc produce PIC/PIE by default? Otherwise `ghc
 -optl-fPIE -optl-pie -optl-Wl,-z,relro -optl-Wl,-z,now` is not going to
 get the job done in any case, and the build systems will have to learn
 about how to specify either `-fPIC` or `-optc-fPIC` to `ghc` even if we do
 this autodetection and it uses the C compiler options.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9007#comment:18>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list