Alexander Benikowski via llvm-dev
2017-Sep-19 17:09 UTC
[llvm-dev] What is the correct Targettripple for generating a X86 COFF-Files on windows?
Just got started and stuck at the same time. Working with the C-Api, i have come to the point where i want to emit a binary file for my module. I queried the X86-Target and called LLVMCreateTargetMachine this way:> LTarget := LLVMGetTargetFromName('x86'); > LMachine := LLVMCreateTargetMachine(LTarget, 'i386-win32-msvc', nil, > nil, LLVMCodeGenLevelDefault, LLVMRelocDefault, LLVMCodeModelDefault); >A call to LLVMTargetMachineEmitToFile using LLVMObjectFile does output a obj-file. But it seems it is an ELF-File. Looking through the code(and looking into the Tripple.cpp) i am not sure what to do exactly for creating a COFF-File. Best regards Alexander B. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170919/8a549954/attachment.html>
Alexander Benikowski via llvm-dev
2017-Sep-19 17:12 UTC
[llvm-dev] What is the correct Targettripple for generating a X86 COFF-Files on windows?
Prior to "win32" i used "windows" 2017-09-19 19:09 GMT+02:00 Alexander Benikowski <sebal007 at googlemail.com>:> Just got started and stuck at the same time. Working with the C-Api, i > have come to the point where i want to emit a binary file for my module. I > queried the X86-Target and called LLVMCreateTargetMachine this way: > >> LTarget := LLVMGetTargetFromName('x86'); >> LMachine := LLVMCreateTargetMachine(LTarget, 'i386-win32-msvc', >> nil, nil, LLVMCodeGenLevelDefault, LLVMRelocDefault, LLVMCodeModelDefault); >> > > A call to LLVMTargetMachineEmitToFile using LLVMObjectFile does output a > obj-file. But it seems it is an ELF-File. Looking through the code(and > looking into the Tripple.cpp) i am not sure what to do exactly for creating > a COFF-File. > > Best regards > Alexander B. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170919/5ae28718/attachment.html>
Alexander Benikowski via llvm-dev
2017-Sep-19 19:00 UTC
[llvm-dev] What is the correct Targettripple for generating a X86 COFF-Files on windows?
Okay after some more searching, i finally solved it: i386-pc-win32-coff https://clang.llvm.org/docs/CrossCompilation.html 2017-09-19 19:12 GMT+02:00 Alexander Benikowski <sebal007 at googlemail.com>:> Prior to "win32" i used "windows" > > 2017-09-19 19:09 GMT+02:00 Alexander Benikowski <sebal007 at googlemail.com>: > >> Just got started and stuck at the same time. Working with the C-Api, i >> have come to the point where i want to emit a binary file for my module. I >> queried the X86-Target and called LLVMCreateTargetMachine this way: >> >>> LTarget := LLVMGetTargetFromName('x86'); >>> LMachine := LLVMCreateTargetMachine(LTarget, 'i386-win32-msvc', >>> nil, nil, LLVMCodeGenLevelDefault, LLVMRelocDefault, LLVMCodeModelDefault); >>> >> >> A call to LLVMTargetMachineEmitToFile using LLVMObjectFile does output a >> obj-file. But it seems it is an ELF-File. Looking through the code(and >> looking into the Tripple.cpp) i am not sure what to do exactly for creating >> a COFF-File. >> >> Best regards >> Alexander B. >> > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170919/e6984a22/attachment.html>
Reasonably Related Threads
- What is the correct Targettripple for generating a X86 COFF-Files on windows?
- invalid code generated on Windows x86_64 using skylake-specific features
- invalid code generated on Windows x86_64 using skylake-specific features
- invalid code generated on Windows x86_64 using skylake-specific features
- [LLVMdev] API on JIT, code snippets