add more crates

Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
xermicus
2023-12-09 17:48:52 +01:00
parent c04ae9a5c3
commit 7a094f17c0
22 changed files with 191 additions and 34 deletions
+22
View File
@@ -0,0 +1,22 @@
// SPDX-License-Identifier: Apache-2.0
#include "lld/Common/Driver.h"
#include "lld/Common/CommonLinkerContext.h"
#include "llvm/Support/CrashRecoveryContext.h"
extern "C" bool LLDELFLink(const char *argv[], size_t length)
{
bool canRunAgain;
{
llvm::ArrayRef<const char *> args(argv, length);
llvm::CrashRecoveryContext crc;
if (!crc.RunSafely([&]()
{ canRunAgain = lld::elf::link(args, llvm::outs(), llvm::errs(), false, false); }))
return false;
}
llvm::CrashRecoveryContext crc;
return canRunAgain && crc.RunSafely([&]()
{ lld::CommonLinkerContext::destroy(); });
}