Issues on compling libsquashfs for emscripten
Thank you for the library!
I am currently trying to compile it for Emscripten. I encountered some minor compilation issues, which I was able to work around.
However, I thought it would be helpful to report them upstream, as it may also hurt other platforms.
1.) Issues with
https://github.com/AgentD/squashfs-tools-ng/blob/e3dcf1770fd77a0babcca422dcbe7b2cc7b8ab90/include/compat.h#L22
This line is successfully selected, however, the compiler complains with (one example):
```
/workspaces/emscripten/cache/ports/libsquashfs/squashfs-tools-ng-1.3.2/lib/util/rbtree.c:194:40: warning: incompatible pointer types passing 'size_t *' (aka 'unsigned long *') to parameter of type 'unsigned int *' [-Wincompatible-pointer-types]
194 | if (SZ_ADD_OV(size, tree->value_size, &size))
```
It is a compiler error, which I downgraded with `-Wno-error=incompatible-pointer-types`, as I believe the overall behavior should be correct.
Another issue is at
```
/workspaces/emscripten/cache/ports/libsquashfs/squashfs-tools-ng-1.3.2/tests/libutil/xxhash.c:57:54: warning: format specifies type 'unsigned int' but the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
57 | fprintf(stderr, "Test case " PRI_SZ " failed!\n", I);
```
which I have downgraded with `-Wno-error=format` to a warning.
It may be that you have already taken care of the issues in your automake setup, and the emscripten build system may have skipped it. (E.g. the `_GNU_SOURCE` macro is an example that it missed.)
0 条评论