summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoritz Angermann <moritz.angermann@gmail.com>2020-05-14 08:17:59 +0800
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-15 13:10:36 -0400
commit761dcb84cd4c50c6fbb361eb26fb429af87392a3 (patch)
treef86314dca78c5b57358ad926df019cb10ad748d3
parent9a9cc0897b676ffd6612562a46600ea98c53a58d (diff)
downloadhaskell-761dcb84cd4c50c6fbb361eb26fb429af87392a3.tar.gz
Load .lo as well.
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);