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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/Driver/nacl-direct.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===--- ToolChains.cpp - ToolChain Implementations -----------------------===// 1 //===--- ToolChains.cpp - ToolChain Implementations -----------------------===//
2 // 2 //
3 // The LLVM Compiler Infrastructure 3 // The LLVM Compiler Infrastructure
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 9
10 #include "ToolChains.h" 10 #include "ToolChains.h"
(...skipping 2319 matching lines...) Expand 10 before | Expand all | Expand 10 after
2330 2330
2331 // Path for tools (clang, ld, etc..) 2331 // Path for tools (clang, ld, etc..)
2332 std::string ProgPath(getDriver().Dir + "/../"); 2332 std::string ProgPath(getDriver().Dir + "/../");
2333 2333
2334 // Path for toolchain libraries (libgcc.a, ...) 2334 // Path for toolchain libraries (libgcc.a, ...)
2335 std::string ToolPath(getDriver().ResourceDir + "/lib/"); 2335 std::string ToolPath(getDriver().ResourceDir + "/lib/");
2336 2336
2337 switch(Triple.getArch()) { 2337 switch(Triple.getArch()) {
2338 case llvm::Triple::x86: { 2338 case llvm::Triple::x86: {
2339 file_paths.push_back(FilePath + "x86_64-nacl/lib32"); 2339 file_paths.push_back(FilePath + "x86_64-nacl/lib32");
2340 file_paths.push_back(FilePath + "x86_64-nacl/usr/lib32"); 2340 file_paths.push_back(FilePath + "i686-nacl/usr/lib");
2341 prog_paths.push_back(ProgPath + "x86_64-nacl/bin"); 2341 prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
2342 file_paths.push_back(ToolPath + "i686-nacl"); 2342 file_paths.push_back(ToolPath + "i686-nacl");
2343 break; 2343 break;
2344 } 2344 }
2345 case llvm::Triple::x86_64: { 2345 case llvm::Triple::x86_64: {
2346 file_paths.push_back(FilePath + "x86_64-nacl/lib"); 2346 file_paths.push_back(FilePath + "x86_64-nacl/lib");
2347 file_paths.push_back(FilePath + "x86_64-nacl/usr/lib"); 2347 file_paths.push_back(FilePath + "x86_64-nacl/usr/lib");
2348 prog_paths.push_back(ProgPath + "x86_64-nacl/bin"); 2348 prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
2349 file_paths.push_back(ToolPath + "x86_64-nacl"); 2349 file_paths.push_back(ToolPath + "x86_64-nacl");
2350 break; 2350 break;
(...skipping 23 matching lines...) Expand all
2374 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) { 2374 if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
2375 SmallString<128> P(D.ResourceDir); 2375 SmallString<128> P(D.ResourceDir);
2376 llvm::sys::path::append(P, "include"); 2376 llvm::sys::path::append(P, "include");
2377 addSystemInclude(DriverArgs, CC1Args, P.str()); 2377 addSystemInclude(DriverArgs, CC1Args, P.str());
2378 } 2378 }
2379 2379
2380 if (DriverArgs.hasArg(options::OPT_nostdlibinc)) 2380 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
2381 return; 2381 return;
2382 2382
2383 SmallString<128> P(D.Dir + "/../"); 2383 SmallString<128> P(D.Dir + "/../");
2384 if (getTriple().getArch() == llvm::Triple::arm) { 2384 switch (getTriple().getArch()) {
2385 case llvm::Triple::x86:
2386 // x86 is special because multilib style uses x86_64-nacl/include for libc
2387 // headers but the SDK wants i686-nacl/usr/include. The other architectures
2388 // have the same substring.
2389 llvm::sys::path::append(P, "i686-nacl/usr/include");
2390 addSystemInclude(DriverArgs, CC1Args, P.str());
2391 llvm::sys::path::remove_filename(P);
2392 llvm::sys::path::remove_filename(P);
2393 llvm::sys::path::remove_filename(P);
2394 llvm::sys::path::append(P, "x86_64-nacl/include");
2395 addSystemInclude(DriverArgs, CC1Args, P.str());
2396 return;
2397 case llvm::Triple::arm:
2385 llvm::sys::path::append(P, "arm-nacl/usr/include"); 2398 llvm::sys::path::append(P, "arm-nacl/usr/include");
2386 } else if (getTriple().getArch() == llvm::Triple::x86) { 2399 break;
2400 case llvm::Triple::x86_64:
2387 llvm::sys::path::append(P, "x86_64-nacl/usr/include"); 2401 llvm::sys::path::append(P, "x86_64-nacl/usr/include");
2388 } else if (getTriple().getArch() == llvm::Triple::x86_64) { 2402 break;
2389 llvm::sys::path::append(P, "x86_64-nacl/usr/include"); 2403 case llvm::Triple::mipsel:
2390 } else { 2404 llvm::sys::path::append(P, "mipsel-nacl/usr/include");
2405 break;
2406 default:
2391 return; 2407 return;
2392 } 2408 }
2393 2409
2394 addSystemInclude(DriverArgs, CC1Args, P.str()); 2410 addSystemInclude(DriverArgs, CC1Args, P.str());
2395 llvm::sys::path::remove_filename(P); 2411 llvm::sys::path::remove_filename(P);
2396 llvm::sys::path::remove_filename(P); 2412 llvm::sys::path::remove_filename(P);
2397 llvm::sys::path::append(P, "include"); 2413 llvm::sys::path::append(P, "include");
2398 addSystemInclude(DriverArgs, CC1Args, P.str()); 2414 addSystemInclude(DriverArgs, CC1Args, P.str());
2399 } 2415 }
2400 2416
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after
3678 StringRef(cl_include_dir).split(Dirs, StringRef(EnvPathSeparatorStr)); 3694 StringRef(cl_include_dir).split(Dirs, StringRef(EnvPathSeparatorStr));
3679 ArrayRef<StringRef> DirVec(Dirs); 3695 ArrayRef<StringRef> DirVec(Dirs);
3680 addSystemIncludes(DriverArgs, CC1Args, DirVec); 3696 addSystemIncludes(DriverArgs, CC1Args, DirVec);
3681 } 3697 }
3682 } 3698 }
3683 3699
3684 void XCore::AddCXXStdlibLibArgs(const ArgList &Args, 3700 void XCore::AddCXXStdlibLibArgs(const ArgList &Args,
3685 ArgStringList &CmdArgs) const { 3701 ArgStringList &CmdArgs) const {
3686 // We don't output any lib args. This is handled by xcc. 3702 // We don't output any lib args. This is handled by xcc.
3687 } 3703 }
OLDNEW
« 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