diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2008-12-12 18:34:35 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2008-12-12 18:34:35 +0000 |
| commit | 7b127324ce499b284bd054fb58065f683e3b8b9a (patch) | |
| tree | cfb930178f0db77b0dd337c7c40ea9f9840cfe6b | |
| parent | 56572ab9e9766e672fdbe7f03273907526f48a15 (diff) | |
| download | bcm5719-llvm-7b127324ce499b284bd054fb58065f683e3b8b9a.tar.gz bcm5719-llvm-7b127324ce499b284bd054fb58065f683e3b8b9a.zip | |
Force i[0-9]86 to i386 when using LLVM_HOSTTRIPLE.
Only use major part of OS version when on darwin and modifying OS part
of target triple.
llvm-svn: 60957
| -rw-r--r-- | clang/Driver/clang.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/Driver/clang.cpp b/clang/Driver/clang.cpp index c9022e4b57c..cb85eaee0f1 100644 --- a/clang/Driver/clang.cpp +++ b/clang/Driver/clang.cpp @@ -790,13 +790,20 @@ static std::string CreateTargetTriple() { if (Triple.empty()) { Triple = LLVM_HOSTTRIPLE; + // Force i<N>86 to i386 when using LLVM_HOSTTRIPLE. + if (Triple[0] == 'i' && isdigit(Triple[1]) && + Triple[2] == '8' && Triple[3] == '6') + Triple[1] = '3'; + // On darwin, we want to update the version to match that of the // host. std::string::size_type DarwinDashIdx = Triple.find("-darwin"); if (DarwinDashIdx != std::string::npos) { Triple.resize(DarwinDashIdx + strlen("-darwin")); - Triple += llvm::sys::osVersion(); + // Only add the major part of the os version. + std::string Version = llvm::sys::osVersion(); + Triple += Version.substr(0, Version.find('.')); } } |

