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

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

Details

Summary

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/libc++.so now works on FreeBSD.

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
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.
rts/Linker.c
485

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.