Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Compiler and `midenc`

- Support duplicate function names in the Wasm name section, which might occur for Wasm generated
by rustc for the Miden target. Functions with a duplicated name get a unique linkage name while
debug info keeps the original source name. DWARF subprograms with a duplicated name resolve to
their function through `DW_AT_low_pc` instead of the ambiguous name.
- Honor Wasm function export names as primary HIR linkage symbols, exposing exported functions
under their exact export name for linkage and CLI entrypoint resolution while retaining raw
name-section names for source metadata and debug info.

## [0.10.1]

### Compiler and `midenc`
Expand Down
24 changes: 22 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ cranelift-entity = "0.135"
compact_str = { version = "0.9", default-features = false }
darling = { version = "0.23", features = ["diagnostics"] }
flate2 = "1.1"
gimli = { version = "^0.33", default-features = false }
hashbrown = { version = "0.17", features = ["nightly"] }
Inflector = "0.11"
intrusive-collections = "0.10"
Expand Down
4 changes: 2 additions & 2 deletions examples/auth-component-no-auth/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/auth-component-rpo-falcon512/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/basic-wallet-tx-script/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/basic-wallet/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/counter-contract/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/counter-note/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/p2id-note/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/p2id-tx-script/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/p2ide-note/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/storage-example/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion frontend/wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ std = ["wasmparser/std", "gimli/std", "midenc-hir-symbol/std", "dep:wasmprinter"
anyhow.workspace = true
addr2line = "^0.26"
cranelift-entity.workspace = true
gimli = { version = "^0.33", default-features = false, features = ['read'] }
gimli = { workspace = true, features = ["read"] }
indexmap = "2.7"
log.workspace = true
miden-core.workspace = true
Expand All @@ -43,3 +43,7 @@ wasmprinter = { workspace = true, optional = true }
# NOTE: Use local paths for dev-only dependency to avoid relying on crates.io during packaging
wat.workspace = true
midenc-expect-test = { path = "../../tools/expect-test" }
# Tests need the `write` feature to synthesize DWARF
gimli = { workspace = true, features = ["read", "write"] }
# Matching the wasmparser/wasmprinter pinned in the workspace
wasm-encoder = "^0.248"
4 changes: 2 additions & 2 deletions frontend/wasm/src/component/translator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,7 @@ mod tests {
.find_module(SymbolName::intern("main"))
.expect("main module should be translated");
let start = ModuleBuilder::new(main)
.get_function("actual-start")
.get_function("aliased-start")
.expect("actual start definition should be translated");
assert!(
start
Expand All @@ -1492,7 +1492,7 @@ mod tests {
.find_module(SymbolName::intern("main"))
.expect("main module should be translated");
let start = ModuleBuilder::new(main)
.get_function("actual-start")
.get_function("aliased-start")
.expect("actual start definition should be translated");
assert!(
start
Expand Down
4 changes: 3 additions & 1 deletion frontend/wasm/src/module/build_ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ pub fn build_ir_module(
}

let func_index = parsed_module.module.func_index(defined_func_idx);
let func_name = parsed_module.module.func_name(func_index).as_str();
let func_name = parsed_module.module.source_func_name(func_index).as_str();

// Try to parse the function name as a MASM function ident to get the symbol path
let Ok(func_ident) = FunctionIdent::from_str(func_name) else {
Expand Down Expand Up @@ -214,8 +214,10 @@ pub fn build_ir_module(

// If this is a linker stub that needs a synthesized body (function-type intrinsics,
// module-context stubs, or Miden ABI calls), handle it here.
let source_name = parsed_module.module.source_func_name(func_index);
if maybe_lower_linker_stub(
function_ref,
source_name,
&body_data.body,
module_state,
parsed_module.component_frontend_metadata.as_ref(),
Expand Down
Loading
Loading