elvm icon indicating copy to clipboard operation
elvm copied to clipboard

Building with LLVM=1

Open pitust opened this issue 5 years ago • 5 comments

How to do this?

pitust avatar Apr 29 '20 10:04 pitust

I don't remember the exact step, but here's the branches:

https://github.com/shinh/elvm/tree/llvm https://github.com/shinh/llvm/tree/elvm https://github.com/shinh/clang/tree/elvm

It seems my copies of them were set up like:

elvm/llvm: the elvm branch of llvm elvm/llvm/tools/clang: the elvm branch of clang elvm/llvm-build: the build directory of llvm

To build the LLVM&clang for the ELVM target, you may perhaps need to set -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=ELVM to cmake

If clang and llc is built, I think https://github.com/shinh/elvm/blob/bb1c1a1bcc2359f797bf600abdf3ee2fa34af4c6/Makefile#L238 and llc -march=elvm -asm-verbose should be able to produce eir.

shinh avatar May 01 '20 08:05 shinh

Ok, I built llvm, but the output has weird call instructions that are (understandably) not parsed correctly. But they are parsed in the llvm branch, except that i don't have a clang built along with my LLVM so i need to use my system one (which is clang 9) but the LLVM in your fork is LLVM 4, so there are syntax errors on dso_local, which i can just replace out and it builds.

pitust avatar May 24 '20 12:05 pitust

why is is so confusing? call intructions aren't used in the normal thing, and for some backends, they don't even work. Fortunatly, for my use case, the only one i care about is the JS backend.

pitust avatar May 24 '20 12:05 pitust

call and ret are just lowered? That is really confusing.

pitust avatar May 24 '20 14:05 pitust

I may not have had backends enabled too.

pitust avatar May 24 '20 14:05 pitust