This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
[Bug] Support compiling a multimodule package with entry functions in multiple modules #369
Labels
bug
Something isn't working
🐛 Bug multiple entrypoint glue functions are generated for a single multimodule package
The current implementation of entrypoint glue code assumes all entry functions are located in a single module of a Move package. If multiple modules contain entry functions, multiple conflicting entrypoint glue functions will be generated.
To reproduce
An example package is located at language/solana/examples/multimodule
$ cargo run --features solana-backend -p move-cli --bin move -- build --arch solana -p language/solana/examples/multi_module Running `target/debug/move build --arch solana -p language/solana/examples/multi_module` COMPILING MoveStdlib, multi_module to SOLANA linking with lld failed. stderr: ld.lld: error: duplicate symbol: main >>> defined at modules.move >>> ./build/solana/multi_module/0x7__B.o:(main) >>> defined at modules.move >>> ./build/solana/multi_module/0x7__A.o:(.text+0x180) Failed to compile Move into SOLANA ERROR Error: linking with lld failed. stderr: ld.lld: error: duplicate symbol: main >>> defined at modules.move >>> ./build/solana/multi_module/0x7__B.o:(main) >>> defined at modules.move >>> ./build/solana/multi_module/0x7__A.o:(.text+0x180)
Expected Behavior
A single entrypoint glue function is generated that can route calls to entry functions in proper modules.
Additional context
This is necessary for resolving issue #161.
The text was updated successfully, but these errors were encountered: