Skip to content

Commit

Permalink
[Driver] Silence stdlib warning when linking C on FreeBSD (#68011)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dankm committed Oct 11, 2023
1 parent ea1ae11 commit 12b87f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions clang/lib/Driver/ToolChains/FreeBSD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,9 @@ void freebsd::Linker::ConstructJob(Compilation &C, const JobAction &JA,

ToolChain.addProfileRTLibs(Args, CmdArgs);

// Silence warnings when linking C code with a C++ '-stdlib' argument.
Args.ClaimAllArgs(options::OPT_stdlib_EQ);

const char *Exec = Args.MakeArgString(getToolChain().GetLinkerPath());
C.addCommand(std::make_unique<Command>(JA, *this,
ResponseFileSupport::AtFileCurCP(),
Expand Down

0 comments on commit 12b87f6

Please sign in to comment.