- Fix C standard library to include only reentrant versions of functions
- Use a version of solana_rbpf with fixed relocations handling
- Add a test of using C standard library functions in on-chain program
The program_id is not needed on "Program return data: " because it
always preceeded by the program invoke message, so no need to repeat
the program id. Also rename this to "Program return: " since "data"
is redundant.
rustc default compiler optimization level is O3. This change removes
the option that overrides the default optimization level, because it
is safe to do so. The code generation is incorrect in some cases
because of link-time optimizations, which remain disabled for
compiling BPF programs. In addition, this commit updates the expected
instruction counts for assert_instruction_count test.
When the input contains more accounts than the user has requested to be deserialized, and one of the excess ones is a dup, the input pointer is not adjusted correctly.
Compare the lines added by this commit to line 401: "input += 7; // padding". Since the input data layout does not depend on the number of accounts the user wants to deserialize, this adjustment by 7 bytes must happen in both branches.
The readelf utility (already shipped with the solana tools) shows meta-information about ELF files, such as symbol tables. It is useful for investigating "unresolved symbol" errors that crop up at runtime.
This commit also fixes the objdump flags (two dashes are required and there is no "color" option) as well as a few typos.
Some syscalls are wrongly declared "static" in solana_sdk.h, which makes clang++ assume they are local to the compilation unit. It therefore ignores the extern "C" {} block and mangles their names. While that doesn't break C++ compilation, the syscall fails at runtime with something along the lines of "ELF error: Unresolved symbol (_ZL26sol_create_program_addressPK13SolSignerSeediPK9SolPubkeyS4_)".
The new version of bpf-tools eliminates the separate
rust-bpf-sysroot. The Rust standard libraries for the BPF target are
built in tree when the compiler is built. The standard libraries code
is slightly more optimized and some reduction of compute budget can be
expected with this version of bpf-tools.
* Bump bpf-tools to version v1.3
This brings in the fix for increased compute budget that wasn't caught
when bpf-tools v1.2 were released.
* Adjust BPF test programs instruction counts