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

Building with LLVM=1 #78

Open
pitust opened this issue Apr 29, 2020 · 5 comments
Open

Building with LLVM=1 #78

pitust opened this issue Apr 29, 2020 · 5 comments

Comments

@pitust
Copy link

pitust commented Apr 29, 2020

How to do this?

@shinh
Copy link
Owner

shinh commented May 1, 2020

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

elvm/Makefile

Line 238 in bb1c1a1

CMD = llvm-build/bin/clang -g -std=c99 -m32 -target elvm-unknown-linux-gnu -emit-llvm -S -include libc/_builtin.h -I. -Ilibc -Iout -o $1.tmp $2 && mv $1.tmp $1
and llc -march=elvm -asm-verbose should be able to produce eir.

@pitust
Copy link
Author

pitust commented May 24, 2020

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
Copy link
Author

pitust commented May 24, 2020

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
Copy link
Author

pitust commented May 24, 2020

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

@pitust
Copy link
Author

pitust commented May 24, 2020

I may not have had backends enabled too.

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

2 participants