Skip to content

Move sancov_cmp.c into sancov_cmp.rs #1937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
addisoncrump opened this issue Mar 14, 2024 · 3 comments
Closed

Move sancov_cmp.c into sancov_cmp.rs #1937

addisoncrump opened this issue Mar 14, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@addisoncrump
Copy link
Collaborator

sancov_cmp.c does not need to be written in C; we can port this to Rust to unify our codebase some.

Moreover, this addresses some strange linkage behaviour we've been seeing for some time that affects linkage against targets from a .a. I re-encountered this while building an example for #1904 which prevented some symbols from being globally visible when using LibAFL as a .so. Version scripts, visibility attributes, and other strategies did not resolve this, so I think Rust does something internally here to enforce that only Rust-defined symbols are globally visible.

Related, I think we can and should move the other C files in libafl_targets to Rust; most of this code is copied from historical versions of AFL++ and could be written more effectively/idiomatically for Rust.

@addisoncrump addisoncrump added enhancement New feature or request help wanted Extra attention is needed labels Mar 14, 2024
@addisoncrump
Copy link
Collaborator Author

cc @domenukk, @andreafioraldi for input here.

@addisoncrump
Copy link
Collaborator Author

bump @domenukk, @andreafioraldi: can we consider converting all C sources to Rust for the major refactor, where possible/appropriate? There's a lot of legacy code hanging around that could be improved.

@andreafioraldi
Copy link
Member

andreafioraldi commented Mar 28, 2024 via email

@tokatoka tokatoka closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants