clang-link-libgcc.patch 1.0 KB

1234567891011121314151617181920212223242526
  1. diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
  2. index dfcef2304040..d64f1cb61bd2 100644
  3. --- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
  4. +++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
  5. @@ -797,6 +797,8 @@ void tools::linkSanitizerRuntimeDeps(const ToolChain &TC,
  6. TC.getTriple().isOSNetBSD() ||
  7. TC.getTriple().isOSOpenBSD())
  8. CmdArgs.push_back("-lexecinfo");
  9. +
  10. + CmdArgs.push_back("-lgcc");
  11. }
  12. static void
  13. diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
  14. index 7a9570a686f4..96c777cea095 100644
  15. --- a/clang/lib/Driver/ToolChains/Gnu.cpp
  16. +++ b/clang/lib/Driver/ToolChains/Gnu.cpp
  17. @@ -576,6 +576,7 @@ void tools::gnutools::Linker::ConstructJob(Compilation &C, const JobAction &JA,
  18. CmdArgs.push_back("-Bdynamic");
  19. }
  20. CmdArgs.push_back("-lm");
  21. + CmdArgs.push_back("-lgcc");
  22. }
  23. // Silence warnings when linking C code with a C++ '-stdlib' argument.
  24. Args.ClaimAllArgs(options::OPT_stdlib_EQ);