Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LLVM16: Stub code not inserted into contracts #329

Closed
Tracked by #325
ericpassmore opened this issue Jan 5, 2025 · 5 comments
Closed
Tracked by #325

LLVM16: Stub code not inserted into contracts #329

ericpassmore opened this issue Jan 5, 2025 · 5 comments
Assignees

Comments

@ericpassmore
Copy link
Contributor

After upgrading to LLVM16, cdt and related tools compile; however tests do not pass. Was able to a token transfer to compile by adding EOSIO_DISPATCH macro. See transfer example.

Therefore it seems likely that CDT is not inserting the C stub code with the apply function before compiling the contract to WASM.

@ericpassmore
Copy link
Contributor Author

steps-5.0.txt

@ericpassmore
Copy link
Contributor Author

ericpassmore commented Jan 6, 2025

llvm/lib/Transforms/EosioApply/EosioApply.cpp is not getting called for any functions. Need to correctly incorporate this transform.

Everything seems ok, from reading Doc on creating LLVM passes with Legacy Pass Manager, https://releases.llvm.org/16.0.0/docs/WritingAnLLVMPass.html

Looking at options from included steps-5.0.txt can see that clang-tool and clang-16 are calling -load. This seems correct.

"-load" "/local/eosnetworkfoundation/repos/antelope/cdt/build/bin/LLVMEosioApply.so"

@ericpassmore
Copy link
Contributor Author

New Pass Manager helped. Now passing 19 of 21 tests. Toolchain tests are failing.
tool_chain_tests.log

@ericpassmore
Copy link
Contributor Author

Resolved by moving to New Pass manager library (mixin class), and explicitly adding llvmGetPassPluginInfo to EosioApply.exports and EosioSoftfloat.exports

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant