Hi guys, I was wondering about how I could use LLVM as a cross compiler. In my case, I want to make Windows binaries on Linux (Ubuntu). I've tried finding stuff about this, but I was unable. Anybody know?
14 replies to this topic
#1
Posted 06 November 2011 - 06:15 PM
Latinamne loqueris?
|
|
|
#2
Posted 06 November 2011 - 06:31 PM
What is LLVM?
#3
Posted 06 November 2011 - 07:41 PM
Assuming you DID do a Google search, I'll try to explain: it is a "compiler infrastructure". It has its backend, which uses its own assembly language like a virtual machine. It can run its assembly as a virtual machine as well, or compile it to native assembly. Frontends are made that take a language, such as C or C++, and outputs LLVM assembly. The assembly then can get processed by the backend.
Latinamne loqueris?
#4
Posted 06 November 2011 - 08:23 PM
So you want to build your own LLVM? Or does one already exist?
I mean, if one already exists, then why not use that? I just didn't exactly understand the original question.
I mean, if one already exists, then why not use that? I just didn't exactly understand the original question.
#5
Posted 06 November 2011 - 08:31 PM
No, I want to make a cross compiler. I already do have LLVM. I want to know how to retarget it.
---------- Post added at 12:31 AM ---------- Previous post was at 12:28 AM ----------
Wait, I think you are misunderstanding; LLVM is a project, comparable to GCC. You can't just "make" your own GCC, and the same goes for LLVM.
---------- Post added at 12:31 AM ---------- Previous post was at 12:28 AM ----------
Wait, I think you are misunderstanding; LLVM is a project, comparable to GCC. You can't just "make" your own GCC, and the same goes for LLVM.
Latinamne loqueris?
#6
Posted 06 November 2011 - 08:36 PM
Sorry, I have an assignment due tomorrow, so I'll work on that.
I'll look at LLVM later, and get back to this thread.
I'll look at LLVM later, and get back to this thread.
#7
Posted 07 November 2011 - 03:04 AM
You can freely cross compile LLVM itself (if what you have asked was really what you had meant) with the --host and --build options in the "configure" script for LLVM. If I recall it will not, however, care about pointer or byte orientation. If you compile on a 64-bit machine it may not work on a 32-bit system.
For Clang (i.e. cross-target compilation of binaries) there is a requirement of tool chains to be available, and those are not as of yet written, see: Clang - Universal Driver
It is a little late, hopefully I had understood what you have meant.
Alexander.
For Clang (i.e. cross-target compilation of binaries) there is a requirement of tool chains to be available, and those are not as of yet written, see: Clang - Universal Driver
It is a little late, hopefully I had understood what you have meant.
Alexander.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#8
Posted 07 November 2011 - 12:57 PM
Thank-you, so I guess the Clang toolchain isn't really made for that yet. Would I be able to get anywhere with llvm-gcc? Of course, in the end it may not work because my Linux installation is 64-bit and my Windows installation is 32-bit.
Latinamne loqueris?
#9
Posted 07 November 2011 - 03:10 PM
You still will not be able to write native assemblies for Windows. Technically you could write the intermediate representation, however that would still require interpretation on the other platform. Clang intends to try to replace the GNU compiler collections eventually, so it is possible.
If you wish to go the plain GCC route, there is already a project with a large footprint (MinGW), and I've written a guide on it:
http://forum.codecal...-compiling.html
If you wish to go the plain GCC route, there is already a project with a large footprint (MinGW), and I've written a guide on it:
http://forum.codecal...-compiling.html
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#10
Posted 07 November 2011 - 03:50 PM
Wait, so would it be possible to JUST use the MinGW binutils package, using it to do the actual assembling and linking?
---------- Post added at 07:50 PM ---------- Previous post was at 07:49 PM ----------
PS: thanks for that tut, I have been looking for a guide for using MinGW for cross-compiling.
---------- Post added at 07:50 PM ---------- Previous post was at 07:49 PM ----------
PS: thanks for that tut, I have been looking for a guide for using MinGW for cross-compiling.
Latinamne loqueris?
#11
Posted 07 November 2011 - 04:00 PM
The MinGW tool-chain would be required on the build system, as long as you have the i386-mingw32-gcc executable.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#12
Posted 07 November 2011 - 04:04 PM
What I mean is, use, say, LLVM-GCC and the required Windows libraries to compile to LLVM code, then put it through LLVM to get native assembly, then run it through MinGW as and ld to produce a Windows executable. I would never do this, it is just a question of whether it would actually be possible.
Latinamne loqueris?
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









