I am looking at starting a project to make a toy language that is targeted purely at 64bit windows. I have never used llvm or anything like it i am just trying to learn new things. However there are several problems, as far as i have seen, with compiling llvm in 64bit on windows. So i was wondering if i compile a 32bit version of llvm and use that can my resulting compiler output 64bit binaries? Secondary question, should i use mingw or msvc to build llvm and my compiler? i would like to use cygwin mingw but i think that still makes the resulting binaries require cygwin1.dll but not sure if there is a way to get out of that. EDIT: To clarify i dont mind if i have to use cygwin (normal cygwin gcc or mingw) solong as the binary my compiler outputs does not require cygwin1.dll then i am happy. The compiler requiring cygwin1.dll is not so much of a problem for me i just want my toy language/compiler to be win64 binaries that do not require the cygwin1.dll. -- View this message in context: http://llvm.1065342.n5.nabble.com/llvm-32bit-with-64bit-output-tp52769.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
You can generate 64-bit binaries with a 32-bit LLVM without any issue. The target machine in your case may differ from the "host target", but it shouldn't be any problem. I have managed to compile LLVM on Windows using the compiler from Windows 7 SDK (and CMake). I don't remember what runtime binaries it required, but I guess it was the regular MSVC runtime. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
At the moment i have set up cygwin using its llvm package to learn with and, as i prefer developing in that unix style environment and using the command line i will stick with that for a bit. Since you say a 32bit llvm can generate 64bit binaries i also assume that they shouldnt require the cygwin runtime (cygwin1.dll) but if it does i could at that point switch to mingw with cygwin hopefully or if all else fails msvc. Just so long as i can output the binaries i want, standalone 64bit binaries, i dont mind what compiler toolchain or environment i use. However i do prefer cygwin for now cause its easy and unix like unless it shoots me in the foot with cygwin1.dll requirements. Not sure if i will be able to make a compiler that will be able to have a winmain to run the resulting binaries of my language without a console if asked. But that is way way ahead of me haha, sorry. I digress. Thanks Krysztof, it is very good to know finally so i can start working in my little project. -- View this message in context: http://llvm.1065342.n5.nabble.com/llvm-32bit-with-64bit-output-tp52769p52771.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
2012/12/21 Flexicat01 <nekroze.lives at gmail.com>:> I am looking at starting a project to make a toy language that is targeted > purely at 64bit windows. I have never used llvm or anything like it i am > just trying to learn new things. > > However there are several problems, as far as i have seen, with compiling > llvm in 64bit on windows. So i was wondering if i compile a 32bit version of > llvm and use that can my resulting compiler output 64bit binaries?It would be possible with targetting x86_64-w64-mingw32, if you live on cygwin or mingw-w64. Note, JIT would not work with i686 binary. You shall build llvm with x64 compilers (msvc x64, x86_64-w64-mingw32-g++) if you would use x64 JIT. Currently, you will need x86_64-w64-mingw32's binutils, esp, ld.exe. "LLVM" does not have linker driver or such. You will need to invoke ld.exe in your application. Depends on which host your application is built, cygwin, i686-mingw, x86-64-mingw; - Seek "mingw-w64" - Install mingw-w64 binutils on cygwin. You may find x86_64-w64-mingw32-ld.exe then.> Secondary question, should i use mingw or msvc to build llvm and my > compiler? i would like to use cygwin mingw but i think that still makes the > resulting binaries require cygwin1.dll but not sure if there is a way to get > out of that.Theologically, llvm can be built for i686-mingw32 (free from cygwin1.dll) on cygwin, like cross build. I have not tried on cygwin. /path/to/configure --host=i686-pc-mingw32 --build=i686-pc-cygwin You may also try "MSYS", targetting for i686-mingw32, like subset of cygwin.> EDIT: To clarify i dont mind if i have to use cygwin (normal cygwin gcc or > mingw) solong as the binary my compiler outputs does not require cygwin1.dll > then i am happy. The compiler requiring cygwin1.dll is not so much of a > problem for me i just want my toy language/compiler to be win64 binaries > that do not require the cygwin1.dll.As I mentioned above, you would need x64 JIT (built with x64) or x64-aware linker. In most cases, generated binaries would not need cygwin1.dll, but some runtime libraries. I suggest you to play with x86_64-w64-mingw32-gcc.exe on cygwin, at first. ps. personally, I have not tested x86_64-mingw32 for one year. I am afraid if it might be broken. ...Takumi
I did try the cygwin mingw-x86_64 but i couldn't get llvm to compile, but i did try and compile clang and compiler_rt as well, may have to try again soon. On windows i'm not interesting in i686 or any 32 bit compiling just 64 bit alone but i don't need a jit anyways for my language. If i use the cygwin environment to build llvm do i have to use cmake or can i use the standard configure scripts and make off of that. I know that cmake can output msys and mingw makefiles but i thought they where for msys shells and mingw being used from the windows command prompt, whereas cygwin being a more or less complete posix environment emulation im not sure if it needs cmake or which make system to output. -- View this message in context: http://llvm.1065342.n5.nabble.com/llvm-32bit-with-64bit-output-tp52769p52855.html Sent from the LLVM - Dev mailing list archive at Nabble.com.