[PATCH] D158378: [Driver] move Minix header search path management to the driver

2023-08-21 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

Created https://reviews.llvm.org/D158461 to remove it.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158378/new/

https://reviews.llvm.org/D158378

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158378: [Driver] move Minix header search path management to the driver

2023-08-20 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

In D158378#4602375 , @brad wrote:

> In D158378#4602289 , @MaskRay wrote:
>
>> Thank you for driving the migration!
>>
>>   case llvm::Triple::Minix:
>> AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
>> "", "", "", triple);
>>
>> The GCC 4.4.3 thing is from 3e2ee147d0ddb23592b2ec8294381b5e1801cc62 (2010). 
>> https://github.com/Stichting-MINIX-Research-Foundation/minix and 
>> https://git.minix3.org/index.cgi?p=minix.git haven't had any commit since 
>> 2018.
>> We haven't seen any actual Minix driver changes for many years. I think it 
>> unlikely works and perhaps we should remove Minix driver support.
>
> Ya, I should have noticed that. I had heard years ago that Minix had switched 
> to Clang. I installed the latest in a VM and it does come with Clang. Clang 
> 3.6.

Thanks. 3.6 is so old. Given many things like `CompilerRT-Generic` that 
unlikely works, I think it's better to remove `Minix.cpp`.
If the Minix community makes efforts to add back llvm-project support, starting 
from scratch with proper testing is likely better than the current 
nearly-untested state...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158378/new/

https://reviews.llvm.org/D158378

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158378: [Driver] move Minix header search path management to the driver

2023-08-20 Thread Brad Smith via Phabricator via cfe-commits
brad added a comment.

In D158378#4602289 , @MaskRay wrote:

> Thank you for driving the migration!
>
>   case llvm::Triple::Minix:
> AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
> "", "", "", triple);
>
> The GCC 4.4.3 thing is from 3e2ee147d0ddb23592b2ec8294381b5e1801cc62 (2010). 
> https://github.com/Stichting-MINIX-Research-Foundation/minix and 
> https://git.minix3.org/index.cgi?p=minix.git haven't had any commit since 
> 2018.
> We haven't seen any actual Minix driver changes for many years. I think it 
> unlikely works and perhaps we should remove Minix driver support.

Ya, I should have noticed that. I had heard years ago that Minix had switched 
to Clang. I installed the latest in a VM and it does come with Clang. Clang 3.6.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158378/new/

https://reviews.llvm.org/D158378

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158378: [Driver] move Minix header search path management to the driver

2023-08-20 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment.

Thank you for driving the migration!

  case llvm::Triple::Minix:
AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
"", "", "", triple);

The GCC 4.4.3 thing is from 3e2ee147d0ddb23592b2ec8294381b5e1801cc62 (2010). 
https://github.com/Stichting-MINIX-Research-Foundation/minix and 
https://git.minix3.org/index.cgi?p=minix.git haven't had any commit since 2018.
We haven't seen any actual Minix driver changes for many years. I think it 
unlikely works and perhaps we should remove Minix driver support.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D158378/new/

https://reviews.llvm.org/D158378

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D158378: [Driver] move Minix header search path management to the driver

2023-08-20 Thread Brad Smith via Phabricator via cfe-commits
brad created this revision.
brad added a reviewer: MaskRay.
brad added a project: clang.
Herald added a project: All.
brad requested review of this revision.

As has been done for other OS's. Move the header path management to the driver.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D158378

Files:
  clang/lib/Driver/ToolChains/Minix.cpp
  clang/lib/Driver/ToolChains/Minix.h
  clang/lib/Lex/InitHeaderSearch.cpp

Index: clang/lib/Lex/InitHeaderSearch.cpp
===
--- clang/lib/Lex/InitHeaderSearch.cpp
+++ clang/lib/Lex/InitHeaderSearch.cpp
@@ -332,10 +332,6 @@
   case llvm::Triple::DragonFly:
 AddPath("/usr/include/c++/5.0", CXXSystem, false);
 break;
