Skip to content

Commit b2f00eb

Browse files
committed
[Darwin][Driver] Prefer linking with toolchain's libc++ instead of system
Fixes llvm#77653
1 parent 004270d commit b2f00eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,10 @@ void darwin::Linker::ConstructJob(Compilation &C, const JobAction &JA,
667667
Args.addAllArgs(CmdArgs, {options::OPT_d_Flag, options::OPT_s, options::OPT_t,
668668
options::OPT_Z_Flag, options::OPT_u_Group});
669669

670+
// Add local file paths to ensure the toolchain's libc++ is used instead of
671+
// the system's.
672+
ToolChain.AddFilePathLibArgs(Args, CmdArgs);
673+
670674
// Forward -ObjC when either -ObjC or -ObjC++ is used, to force loading
671675
// members of static archive libraries which implement Objective-C classes or
672676
// categories.

0 commit comments

Comments
 (0)