From b67c04cdeabc6c89ef45d23cfb48c7f979d23e03 Mon Sep 17 00:00:00 2001 From: William Tan Date: Mon, 3 Oct 2022 13:30:25 -0400 Subject: [PATCH] silence clang warning for arm --- lib/Decompiler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Decompiler.cpp b/lib/Decompiler.cpp index ebd7b48f..7bcbe5dd 100644 --- a/lib/Decompiler.cpp +++ b/lib/Decompiler.cpp @@ -81,6 +81,12 @@ Result Decompile( std::vector args{"-Wno-pointer-to-int-cast", "-Wno-pointer-sign", "-target", module->getTargetTriple()}; + // Silence clang warning + // warning: unknown platform, assumming -mfloat-abi=soft + const auto& triple{llvm::Triple(module->getTargetTriple())}; + if (triple.isARM()) { + args.push_back("-mfloat-abi=soft"); + } auto ast_unit{clang::tooling::buildASTFromCodeWithArgs("", args, "out.c")}; rellic::DecompilationContext dec_ctx(*ast_unit); @@ -167,4 +173,4 @@ Result Decompile( return Result(std::move(error)); } } -} // namespace rellic \ No newline at end of file +} // namespace rellic