diff options
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 8 | ||||
-rw-r--r-- | tools/lto/LTOCodeGenerator.cpp | 7 | ||||
-rw-r--r-- | tools/lto/LTOModule.cpp | 7 |
3 files changed, 14 insertions, 8 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index a7434938b4..c48965cf93 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -1610,14 +1610,6 @@ bool BitcodeReader::ParseModule(bool Resume) { std::string S; if (ConvertToString(Record, 0, S)) return Error("Invalid MODULE_CODE_TRIPLE record"); - - // @LOCALMOD-BEGIN - // This hack is needed in order to get Clang compiled binaries - // working with the Gold plugin, until PNaCl backend is introduced - // in lib/Target/PNaCl. - if (S == "le32-unknown-nacl") - S = "armv7-none-linux-gnueabi"; - // @LOCALMOD-END TheModule->setTargetTriple(S); break; } diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 57e7a2d07f..68956525c0 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -225,6 +225,13 @@ bool LTOCodeGenerator::determineTarget(std::string& errMsg) { return false; std::string TripleStr = _linker.getModule()->getTargetTriple(); + // @LOCALMOD-BEGIN + // Pretend that we are ARM for name mangling and assembly conventions. + // https://code.google.com/p/nativeclient/issues/detail?id=2554 + if (TripleStr == "le32-unknown-nacl") { + TripleStr = "armv7a-none-nacl-gnueabi"; + } + // @LOCALMOD-END if (TripleStr.empty()) TripleStr = sys::getDefaultTargetTriple(); llvm::Triple Triple(TripleStr); diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index fce0bb062a..0263e31c8b 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -280,6 +280,13 @@ LTOModule *LTOModule::makeLTOModule(MemoryBuffer *buffer, } std::string TripleStr = m->getTargetTriple(); + // @LOCALMOD-BEGIN + // Pretend that we are ARM for name mangling and assembly conventions. + // https://code.google.com/p/nativeclient/issues/detail?id=2554 + if (TripleStr == "le32-unknown-nacl") { + TripleStr = "armv7a-none-nacl-gnueabi"; + } + // @LOCALMOD-END if (TripleStr.empty()) TripleStr = sys::getDefaultTargetTriple(); llvm::Triple Triple(TripleStr); |