Properly handle dlerror() message on FreeBSD when linking linker scripts.

Authored by arrowdodger on Aug 12 2017, 5:19 AM.



When RTS dynamically loads a SO, it uses a regexp on dlerror() text to figure out if the file we are loading is actually a linker script. On FreeBSD this message is different from Linux one, so take it into account.

Test Plan

GHCi.loadDll "/usr/lib/ now works on FreeBSD.

Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
arrowdodger created this revision.Aug 12 2017, 5:19 AM
simonmar accepted this revision.Aug 14 2017, 2:57 AM
simonmar added inline comments.

Would be good to start keeping a list of sample error messages in a comment here, and to have some kind of test so that we don't break old ones.

This revision is now accepted and ready to land.Aug 14 2017, 2:57 AM
This revision was automatically updated to reflect the committed changes.