Open michprev opened 3 weeks ago
Is there a specific thing you're trying to accomplish here?
We are developing a coverage-guided fuzzer (https://github.com/Ackee-Blockchain/trident). For coverage analysis to work, we need to compile the target program with instrumentation (some extra very specific compiler options).
cargo build-sbf
does not give us an option to specify compiler options (most likely for a good reason). So our approach is to add the program being tested as a dependency, compile it in our own way and load it as a built-in via entry point.
cargo build-sbf does not give us an option to specify compiler options (most likely for a good reason)
fwiw I would not assume there is a good reason
The reason we are reluctant to add this is that the program stubs code is very hacky and cursed
Solana SDK syscall stubs are not currently implemented, see Solana program-test as a reference https://github.com/solana-labs/solana/blob/27eff8408b7223bb3c4ab70523f8a8dca3ca6645/program-test/src/lib.rs#L226, https://github.com/solana-labs/solana/blob/27eff8408b7223bb3c4ab70523f8a8dca3ca6645/program-test/src/lib.rs#L755.
This is an issue in the case when a program is added as buit-in (target OS is not Solana) and the program invokes a syscall.