Properly handle dlerror() message on FreeBSD when linking linker scripts
authorGleb Popov <6yearold@gmail.com>
Tue, 15 Aug 2017 00:54:36 +0000 (20:54 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 15 Aug 2017 01:32:16 +0000 (21:32 -0400)
Test Plan: `GHCi.loadDll "/usr/lib/libc++.so` now works on FreeBSD.

Reviewers: austin, bgamari, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3841

rts/Linker.c

index 3700726..18f2c6b 100644 (file)
@@ -482,7 +482,7 @@ initLinker_ (int retain_cafs)
 #   endif /* RTLD_DEFAULT */
 
     compileResult = regcomp(&re_invalid,
-           "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short)",
+           "(([^ \t()])+\\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)",
            REG_EXTENDED);
     if (compileResult != 0) {
         barf("Compiling re_invalid failed");