mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-04 00:54:36 +00:00
fix: calculate windows dll symbols from prebuilt shared library
This commit is contained in:
parent
b92d0ef315
commit
720ed2a457
5 changed files with 46 additions and 45 deletions
23
crates/linker/src/util.rs
Normal file
23
crates/linker/src/util.rs
Normal file
|
@ -0,0 +1,23 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use object::ObjectSymbol;
|
||||
|
||||
pub(crate) fn report_timing(label: &str, duration: Duration) {
|
||||
println!("\t{:9.3} ms {}", duration.as_secs_f64() * 1000.0, label,);
|
||||
}
|
||||
|
||||
fn is_roc_symbol(sym: &object::Symbol) -> bool {
|
||||
if let Ok(name) = sym.name() {
|
||||
name.trim_start_matches('_').starts_with("roc_")
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn is_roc_definition(sym: &object::Symbol) -> bool {
|
||||
sym.is_definition() && is_roc_symbol(sym)
|
||||
}
|
||||
|
||||
pub(crate) fn is_roc_undefined(sym: &object::Symbol) -> bool {
|
||||
sym.is_undefined() && is_roc_symbol(sym)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue