diff options
author | Petr Hosek <phosek@chromium.org> | 2019-04-27 00:25:13 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2019-04-27 00:25:13 +0000 |
commit | b58561baa509f26709caaa06d2666834f51431ea (patch) | |
tree | 5a669a9ed22661c1e9dd22b9ce7b9612edbd0a30 /clang/lib/Driver/ToolChains/Gnu.cpp | |
parent | 0f9f021d05ac0697b1baf4f79916e8c97208d58d (diff) | |
download | bcm5719-llvm-b58561baa509f26709caaa06d2666834f51431ea.tar.gz bcm5719-llvm-b58561baa509f26709caaa06d2666834f51431ea.zip |
[Fuchsia] Support multilib for -fsanitize=address and -fno-exceptions
This introduces a support for multilibs to Fuchsia driver. Unlike the
existing multilibs that are used primarily for handling different
architecture variants, we use multilibs to handle different variants
of Clang runtime libraries: -fsanitize=address and -fno-exceptions
are the two we support initially. This replaces the existing support
for sanitized runtimes libraries that was only used by Fuchsia driver
and it also refactors some of the logic to allow sharing between GNU
and Fuchsia drivers.
Differential Revision: https://reviews.llvm.org/D61040
llvm-svn: 359360
Diffstat (limited to 'clang/lib/Driver/ToolChains/Gnu.cpp')
-rw-r--r-- | clang/lib/Driver/ToolChains/Gnu.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp index 8915e3f948f..41c9abec3f1 100644 --- a/clang/lib/Driver/ToolChains/Gnu.cpp +++ b/clang/lib/Driver/ToolChains/Gnu.cpp @@ -33,6 +33,8 @@ using namespace clang::driver::toolchains; using namespace clang; using namespace llvm::opt; +using tools::addMultilibFlag; + void tools::GnuTool::anchor() {} static bool forwardToGCC(const Option &O) { @@ -871,16 +873,6 @@ static bool isSoftFloatABI(const ArgList &Args) { A->getValue() == StringRef("soft")); } -/// \p Flag must be a flag accepted by the driver with its leading '-' removed, -// otherwise '-print-multi-lib' will not emit them correctly. -static void addMultilibFlag(bool Enabled, const char *const Flag, - std::vector<std::string> &Flags) { - if (Enabled) - Flags.push_back(std::string("+") + Flag); - else - Flags.push_back(std::string("-") + Flag); -} - static bool isArmOrThumbArch(llvm::Triple::ArchType Arch) { return Arch == llvm::Triple::arm || Arch == llvm::Triple::thumb; } |