Building libqasan for musl
Author: celi0nCreated Jun 26, 2026Updated Sep 21, 2026
Labelshelp wantedgood first issue
I am fuzzing a binary linked to musl with Qasan. Therefore I need to build libqasan with gcc-musl, which results in the error:
invalid application of 'sizeof' to incomplete type 'FILE' at this line:
https://github.com/AFLplusplus/AFLplusplus/blob/edaf3ad04d64185cae856c75ca4676cbb14a35b5/qemu_mode/libqasan/hooks.c#L213
Apparently in musl, FILE is opaque per the C standard, only glibc exposes its full definition. The best patch I found for this issue would be to do:
#ifdef __GLIBC__
#define QASAN_FILE_CHECK_SIZE sizeof(FILE)
#else
#define QASAN_FILE_CHECK_SIZE sizeof(void *)
#endifNot sure if the wrong size cause issue. AI says if it is lower, it wont cause false positive, but I don't know we can trust it. What do you think ?
Source: AFLplusplus/AFLplusplus