Ticket #53194: 9001-macports-libstdcxx.diff
File 9001-macports-libstdcxx.diff, 4.8 KB (added by MarcusCalhoun-Lopez (Marcus Calhoun-Lopez), 8 years ago) |
---|
-
tools/clang/include/clang/Lex/HeaderSearchOptions.h
old new 158 158 /// Use libc++ instead of the default libstdc++. 159 159 unsigned UseLibcxx : 1; 160 160 161 /// Use MacPorts libstdc++ instead of default system libstdc++. 162 unsigned UseMacPortsLibstdcxx : 1; 163 161 164 /// Whether header search information should be output as for -v. 162 165 unsigned Verbose : 1; 163 166 -
tools/clang/lib/Frontend/CompilerInvocation.cpp
old new 1355 1355 Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc); 1356 1356 Opts.UseStandardSystemIncludes = !Args.hasArg(OPT_nostdsysteminc); 1357 1357 Opts.UseStandardCXXIncludes = !Args.hasArg(OPT_nostdincxx); 1358 if (const Arg *A = Args.getLastArg(OPT_stdlib_EQ)) 1358 if (const Arg *A = Args.getLastArg(OPT_stdlib_EQ)) { 1359 1359 Opts.UseLibcxx = (strcmp(A->getValue(), "libc++") == 0); 1360 Opts.UseMacPortsLibstdcxx = (strcmp(A->getValue(), "macports-libstdc++") == 0); 1361 } 1360 1362 Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir); 1361 1363 Opts.ModuleCachePath = Args.getLastArgValue(OPT_fmodules_cache_path); 1362 1364 Opts.ModuleUserBuildPath = Args.getLastArgValue(OPT_fmodules_user_build_path); -
tools/clang/lib/Frontend/InitHeaderSearch.cpp
old new 109 109 #if defined(LLVM_ON_WIN32) 110 110 return !Path.empty() && llvm::sys::path::is_separator(Path[0]); 111 111 #else 112 return llvm::sys::path::is_absolute(Path) ;112 return llvm::sys::path::is_absolute(Path) && Path.find("@@MACPORTS_GCC_INCLUDE_DIR@@")!=0; 113 113 #endif 114 114 } 115 115 … … 362 362 363 363 case llvm::Triple::ppc: 364 364 case llvm::Triple::ppc64: 365 if (HSOpts.UseMacPortsLibstdcxx) { 366 AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@", 367 "@@MACPORTS_HOST_NAME@@", "", "ppc64", 368 triple); 369 } else { 365 370 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 366 371 "powerpc-apple-darwin10", "", "ppc64", 367 372 triple); 368 373 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 369 374 "powerpc-apple-darwin8", "", "ppc64", 370 375 triple); 376 } 371 377 break; 372 378 373 379 case llvm::Triple::x86: 374 380 case llvm::Triple::x86_64: 381 if (HSOpts.UseMacPortsLibstdcxx) { 382 AddGnuCPlusPlusIncludePaths("@@MACPORTS_GCC_INCLUDE_DIR@@", 383 "@@MACPORTS_HOST_NAME@@", "i386", "", triple); 384 } else { 375 385 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.2.1", 376 386 "i686-apple-darwin10", "", "x86_64", triple); 377 387 AddGnuCPlusPlusIncludePaths("/usr/include/c++/4.0.0", 378 388 "i686-apple-darwin8", "", "x86_64", triple); 389 } 379 390 break; 380 391 381 392 case llvm::Triple::arm: -
tools/clang/include/clang/Driver/ToolChain.h
old new 51 51 52 52 enum CXXStdlibType { 53 53 CST_Libcxx, 54 CST_Libstdcxx 54 CST_Libstdcxx, 55 CST_MacPortsLibstdcxx 55 56 }; 56 57 57 58 enum RuntimeLibType { -
tools/clang/lib/Driver/ToolChains.cpp
old new 773 773 // Otherwise, let the linker search. 774 774 CmdArgs.push_back("-lstdc++"); 775 775 break; 776 case ToolChain::CST_MacPortsLibstdcxx: 777 if (getVFS().exists("@@MACPORTS_libstdc++@@")) { 778 CmdArgs.push_back("@@MACPORTS_libstdc++@@"); 779 return; 780 } 781 CmdArgs.push_back("-lstdc++"); 782 break; 776 783 } 777 784 } 778 785 … … 3015 3022 return ToolChain::CST_Libstdcxx; 3016 3023 3017 3024 StringRef Value = A->getValue(); 3025 if (Value == "macports-libstdc++" ) 3026 return ToolChain::CST_MacPortsLibstdcxx; 3018 3027 if (Value != "libstdc++") 3019 3028 getDriver().Diag(diag::err_drv_invalid_stdlib_name) << A->getAsString(Args); 3020 3029 -
tools/clang/lib/Driver/ToolChain.cpp
old new 545 545 Type = ToolChain::CST_Libcxx; 546 546 else if (Name == "libstdc++") 547 547 Type = ToolChain::CST_Libstdcxx; 548 else if (Name == "macports-libstdc++") 549 Type = ToolChain::CST_MacPortsLibstdcxx; 548 550 else 549 551 return false; 550 552 … … 640 642 break; 641 643 642 644 case ToolChain::CST_Libstdcxx: 645 case ToolChain::CST_MacPortsLibstdcxx: 643 646 CmdArgs.push_back("-lstdc++"); 644 647 break; 645 648 }