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

Side by Side Diff: lib/Driver/ToolChains.cpp

Issue 946063002: Use seperate usr/lib and usr/include directories for i686-nacl (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-clang.git@master
Patch Set: Created 5 years, 10 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 | no next file » | 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 2406 matching lines...) Expand 10 before | Expand all | Expand 10 after
2417 2417
2418 // Path for tools (clang, ld, etc..) 2418 // Path for tools (clang, ld, etc..)
2419 std::string ProgPath(getDriver().Dir + "/../"); 2419 std::string ProgPath(getDriver().Dir + "/../");
2420 2420
2421 // Path for toolchain libraries (libgcc.a, ...) 2421 // Path for toolchain libraries (libgcc.a, ...)
2422 std::string ToolPath(getDriver().ResourceDir + "/lib/"); 2422 std::string ToolPath(getDriver().ResourceDir + "/lib/");
2423 2423
2424 switch(Triple.getArch()) { 2424 switch(Triple.getArch()) {
2425 case llvm::Triple::x86: { 2425 case llvm::Triple::x86: {
2426 file_paths.push_back(FilePath + "x86_64-nacl/lib32"); 2426 file_paths.push_back(FilePath + "x86_64-nacl/lib32");
2427 file_paths.push_back(FilePath + "x86_64-nacl/usr/lib32"); 2427 file_paths.push_back(FilePath + "i686-nacl/usr/lib");
2428 prog_paths.push_back(ProgPath + "x86_64-nacl/bin"); 2428 prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
2429 file_paths.push_back(ToolPath + "i686-nacl"); 2429 file_paths.push_back(ToolPath + "i686-nacl");
2430 break; 2430 break;
2431 } 2431 }
2432 case llvm::Triple::x86_64: { 2432 case llvm::Triple::x86_64: {
2433 file_paths.push_back(FilePath + "x86_64-nacl/lib"); 2433 file_paths.push_back(FilePath + "x86_64-nacl/lib");
2434 file_paths.push_back(FilePath + "x86_64-nacl/usr/lib"); 2434 file_paths.push_back(FilePath + "x86_64-nacl/usr/lib");
2435 prog_paths.push_back(ProgPath + "x86_64-nacl/bin"); 2435 prog_paths.push_back(ProgPath + "x86_64-nacl/bin");
2436 file_paths.push_back(ToolPath + "x86_64-nacl"); 2436 file_paths.push_back(ToolPath + "x86_64-nacl");
2437 break; 2437 break;
(...skipping 26 matching lines...) Expand all
2464 addSystemInclude(DriverArgs, CC1Args, P.str()); 2464 addSystemInclude(DriverArgs, CC1Args, P.str());
2465 } 2465 }
2466 2466
2467 if (DriverArgs.hasArg(options::OPT_nostdlibinc)) 2467 if (DriverArgs.hasArg(options::OPT_nostdlibinc))
2468 return; 2468 return;
2469 2469
2470 SmallString<128> P(D.Dir + "/../"); 2470 SmallString<128> P(D.Dir + "/../");
2471 if (getTriple().getArch() == llvm::Triple::arm) { 2471 if (getTriple().getArch() == llvm::Triple::arm) {
2472 llvm::sys::path::append(P, "arm-nacl/usr/include"); 2472 llvm::sys::path::append(P, "arm-nacl/usr/include");
2473 } else if (getTriple().getArch() == llvm::Triple::x86) { 2473 } else if (getTriple().getArch() == llvm::Triple::x86) {
2474 llvm::sys::path::append(P, "x86_64-nacl/usr/include"); 2474 llvm::sys::path::append(P, "i686-nacl/usr/include");
2475 } else if (getTriple().getArch() == llvm::Triple::x86_64) { 2475 } else if (getTriple().getArch() == llvm::Triple::x86_64) {
2476 llvm::sys::path::append(P, "x86_64-nacl/usr/include"); 2476 llvm::sys::path::append(P, "x86_64-nacl/usr/include");
2477 } else { 2477 } else {
2478 return; 2478 return;
2479 } 2479 }
2480 2480
2481 addSystemInclude(DriverArgs, CC1Args, P.str()); 2481 addSystemInclude(DriverArgs, CC1Args, P.str());
2482 llvm::sys::path::remove_filename(P); 2482 llvm::sys::path::remove_filename(P);
2483 llvm::sys::path::remove_filename(P); 2483 llvm::sys::path::remove_filename(P);
2484 llvm::sys::path::append(P, "include"); 2484 llvm::sys::path::append(P, "include");
jvoung (off chromium) 2015/02/27 17:13:35 This would have been x86_64-nacl/include, via the
Derek Schuff 2015/02/27 17:51:56 you're right. this also breaks the src/clang/test/
2485 addSystemInclude(DriverArgs, CC1Args, P.str()); 2485 addSystemInclude(DriverArgs, CC1Args, P.str());
2486 } 2486 }
2487 2487
2488 void NaCl_TC::AddCXXStdlibLibArgs(const ArgList &Args, 2488 void NaCl_TC::AddCXXStdlibLibArgs(const ArgList &Args,
2489 ArgStringList &CmdArgs) const { 2489 ArgStringList &CmdArgs) const {
2490 // Allow and ignore -stdlib=libc++ without warning, but not libstdc++ 2490 // Allow and ignore -stdlib=libc++ without warning, but not libstdc++
2491 GetCXXStdlibType(Args); 2491 GetCXXStdlibType(Args);
2492 CmdArgs.push_back("-lc++"); 2492 CmdArgs.push_back("-lc++");
2493 } 2493 }
2494 2494
(...skipping 1253 matching lines...) Expand 10 before | Expand all | Expand 10 after
3748 StringRef(cl_include_dir).split(Dirs, StringRef(EnvPathSeparatorStr)); 3748 StringRef(cl_include_dir).split(Dirs, StringRef(EnvPathSeparatorStr));
3749 ArrayRef<StringRef> DirVec(Dirs); 3749 ArrayRef<StringRef> DirVec(Dirs);
3750 addSystemIncludes(DriverArgs, CC1Args, DirVec); 3750 addSystemIncludes(DriverArgs, CC1Args, DirVec);
3751 } 3751 }
3752 } 3752 }
3753 3753
3754 void XCore::AddCXXStdlibLibArgs(const ArgList &Args, 3754 void XCore::AddCXXStdlibLibArgs(const ArgList &Args,
3755 ArgStringList &CmdArgs) const { 3755 ArgStringList &CmdArgs) const {
3756 // We don't output any lib args. This is handled by xcc. 3756 // We don't output any lib args. This is handled by xcc.
3757 } 3757 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698