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

x86 support #30

Open
Trass3r opened this issue Sep 18, 2019 · 10 comments
Open

x86 support #30

Trass3r opened this issue Sep 18, 2019 · 10 comments
Labels
x86-32 Related to raising x86-32 binaries

Comments

@Trass3r
Copy link
Contributor

Trass3r commented Sep 18, 2019

Just curious, any plans for 32bit support?
Seems like the calling convention is hard-coded in X86RegisterUtils.

@aaronsm
Copy link
Contributor

aaronsm commented Sep 19, 2019

For Intel we decided to go for x64 support. No plans for x32 right now but I agree it would be an interesting target to look at.

@Trass3r
Copy link
Contributor Author

Trass3r commented Sep 19, 2019

I see, is it even feasible or are there many hidden hard-coded assumptions?

@aaronsm
Copy link
Contributor

aaronsm commented Sep 20, 2019

It's definitely feasible. The disassembler is coming from LLVM which works for x32 so getting MCInst out is no problem. Once you have MCInst it's going to be different but the basic framework is there to follow.

@Necrolis
Copy link

Is there a road map of planned features or support? Might be helpful to those wanting to contribute to the project.

I personally would love to see Win PE/COFF and x86 support, and will likely tinker around with this project to see if I can get it compiling cleanly under Windows/VS and at least add COFF support. Even having a basic layout or flow of the internals would aid in grokking the internals a bit better.

@Trass3r
Copy link
Contributor Author

Trass3r commented Sep 20, 2019

Yes it compiles cleanly on Windows since it's just llvm. But it takes up to an hour.
You may use WSL to generate Linux test binaries.

@Necrolis
Copy link

@Trass3r might be helpful to get a wiki page on getting this working under Windows, though those compile times are a bit of a knock. Have you tried using incremental compilation to get them to more reasonable amounts?

@Trass3r
Copy link
Contributor Author

Trass3r commented Sep 20, 2019

It's all in the readme, though a bit convoluted. You can use the Visual Studio or Ninja generator.
I think it's like half an hour for a full build of only mctoll and an hour if you build clang. That's llvm 😅. They don't support PCH/modules or shared libraries on Windows.
Incremental builds are faster of course.

@Necrolis
Copy link

Necrolis commented Sep 20, 2019

@Trass3r I'm actually currently going through that (waiting for LLVM to clone), but one can immediately see that the readme would only work under WSL, where as I am talking under the native windows environment (though it doesn't much adaptation). Just nice to have a "Build Instructions (Windows)" section :)

They don't support PCH/modules or shared libraries on Windows.

I assume by "they" you mean LLVM? I find that strange as I did have LLVM 4.x compiling both as a shared lib and static lib quite a while ago. I dunno how much has changed since then given that we are now at LLVM 9.x

@Trass3r
Copy link
Contributor Author

Trass3r commented Sep 20, 2019

Make sure to do a shallow clone -b master --depth 1.
Building llvm's components as shared libs never worked on Windows. If you mean libllvm with the c api, that's something else.
But we are diverging.

@Necrolis
Copy link

Make sure to do a shallow clone -b master --depth 1.

Bit late for that, I am unfortunately not a git guru...

I opened #37 for this seeing as this now more about windows support than x86 support.

@bharadwajy bharadwajy added the x86-32 Related to raising x86-32 binaries label Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
x86-32 Related to raising x86-32 binaries
Projects
None yet
Development

No branches or pull requests

4 participants