Symcc runtime docsrs fix (#270)

* add symcc as submodule

* make build script docs.rs aware

* bump version of symcc_runtime
This commit is contained in:
julihoh 2021-08-23 09:55:13 +02:00 committed by GitHub
parent fccb9a1c55
commit bdd1412fc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 6 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "libafl_concolic/symcc_runtime/symcc"]
path = libafl_concolic/symcc_runtime/symcc
url = ../symcc.git

View File

@ -1,6 +1,6 @@
[package]
name = "symcc_runtime"
version = "0.1.0"
version = "0.1.1"
edition = "2018"
authors = ["Julius Hohnerlein <julihoh@users.noreply.github.com>", "Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
description = "Build Concolic Tracing tools based on SymCC in Rust"

View File

@ -66,7 +66,9 @@ fn main() {
write_symcc_runtime_bindings_file(&out_path, &cpp_bindings);
write_cpp_function_export_macro(&out_path, &cpp_bindings);
if std::env::var("CARGO_FEATURE_NO_CPP_RUNTIME").is_err() {
if std::env::var("CARGO_FEATURE_NO_CPP_RUNTIME").is_err()
&& std::env::var("DOCS_RS").is_err()
{
let rename_header_path = out_path.join("rename.h");
write_symcc_rename_header(&rename_header_path, &cpp_bindings);
build_and_link_symcc_runtime(&symcc_src_path, &rename_header_path);
@ -105,12 +107,16 @@ fn write_cpp_function_export_macro(out_path: &Path, cpp_bindings: &bindgen::Bind
}
fn checkout_symcc(out_path: &Path) -> PathBuf {
if std::env::var("DOCS_RS").is_ok() {
"symcc".into()
} else {
let repo_dir = out_path.join("libafl_symcc_src");
if !repo_dir.exists() {
clone_symcc(&repo_dir);
}
repo_dir
}
}
fn write_rust_runtime_macro_file(out_path: &Path, symcc_src_path: &Path) {
let rust_bindings = bindgen::Builder::default()

@ -0,0 +1 @@
Subproject commit 45cde0269ae22aef4cca2e1fb98c3b24f7bb2984