diff options
author | Chris Lattner <sabre@nondot.org> | 2004-12-10 20:26:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-12-10 20:26:15 +0000 |
commit | 152f19ac6514ec29e183ddcdf2ea71599638dc4c (patch) | |
tree | b8f46042d07578922b5ec0c61df5dbadbff8b5ed /lib/Linker | |
parent | 6e5fcf18987022f1e54f0c0f06042fe59cc6d2a2 (diff) | |
download | external_llvm-152f19ac6514ec29e183ddcdf2ea71599638dc4c.zip external_llvm-152f19ac6514ec29e183ddcdf2ea71599638dc4c.tar.gz external_llvm-152f19ac6514ec29e183ddcdf2ea71599638dc4c.tar.bz2 |
Make sure to link the target-triple as well, so it ends up in the .llvm.bc file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18774 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Linker')
-rw-r--r-- | lib/Linker/LinkModules.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Linker/LinkModules.cpp b/lib/Linker/LinkModules.cpp index d58acbe..49d8de1 100644 --- a/lib/Linker/LinkModules.cpp +++ b/lib/Linker/LinkModules.cpp @@ -829,6 +829,8 @@ bool llvm::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) { Dest->setEndianness(Src->getEndianness()); if (Dest->getPointerSize() == Module::AnyPointerSize) Dest->setPointerSize(Src->getPointerSize()); + if (Dest->getTargetTriple().empty()) + Dest->setTargetTriple(Src->getTargetTriple()); if (Src->getEndianness() != Module::AnyEndianness && Dest->getEndianness() != Src->getEndianness()) @@ -836,7 +838,10 @@ bool llvm::LinkModules(Module *Dest, Module *Src, std::string *ErrorMsg) { if (Src->getPointerSize() != Module::AnyPointerSize && Dest->getPointerSize() != Src->getPointerSize()) std::cerr << "WARNING: Linking two modules of different pointer size!\n"; - + if (!Src->getTargetTriple().empty() && + Dest->getTargetTriple() != Src->getTargetTriple()) + std::cerr << "WARNING: Linking two modules of different target triples!\n"; + // Update the destination module's dependent libraries list with the libraries // from the source module. There's no opportunity for duplicates here as the // Module ensures that duplicate insertions are discarded. |