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

How to use this tool compile solidity/evm bytecode into llvm ir? #178

Open
ttiinn opened this issue Jul 23, 2018 · 7 comments
Open

How to use this tool compile solidity/evm bytecode into llvm ir? #178

ttiinn opened this issue Jul 23, 2018 · 7 comments

Comments

@ttiinn
Copy link

ttiinn commented Jul 23, 2018

Hi, sorry to bother.
I'm wonder is this the right way to use this tool?

~/evmjit/build/cpp-ethereum/build/test$ EVMJIT="-help" ./testeth --jit

I got some unexpected feedback

Running tests using path: "/home/user0/tests"
An unrecognized parameter in the argument jit

Usage: testeth [Boost.Test argument]... -- [custom test module argument]...

For detailed help on Boost.Test parameters use:
  testeth --help
or
  testeth --help=<parameter name>

The Readme file is a little difficult for me to understand. I'll be really appreciated if anyone can help.

@chfast
Copy link
Member

chfast commented Aug 31, 2018

EVMJIT="-help" ./testeth -- --vm jit

And use EVMJIT="-dump" to dump generated LLVM IR.

@ToolmanInside
Copy link

Hi, sorry to bother.
I'm wonder is this the right way to use this tool?

~/evmjit/build/cpp-ethereum/build/test$ EVMJIT="-help" ./testeth --jit

I got some unexpected feedback

Running tests using path: "/home/user0/tests"
An unrecognized parameter in the argument jit

Usage: testeth [Boost.Test argument]... -- [custom test module argument]...

For detailed help on Boost.Test parameters use:
  testeth --help
or
  testeth --help=<parameter name>

The Readme file is a little difficult for me to understand. I'll be really appreciated if anyone can help.

Hi~May i ask you how did you build this project? on x86 or x64? use visual studio 2015 or 2017? how about your building system(Linux or Win)?
Sorry for so many questions, i have some problem when i build and i want to check my environment : ).

@ttiinn
Copy link
Author

ttiinn commented Nov 9, 2018

Hi~May i ask you how did you build this project? on x86 or x64? use visual studio 2015 or 2017? how about your building system(Linux or Win)?
Sorry for so many questions, i have some problem when i build and i want to check my environment : ).

in linux.

EVMJIT is a submodule of testeth. You can build testeth with EVMJIT option on(open it in ../testeth/cmake/EthOptions.cmake)
Testeth build guide: https://github.com/ethereum/testeth

After build it successfully testeth is in the path: ../testeth/build/test

@ToolmanInside
Copy link

Hi~May i ask you how did you build this project? on x86 or x64? use visual studio 2015 or 2017? how about your building system(Linux or Win)?
Sorry for so many questions, i have some problem when i build and i want to check my environment : ).

in linux.

EVMJIT is a submodule of testeth. You can build testeth with EVMJIT option on(open it in ../testeth/cmake/EthOptions.cmake)
Testeth build guide: https://github.com/ethereum/testeth

After build it successfully testeth is in the path: ../testeth/build/test

Thx , it helped a lot. I have built the whole testeth, and it works when i type
EVMJIT="-help" ./testeth -- --vm jit
But actually i want to compile my own solidity bytecode into LLVM bitcode. I have searched testeth docs but it is difficult for me. Is there any way can set the compile path to my code?

@chfast
Copy link
Member

chfast commented Nov 14, 2018

I'm not sure what you want to do with that, but some important information.

  1. EVMJIT is not maintained any more, so you cannot build the latest Aleth with it.
  2. You could select evmjit in aleth-vm to execute any EVM bytecode: aleth-vm --vm jit.
  3. Combined with -dump flag you could print the LLVM IR code: EVMJIT=-dump aleth-vm --vm jit.
  4. You will not get 1 to 1 mapping of Solidity code. In the LLVM IR there is a lot of runtime helper functions and probably solidity also generates some additional EVM code even for empty contract.

@chfast
Copy link
Member

chfast commented Nov 14, 2018

You can also ask questions in https://gitter.im/ethereum/evmjit.

@Yogasree-Segar
Copy link

Hello, I wanted to convert my own etherum bytecode to llvm ir. Can you guide me about how to use this tool and the other tool - aleth mentioned in the above chat.

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

No branches or pull requests

4 participants