Skip to content

Commit 12b87f6

Browse files
authored
[Driver] Silence stdlib warning when linking C on FreeBSD (#68011)
Similar to the Gnu toolchain, ignore uses of '-stdlib=libc++' when linking C code. CMake insists on adding it to the command line when linking C, and a bunch of other build systems do similarly.
1 parent ea1ae11 commit 12b87f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/Driver/ToolChains/FreeBSD.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,
356356

357357
ToolChain.addProfileRTLibs(Args, CmdArgs);
358358

359+
// Silence warnings when linking C code with a C++ '-stdlib' argument.
360+
Args.ClaimAllArgs(options::OPT_stdlib_EQ);
361+
359362
const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
360363
C.addCommand(std::make_unique<Command>(JA, *this,
361364
ResponseFileSupport::AtFileCurCP(),

0 commit comments

Comments
 (0)