[llvm-commits] [PATCH] Re-introduce llvm::sys::getHostTriple() function.

Sebastian Pop spop at codeaurora.org
Sun Dec 30 13:22:28 PST 2012


  Peter Collingbourne wrote:
  > In r143502, we renamed getHostTriple() to getDefaultTargetTriple()
  > as part of work to allow the user to supply a different default
  > target triple at configure time.  This change also affected the JIT.
  > However, it is inappropriate to use the default target triple in the
  > JIT in most circumstances because this will not necessarily match
  > the host architecture, leading to illegal instruction and other such
  > errors at run time.
  >
  > Reintroduce the getHostTriple() function for use in the JIT and its
  > clients, and cause the JIT to use it.  At the same time, fix JIT
  > for the 32-on-64-bit (and vice versa) build on non-Apple platforms
  > by causing getHostTriple() to change the architecture variant if
  > necessary.
  >
  > In this email thread:
  > http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120102/134416.html
  > an objection was raised against a similar patch on the grounds
  > that the JIT could deliberately be used to compile binaries for a
  > different architecture.  However, the normal usage scenario for the
  > JIT is that the code is being compiled and run on the same machine,
  > and if the client is doing anything out of the ordinary it should
  > know the target architecture (which would not necessarily match the
  > default target architecture) and set up the target triple itself.
  >

  Your patch looks good to me.  Please wait for Joerg to comment on your patch
  before committing.

  Thanks,
  Sebastian

http://llvm-reviews.chandlerc.com/D254



More information about the llvm-commits mailing list