From ce3b2190211292a704da413501afc9e502c0f148 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sat, 20 Nov 2021 16:40:15 +0100 Subject: [PATCH] Toolchain/Clang: Allow setting a default unwind library This will let us use `libgcc` for unwinding when we build the LLVM port with the GNU toolchain. --- Toolchain/Patches/llvm.patch | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Toolchain/Patches/llvm.patch b/Toolchain/Patches/llvm.patch index 08034e1dc0..88f73d824d 100644 --- a/Toolchain/Patches/llvm.patch +++ b/Toolchain/Patches/llvm.patch @@ -136,10 +136,10 @@ index 58ae08a38..8e9a3fee6 100644 options::OPT_foperator_names, false)) diff --git a/clang/lib/Driver/ToolChains/Serenity.cpp b/clang/lib/Driver/ToolChains/Serenity.cpp new file mode 100644 -index 000000000..b21be0f9d +index 000000000..461f55ad3 --- /dev/null +++ b/clang/lib/Driver/ToolChains/Serenity.cpp -@@ -0,0 +1,280 @@ +@@ -0,0 +1,281 @@ +//===---- Serenity.cpp - SerenityOS ToolChain Implementation ----*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. @@ -150,6 +150,7 @@ index 000000000..b21be0f9d + +#include "Serenity.h" +#include "CommonArgs.h" ++#include "clang/Config/config.h" +#include "clang/Driver/Compilation.h" +#include "clang/Driver/Driver.h" +#include "clang/Driver/DriverDiagnostic.h" @@ -396,7 +397,7 @@ index 000000000..b21be0f9d +Serenity::GetUnwindLibType(const llvm::opt::ArgList &Args) const { + + const Arg *A = Args.getLastArg(options::OPT_unwindlib_EQ); -+ StringRef LibName = A ? A->getValue() : ""; ++ StringRef LibName = A ? A->getValue() : CLANG_DEFAULT_UNWINDLIB; + + if (LibName == "none") { + return ToolChain::UNW_None;