In my case, this is causing odd issues with a different version of llvm-ar:
Assertion failed: pos < symbols[0].offset, file src/util/archive.c, line 53
Obviously, the position here is way too far ahead as only a few bytes should have been read, this seems due to the fread() encountering newlines. Adding "rb" fixes the issue.
It seems that the
load_archive
function inarchive.c
is not opening the archive file in binary mode:https://github.com/tyfkda/xcc/blob/e49b25916388ba39ce3b4ac9a6474e454228e8d2/src/util/archive.c#L21
In my case, this is causing odd issues with a different version of
llvm-ar
:Obviously, the position here is way too far ahead as only a few bytes should have been read, this seems due to the fread() encountering newlines. Adding
"rb"
fixes the issue.I've noticed the same issue here:
https://github.com/tyfkda/xcc/blob/e49b25916388ba39ce3b4ac9a6474e454228e8d2/src/wcc/wasm_linker.c#L1426
This was causing issues with
wcc
failing to read emitted wasm (stored in a temporary file). Changing torb
solved the issue.There might be other places where "r" or "w" are used instead of "rb" or "wb".