Skip to content

Commit 19ad74a

Browse files
committed
Add rules for stdlib, rustls, and stdio
1 parent 8009afc commit 19ad74a

10 files changed

Lines changed: 3624 additions & 1 deletion

File tree

rule-preprocessor/src/semantic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn build_rustc_args(crate_root: &Path) -> Vec<String> {
4646
args.push("-L".to_string());
4747
args.push(format!("dependency={}", deps.display()));
4848

49-
for dep in &["libcc2rs", "libc", "brotli_sys"] {
49+
for dep in &["libcc2rs", "libc", "brotli_sys", "rustls_ffi"] {
5050
if let Some(rlib) = find_rlib(deps.as_path(), dep) {
5151
args.push("--extern".to_string());
5252
args.push(format!("{}={}", dep, rlib.display()));

rules/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ path = "src/lib.rs"
1212
libc = "0.2.148"
1313
libcc2rs = { version = "0.1.0", path = "../libcc2rs" }
1414
brotli-sys = "0.3"
15+
rustls-ffi = { version = "0.15.3", default-features = false }

rules/cstdlib/src.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,7 @@ void f9(void *base, size_t nmemb, size_t size,
2828
int (*compar)(const void *, const void *)) {
2929
return qsort(base, nmemb, size, compar);
3030
}
31+
32+
char *f10(const char *path, char *resolved_path) {
33+
return realpath(path, resolved_path);
34+
}

rules/cstdlib/tgt_unsafe.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ unsafe fn f9(
6464
>(a3 as *const ())),
6565
)
6666
}
67+
68+
unsafe fn f10(a0: *const u8, a1: *mut u8) -> *mut u8 {
69+
libc::realpath(a0 as *const i8, a1 as *mut i8) as *mut u8
70+
}

0 commit comments

Comments
 (0)