[llvm-commits] [PATCH] [Review Request] Support for generating ELF objects on Windows

Kaylor, Andrew andrew.kaylor at intel.com
Tue Oct 2 11:46:13 PDT 2012


Committed as r165030.

From: Jim Grosbach [mailto:grosbach at apple.com]
Sent: Tuesday, October 02, 2012 10:32 AM
To: Kaylor, Andrew
Cc: llvm-commits; Chris Lattner; 'NAKAMURA Takumi'
Subject: Re: [llvm-commits] [PATCH] [Review Request] Support for generating ELF objects on Windows

This seems fine to me. Thanks!

-Jim

On Oct 1, 2012, at 4:54 PM, "Kaylor, Andrew" <andrew.kaylor at intel.com<mailto:andrew.kaylor at intel.com>> wrote:


Ping.

From: llvm-commits-bounces at cs.uiuc.edu<mailto:llvm-commits-bounces at cs.uiuc.edu> [mailto:llvm-commits-bounces at cs.uiuc.edu<mailto:commits-bounces at cs.uiuc.edu>] On Behalf Of Kaylor, Andrew
Sent: Thursday, September 20, 2012 6:13 PM
To: llvm-commits
Subject: [llvm-commits] [PATCH] [Review Request] Support for generating ELF objects on Windows

This patch extends the handling of the environment field of the target triple to look for the value "elf" to override the default object format on platforms where ELF is not the default.  (A similar behavior was already in place for MachO.)  I'm only using this environment specifier for x86 targets.  If it is useful elsewhere, the changes to use it will probably be trivial.

In earlier e-mails I discussed the possibility of a more general solution, but Chris Lattner indicated that his preference long term would be to redesign the way targets are specified and so a minimal approach would be acceptable to get ELF on Windows working now.

The intended use of this extension is to enable the use of MCJIT on Windows.  I have modified the MCJIT execution engine tests to use the '-mtriple' command line option when invoking lli, adding '-elf' to the default target triple if the target triple OS is Windows.   This may be useful for MinGW32 and Cygwin also, but I left those as unsupported by the MCJIT tests because I wasn't clear what the expected behavior in those cases would be.

In order to get lli to use the '-mtriple' command line option, I had to modify the EngineBuild::selectTarget method because it had been ignoring requested triples and always using the default host triple.  I modified this so that if the engine being built is MCJIT, it will use the target triple specified in the Module being built.  If the engine is not MCJIT, it continues to use the host triple since cross platform execution isn't possible with JIT and Interpreter and (I think) the environment isn't needed.

The MCJIT tests will not work in cross compilation cases.  I attempted to detect OS and architecture mismatches between the host and the target in the MCJIT lit.local.cfg file, but differences in the way these are represented at that level made it a much bigger problem than I was prepared to take on.  I am hopeful that the conditions under which the tests are skipped will be sufficient to prevent buildbot problems.

-Andy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121002/b5f4138f/attachment.html>


More information about the llvm-commits mailing list