Skip to content

Commit 4213d4b

Browse files
committed
disable always-inline check
1 parent e338c45 commit 4213d4b

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

dpdk-sys/build.rs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,12 +425,19 @@ impl State {
425425
let mut use_def_map = HashMap::new();
426426
let mut global_use_def_map = HashMap::new();
427427
let target_path = self.out_path.join("dpdk.h");
428-
let mut is_always_inline_fn: HashMap<String, bool> = HashMap::new();
428+
// let mut is_always_inline_fn: HashMap<String, bool> = HashMap::new();
429429
{
430430
let clang = clang::Clang::new().unwrap();
431431
let index = clang::Index::new(&clang, true, true);
432432
let trans_unit = self.trans_unit_from_header(&index, target_path, false);
433-
433+
// panic!(
434+
// "{:#?}",
435+
// trans_unit
436+
// .get_entity()
437+
// .get_children()
438+
// .into_iter()
439+
// .collect::<Vec<_>>()
440+
// );
434441
// Iterate through each EAL header files and extract function definitions.
435442
'each_function: for f in trans_unit
436443
.get_entity()
@@ -460,6 +467,7 @@ impl State {
460467
if clang::StorageClass::Static != storage || !(is_decl && is_inline_fn) {
461468
continue;
462469
}
470+
/*
463471
// println!("cargo:warning={} {} {} {}", name, f.has_attributes(), f.is_inline_function(), f.is_const_method());
464472
let mut success = true;
465473
let do_check;
@@ -497,7 +505,8 @@ impl State {
497505
.include_paths
498506
.iter()
499507
.map(|x| format!("-I{}", x.to_str().unwrap()));
500-
let libs = dpdk.libs.iter().map(|x| format!("-l{}", x));
508+
// let libs = dpdk.libs.iter().map(|x| format!("-l{}", x));
509+
// NOTE: do not link libs here. The point of below is to check compilation without symbols
501510
let ret: std::result::Result<std::process::Output, Error> =
502511
Command::new(cc_name.clone())
503512
.arg("-Wall")
@@ -511,24 +520,26 @@ impl State {
511520
.arg(format!("-D__CHECK_FN={}", name))
512521
.arg("-o")
513522
.arg(target_bin_path.clone())
514-
.args(libs)
523+
// .args(libs)
515524
.arg(test_template.clone())
516525
.output();
517526
if let Ok(ret) = ret {
518527
if ret.status.success() {
519528
success = true;
520-
// println!("cargo:warning={} compile success {}", name, success);
529+
println!("cargo:warning={} compile success {}", name, success);
530+
panic!("@@");
521531
} else {
522-
panic!("cargo:warning={:?} compile failed", ret);
532+
println!("cargo:warning={:?} compile failed", ret);
533+
panic!("@@@");
523534
}
524535
}
525536
is_always_inline_fn.insert(name.clone(), success);
526537
}
527538
if !success {
528-
println!("cargo:warning={} compile failed", name);
539+
// println!("cargo:warning={} compile failed", name);
529540
continue;
530541
}
531-
542+
*/
532543
// Extract type names in C and Rust.
533544
let c_return_type_string = return_type.get_display_name();
534545
let rust_return_type_string =

0 commit comments

Comments
 (0)