send2vinnie / mclinker

Automatically exported from code.google.com/p/mclinker
Other
0 stars 0 forks source link

Test TestLinker, but can't use x86 triple to initialize #74

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.In unittest, use TestLinker.initialize("x86-none-linux-gnueabi"); 

What is the expected output? 
No error.

What do you see instead?
Cannot initialize mcld::Target for given triple `x86-none-linux-gnueabi.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by jerkkao@gmail.com on 25 Jul 2012 at 6:01

GoogleCodeExporter commented 9 years ago
When LLVM looks up target by triple "x86-none-linux-gnueabi", she will find "c" 
target. It seems that the bug is LLVM's duty.

Original comment by LubaTang on 25 Jul 2012 at 7:57

GoogleCodeExporter commented 9 years ago
In ${LLVM}/lib/Support/Triple.cpp:36

 18 const char *Triple::getArchTypeName(ArchType Kind) {
 19   switch (Kind) {
 20   case UnknownArch: return "unknown";
    ...
 34   case tce:     return "tce";
 35   case thumb:   return "thumb";
 36   case x86:     return "i386";
 37   case x86_64:  return "x86_64";
 38   case xcore:   return "xcore";

That is, LLVM only accept triple like i386-XXX. x86 is not accepted.

Original comment by LubaTang on 25 Jul 2012 at 8:16