[PATCH] D121992: [Clang] [Driver] Add option to set alternative toolchain path

Fangrui Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 24 17:23:59 PDT 2022


MaskRay added a comment.

Why is --overlay-platform-toolchain added instead of using `-isystem` and `-L`?

> In some cases, we need to set alternative toolchain path other than the default with system (headers, libraries, dynamic linker prefix, ld path, etc.), e.g., to pick up newer components, but keep sysroot at the same time (to pick up extra packages).

The functionality overlaps with `-B`. Unsure why introduce a new mechanism.



================
Comment at: clang/include/clang/Driver/Options.td:4184
+def _overlay_platform_toolchain_EQ : Joined<["--"], "overlay-platform-toolchain=">;
+def _overlay_platform_toolchain : Separate<["--"], "overlay-platform-toolchain">, Alias<_overlay_platform_toolchain_EQ>;
 def _param : Separate<["--"], "param">, Group<CompileOnly_Group>;
----------------
Separate-form driver options are not conventional. New driver options should just avoid them.


================
Comment at: clang/lib/Driver/ToolChains/Gnu.cpp:1870
 
+  if (const Arg *X = Args.getLastArg(
+          clang::driver::options::OPT__overlay_platform_toolchain_EQ))
----------------
Why was this  rule added?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121992



More information about the cfe-commits mailing list