-  case llvm::Triple::Minix:
-AddGnuCPlusPlusIncludePaths("/usr/gnu/include/c++/4.4.3",
-"", "", "", triple);
-break;
   default:
 break;
   }
@@ -355,6 +351,7 @@
   case llvm::Triple::Haiku:
   case llvm::Triple::Hurd:
   case llvm::Triple::Linux:
+  case llvm::Triple::Minix:
   case llvm::Triple::Solaris:
   case llvm::Triple::WASI:
 return false;
Index: clang/lib/Driver/ToolChains/Minix.h
===
--- clang/lib/Driver/ToolChains/Minix.h
+++ clang/lib/Driver/ToolChains/Minix.h
@@ -52,6 +52,13 @@
   Minix(const Driver , const llvm::Triple ,
 const llvm::opt::ArgList );
 
+  void
+  AddClangSystemIncludeArgs(const llvm::opt::ArgList ,
+llvm::opt::ArgStringList ) const override;
+  void addLibStdCxxIncludePaths(
+  const llvm::opt::ArgList ,
+  llvm::opt::ArgStringList ) const override;
+
 protected:
   Tool *buildAssembler() const override;
   Tool *buildLinker() const override;
Index: clang/lib/Driver/ToolChains/Minix.cpp
===
--- clang/lib/Driver/ToolChains/Minix.cpp
+++ clang/lib/Driver/ToolChains/Minix.cpp
@@ -8,11 +8,13 @@
 
 #include "Minix.h"
 #include "CommonArgs.h"
+#include "clang/Config/config.h"
 #include "clang/Driver/Compilation.h"
 #include "clang/Driver/Driver.h"
 #include "clang/Driver/InputInfo.h"
 #include "clang/Driver/Options.h"
 #include "llvm/Option/ArgList.h"
+#include "llvm/Support/Path.h"
 #include "llvm/Support/VirtualFileSystem.h"
 
 using namespace clang::driver;
@@ -107,6 +109,46 @@
   getFilePaths().push_back("/usr/lib");
 }
 
+void toolchains::Minix::AddClangSystemIncludeArgs(
+const llvm::opt::ArgList ,
+llvm::opt::ArgStringList ) const {
+  const Driver  = getDriver();
+
+  if (DriverArgs.hasArg(clang::driver::options::OPT_nostdinc))
+return;
+
+  if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
+SmallString<128> Dir(D.ResourceDir);
+llvm::sys::path::append(Dir, "include");
+addSystemInclude(DriverArgs, CC1Args, Dir.str());
+  }
+
+  if (DriverArgs.hasArg(options::OPT_nostdlibinc))
+return;
+
+  // Check for configure-time C include directories.
+  StringRef CIncludeDirs(C_INCLUDE_DIRS);
+  if (CIncludeDirs != "") {
+SmallVector dirs;
+CIncludeDirs.split(dirs, ":");
+for (StringRef dir : dirs) {
+  StringRef Prefix =
+  llvm::sys::path::is_absolute(dir) ? StringRef(D.SysRoot) : "";
+  addExternCSystemInclude(DriverArgs, CC1Args, Prefix + dir);
+}
+return;
+  }
+
+  addExternCSystemInclude(DriverArgs, CC1Args,
+  concat(D.SysRoot, "/usr/include"));
+}
+
+void toolchains::Minix::addLibStdCxxIncludePaths(const llvm::opt::ArgList ,
+ llvm::opt::ArgStringList ) const {
+  addLibStdCXXIncludePaths(concat(getDriver().SysRoot, "/usr/gnu/include/c++/4.4.3"), "", "",
+   DriverArgs, CC1Args);
+}
+
 Tool *toolchains::Minix::buildAssembler() const {
   return new tools::minix::Assembler(*this);
 }
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits