Commit 356f3b2
[Darwin][Driver] Avoid duplicate -lc++ with -fsanitize=fuzzer (#161304)
On Darwin, duplicate `-l` options cause a warning to be printed.
Invoking clang as clang++ and using `-fsanitize=fuzzer` will cause `-lc++`
to be passed twice to the linker, causing a warning.
i.e. AddCXXStdlibLibArgs is called twice in this case:
1)
https://github.com/llvm/llvm-project/blob/19c4e86f3e8582c3f087a9fec5ac036838e58ec4/clang/lib/Driver/ToolChains/Darwin.cpp#L743
because `ShouldLinkCXXStdlib(Args)` is true.
2) The subject of this PR
We now skip adding the -lc++ argument if `ShouldLinkCXXStdlib(Args)`
(since that means the other path already added it).
rdar://1364317751 parent 68bf796 commit 356f3b2
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1609 | 1609 | | |
1610 | 1610 | | |
1611 | 1611 | | |
1612 | | - | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
1613 | 1618 | | |
1614 | 1619 | | |
1615 | 1620 | | |
| |||
0 commit comments