[llvm-commits] [llvm] r160610 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp

Kaylor, Andrew andrew.kaylor at intel.com
Tue Sep 11 16:44:28 PDT 2012


Hi,

I realize that this is an old commit, but I just came across a problem related to this change and was hoping to enquire as to the rationale here.

It is possible to provide a target triple to lli via the '-mtriple' command line option.  However, as a result of the change below, the user specified triple gets ignored in favor of LLVM_HOSTTRIPLE.  This seems wrong.

I recognize that problems can arise if you try to use a target other than the default host triple with JIT or MCJIT.  However, with MCJIT it may be desirable to provide an environment string via the triple to generate MachO or ELF objects on platforms that wouldn't normally use those formats.  In particular, I am working on adding support for generating ELF objects on Windows (because COFF isn't supported by MCJIT).

The change below prevents that.  As such, I would like to revert this change, or at least modify this to pick-up the environment from the module's target triple.

Does that seem reasonable?

-Andy


-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu [mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of NAKAMURA Takumi
Sent: Saturday, July 21, 2012 8:05 PM
To: llvm-commits at cs.uiuc.edu
Subject: [llvm-commits] [llvm] r160610 - /llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp

Author: chapuni
Date: Sat Jul 21 22:04:57 2012
New Revision: 160610

URL: http://llvm.org/viewvc/llvm-project?rev=160610&view=rev
Log:
ExecutionEngine/TargetSelect.cpp: Override default triple as LLVM_HOSTTRIPLE.

In current implementation, JIT should run only on host.

Modified:
    llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp

Modified: llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp?rev=160610&r1=160609&r2=160610&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/TargetSelect.cpp Sat Jul 21 22:04:57 
+++ 2012
@@ -26,7 +26,7 @@
 using namespace llvm;
 
 TargetMachine *EngineBuilder::selectTarget() {
-  Triple TT(M->getTargetTriple());
+  Triple TT(LLVM_HOSTTRIPLE);
   return selectTarget(TT, MArch, MCPU, MAttrs);  }
 


_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list