AFLplusplus / qemu-libafl-bridge

A patched QEMU that exposes an interface for LibAFL-based fuzzers
Other
57 stars 29 forks source link

Library doesn't build in default configuration #50

Closed vringar closed 6 months ago

vringar commented 6 months ago

I know this library is primarily designed to be built by this build.rs file but unfortunately we have to patch this library as part of our fuzzer and I'm currently trying to rebase our fork against the latest master. To establish a baseline I tried running mkdir build && cd build && ../configure && make but this runs into the following errror:

/usr/bin/ld: libblock.fa.p/block_block-backend.c.o: in function `blk_aio_read_entry':
/home/stefan/uni/master/asp-qemu/build/manual/../../block/block-backend.c:1677:(.text+0x2fea): undefined reference to `syx_snapshot_cow_cache_read_entry'
/usr/bin/ld: libblock.fa.p/block_block-backend.c.o: in function `blk_aio_write_entry':
/home/stefan/uni/master/asp-qemu/build/manual/../../block/block-backend.c:1698:(.text+0x3303): undefined reference to `syx_snapshot_cow_cache_write_entry'
collect2: error: ld returned 1 exit status

I think this is because syx_snapshot_cow_cache_write_entry is only defined if CONFIG_SOFTMMU is set, based on the following meson file https://github.com/AFLplusplus/qemu-libafl-bridge/blob/465f2c77af51113a854550944b05777b604a7a06/libafl_extras/meson.build#L1-L6 but afaict block-backend.c is built unconditionally (relevant meson.build line).

Is there any interest in modifying the configure script to set all required variables or is the canonical way to build through the build.rs script and additional modifications to this repo should be avoided?

rmalmain commented 6 months ago

Thank you for the detailed report! I'll push the fix very soon.

rmalmain commented 6 months ago

The patch is up, feel free to re-open the issue if you meet any other related problem.