summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2020-05-14 08:17:59 +0800
committerBen Gamari <ben@well-typed.com>2020-06-14 09:19:25 -0400
commit3fd12af1eaafe304e5916bc1fcfdf31709d360b8 (patch)
tree5c7defc95bdf2abd0e0113bdc3377a0589a0d3cb
parentc0e6dee99242eff08420176a36d77b715972f1f2 (diff)
downloadhaskell-wip/angerman/rts-link-lo.tar.gz
Load .lo as well.wip/angerman/rts-link-lo
Some archives contain so called linker objects, with the affectionate .lo suffic. For example the musl libc.a will come in that form. We still want to load those objects, hence we should not discard them and look for .lo as well. Ultimately we might want to fix this proerly by looking at the file magic.
-rw-r--r--rts/linker/LoadArchive.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/linker/LoadArchive.c b/rts/linker/LoadArchive.c
index 3d74b4d3df..709c2fb792 100644
--- a/rts/linker/LoadArchive.c
+++ b/rts/linker/LoadArchive.c
@@ -461,6 +461,7 @@ static HsInt loadArchive_ (pathchar *path)
/* TODO: Stop relying on file extensions to determine input formats.
Instead try to match file headers. See #13103. */
isObject = (thisFileNameSize >= 2 && strncmp(fileName + thisFileNameSize - 2, ".o" , 2) == 0)
+ || (thisFileNameSize >= 3 && strncmp(fileName + thisFileNameSize - 3, ".lo" , 3) == 0)
|| (thisFileNameSize >= 4 && strncmp(fileName + thisFileNameSize - 4, ".p_o", 4) == 0)
|| (thisFileNameSize >= 4 && strncmp(fileName + thisFileNameSize - 4, ".obj", 4) == 0);