Skip to content
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

Closed
dmakarov opened this issue Sep 16, 2023 · 0 comments 路 Fixed by #374
Closed
Labels
bug Something isn't working

Comments

@dmakarov
Copy link
Collaborator

馃悰 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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant