Don't use X86_64_ELF_NONPIC_HACK for +RTS -xp
ClosedPublic

Authored by watashi on Oct 17 2018, 8:53 AM.

Details

Summary

When +RTS -xp is passed, when don't need the X86_64_ELF_NONPIC_HACK,
becasue the relocation offset should only be out of range if

  • the object file was not compiled with -fPIC -fexternal-dynamic-refs;
  • ghc generates non-pic code while it should (e.g. Trac #15723)

In either case, we should print an error message rather that silently
attempt to use a hacky workaround that may not work.

This could have made debugging Trac #15723 and Trac #15729 much easier.

Test Plan

Run this in a case where ghci used to crash becasue of T15723. Now we
see helpful message like:

ghc-iserv-prof: R_X86_64_PC32 relocation out of range:
stmzm2zi4zi4zi1zmJQn4hNPyYjP5m9AcbI88Ve_ControlziConcurrentziSTMziTMVar_readTMVar_C61n_cc
= 9b95ffac
watashi created this revision.Oct 17 2018, 8:53 AM
simonmar accepted this revision.Oct 18 2018, 1:22 PM

btw, use #1234 for ticket references in Phabricator markup.

This revision is now accepted and ready to land.Oct 18 2018, 1:22 PM
watashi edited the summary of this revision. (Show Details)Oct 18 2018, 1:44 PM
bgamari accepted this revision.Oct 18 2018, 3:23 PM

Yes, this makes sense.

watashi closed this revision.Feb 1 2019, 3:16 PM

merged