Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 758167 | Differences between
and this patch

Collapse All | Expand All

(-)a/clang/lib/Frontend/InitHeaderSearch.cpp (+3 lines)
Lines 445-450 Link Here
445
  // All header search logic is handled in the Driver for Darwin.
445
  // All header search logic is handled in the Driver for Darwin.
446
  if (triple.isOSDarwin()) {
446
  if (triple.isOSDarwin()) {
447
    if (HSOpts.UseStandardSystemIncludes) {
447
    if (HSOpts.UseStandardSystemIncludes) {
448
      // Add Gentoo Prefix framework dirs first
449
      AddPath("@GENTOO_PORTAGE_EPREFIX@MacOSX.sdk/System/Library/Frameworks", System, true);
450
      AddPath("@GENTOO_PORTAGE_EPREFIX@MacOSX.sdk/Library/Frameworks", System, true);
448
      // Add the default framework include paths on Darwin.
451
      // Add the default framework include paths on Darwin.
449
      AddPath("/System/Library/Frameworks", System, true);
452
      AddPath("/System/Library/Frameworks", System, true);
450
      AddPath("/Library/Frameworks", System, true);
453
      AddPath("/Library/Frameworks", System, true);
(-)a/clang/lib/Driver/ToolChains/Darwin.cpp (-5 / +11 lines)
Lines 1737-1745 Link Here
1737
                                         const ArgList &Args,
1737
                                         const ArgList &Args,
1738
                                         const Driver &TheDriver) {
1738
                                         const Driver &TheDriver) {
1739
  const Arg *A = Args.getLastArg(options::OPT_isysroot);
1739
  const Arg *A = Args.getLastArg(options::OPT_isysroot);
1740
  if (!A)
1740
  //if (!A)
1741
    return None;
1741
  //  return None;
1742
  StringRef isysroot = A->getValue();
1742
  StringRef isysroot = A ? A->getValue() : "@GENTOO_PORTAGE_EPREFIX@MacOSX.sdk";
1743
  auto SDKInfoOrErr = driver::parseDarwinSDKInfo(VFS, isysroot);
1743
  auto SDKInfoOrErr = driver::parseDarwinSDKInfo(VFS, isysroot);
1744
  if (!SDKInfoOrErr) {
1744
  if (!SDKInfoOrErr) {
1745
    llvm::consumeError(SDKInfoOrErr.takeError());
1745
    llvm::consumeError(SDKInfoOrErr.takeError());
Lines 1921-1933 Link Here
1921
    return DriverArgs.getLastArgValue(options::OPT_isysroot);
1921
    return DriverArgs.getLastArgValue(options::OPT_isysroot);
1922
  if (!getDriver().SysRoot.empty())
1922
  if (!getDriver().SysRoot.empty())
1923
    return getDriver().SysRoot;
1923
    return getDriver().SysRoot;
1924
  return "/";
1924
  return "@GENTOO_PORTAGE_EPREFIX@";
1925
}
1925
}
1926
1926
1927
void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
1927
void DarwinClang::AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
1928
                                            llvm::opt::ArgStringList &CC1Args) const {
1928
                                            llvm::opt::ArgStringList &CC1Args) const {
1929
  const Driver &D = getDriver();
1929
  const Driver &D = getDriver();
1930
1930
1931
  // Sysroot is effectively Gentoo EPREFIX when -isysroot/-sysroot is not defined
1931
  llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
1932
  llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
1932
1933
1933
  bool NoStdInc = DriverArgs.hasArg(options::OPT_nostdinc);
1934
  bool NoStdInc = DriverArgs.hasArg(options::OPT_nostdinc);
Lines 1969-1974 Link Here
1969
    SmallString<128> P(Sysroot);
1970
    SmallString<128> P(Sysroot);
1970
    llvm::sys::path::append(P, "usr", "include");
1971
    llvm::sys::path::append(P, "usr", "include");
1971
    addExternCSystemInclude(DriverArgs, CC1Args, P.str());
1972
    addExternCSystemInclude(DriverArgs, CC1Args, P.str());
1973
    // And add <sysroot>/MacOSX.sdk/usr/include.
1974
    SmallString<128> Psdk(Sysroot);
1975
    llvm::sys::path::append(Psdk, "MacOSX.sdk", "usr", "include");
1976
    addExternCSystemInclude(DriverArgs, CC1Args, Psdk.str());
1972
  }
1977
  }
1973
}
1978
}
1974
1979
Lines 2017-2022 Link Here
2017
      DriverArgs.hasArg(options::OPT_nostdincxx))
2022
      DriverArgs.hasArg(options::OPT_nostdincxx))
2018
    return;
2023
    return;
2019
2024
2025
  // Sysroot is effectively Gentoo EPREFIX when -isysroot/-sysroot is not defined
2020
  llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
2026
  llvm::StringRef Sysroot = GetHeaderSysroot(DriverArgs);
2021
2027
2022
  switch (GetCXXStdlibType(DriverArgs)) {
2028
  switch (GetCXXStdlibType(DriverArgs)) {

Return to bug 758167