[PATCH] D148266: [clang][driver] Linking to just-built libc++.dylib when bootstrapping libc++ with clang

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 09:35:11 PDT 2023


arphaman added inline comments.


================
Comment at: clang/lib/Driver/ToolChains/Darwin.cpp:431
+  // libc++.dylib in the toolchain.
+  if ((!Args.hasArg(options::OPT_nostdinc, options::OPT_nostdlibinc,
+                    options::OPT_nostdincxx)) &&
----------------
ldionne wrote:
> The more I look at this, the more I think it seems kind of weird to me that a linker argument would be impacted by `-nostdinc` & friends, which control header search paths. IMO we should use the simplest behavior and only check for `libc++.dylib` here, and not check for `libc++.dylib` when we determine the header search paths.
> 
> @arphaman Do you have an opinion?
That makes sense to me. I'm not sure why specifically do we need to check if the dylib exists when determining the header search path. Is there a specific reason we couldn't mix the local headers and the system's dylib in that case?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148266



More information about the cfe-commits mailing list