Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1252)

Unified Diff: lib/Driver/ToolChains.cpp

Issue 1230653005: Change Native Client x86 usr include and link path to match SDK expectations (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-clang.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/Driver/nacl-direct.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/Driver/ToolChains.cpp
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index b2fc5cd732d2cd9cb7392689cecec6e42d3b78ba..8aa80c62ffda5e83ce776f2e187adf651b7dfa76 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -2337,7 +2337,7 @@ NaCl_TC::NaCl_TC(const Driver &D, const llvm::Triple &Triple,
switch(Triple.getArch()) {
case llvm::Triple::x86: {
file_paths.push_back(FilePath + "x86_64-nacl/lib32");
- file_paths.push_back(FilePath + "x86_64-nacl/usr/lib32");
+ file_paths.push_back(FilePath + "i686-nacl/usr/lib");
prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
file_paths.push_back(ToolPath + "i686-nacl");
break;
@@ -2381,13 +2381,29 @@ void NaCl_TC::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
return;
SmallString<128> P(D.Dir + "/../");
- if (getTriple().getArch() == llvm::Triple::arm) {
+ switch (getTriple().getArch()) {
+ case llvm::Triple::x86:
+ // x86 is special because multilib style uses x86_64-nacl/include for libc
+ // headers but the SDK wants i686-nacl/usr/include. The other architectures
+ // have the same substring.
+ llvm::sys::path::append(P, "i686-nacl/usr/include");
+ addSystemInclude(DriverArgs, CC1Args, P.str());
+ llvm::sys::path::remove_filename(P);
+ llvm::sys::path::remove_filename(P);
+ llvm::sys::path::remove_filename(P);
+ llvm::sys::path::append(P, "x86_64-nacl/include");
+ addSystemInclude(DriverArgs, CC1Args, P.str());
+ return;
+ case llvm::Triple::arm:
llvm::sys::path::append(P, "arm-nacl/usr/include");
- } else if (getTriple().getArch() == llvm::Triple::x86) {
- llvm::sys::path::append(P, "x86_64-nacl/usr/include");
- } else if (getTriple().getArch() == llvm::Triple::x86_64) {
+ break;
+ case llvm::Triple::x86_64:
llvm::sys::path::append(P, "x86_64-nacl/usr/include");
- } else {
+ break;
+ case llvm::Triple::mipsel:
+ llvm::sys::path::append(P, "mipsel-nacl/usr/include");
+ break;
+ default:
return;
}
« no previous file with comments | « no previous file | test/Driver/nacl-direct.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698