[Driver] Always use --as-needed with libunwind
authorPetr Hosek <phosek@google.com>
Wed, 29 Jun 2022 17:57:51 +0000 (17:57 +0000)
committerPetr Hosek <phosek@google.com>
Thu, 30 Jun 2022 03:33:40 +0000 (03:33 +0000)
commit75113f3539df03625b43754f17f9a570cc1c2e3b
treef24c088f2a2f96b95db06664fe5e39c1f9ca4752
parent0b5ead659023dedd6c450657df9f242a2819871a
[Driver] Always use --as-needed with libunwind

With libgcc, we follow the behavior of GCC for backwards compatibility,
only using --as-needed in the non-C++ mode.

With libunwind, there are no backward compatibility requirements so we
can always use --as-needed on all supported platforms.

Differential Revision: https://reviews.llvm.org/D128841
clang/lib/Driver/ToolChains/CommonArgs.cpp
clang/test/Driver/compiler-rt-unwind.c