From 8a5a9a4172fe34f3bd92334e112bedcdd6956435 Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Mon, 27 Sep 2021 15:37:26 +0200 Subject: [PATCH] Add two patches from ubuntu to fix lto and gcc-11 build failures --- debian/patches/D99501-ignore-lto-auto.diff | 31 +++++++++++++++++++ .../patches/fix-missing-include-limit.patch | 26 ++++++++++++++++ debian/patches/series | 2 ++ 3 files changed, 59 insertions(+) create mode 100644 debian/patches/D99501-ignore-lto-auto.diff create mode 100644 debian/patches/fix-missing-include-limit.patch diff --git a/debian/patches/D99501-ignore-lto-auto.diff b/debian/patches/D99501-ignore-lto-auto.diff new file mode 100644 index 00000000..0c09bcc2 --- /dev/null +++ b/debian/patches/D99501-ignore-lto-auto.diff @@ -0,0 +1,31 @@ +Index: llvm-toolchain-12-12.0.0~++rc3/clang/include/clang/Driver/Driver.h +=================================================================== +--- llvm-toolchain-12-12.0.0~++rc3.orig/clang/include/clang/Driver/Driver.h ++++ llvm-toolchain-12-12.0.0~++rc3/clang/include/clang/Driver/Driver.h +@@ -51,7 +51,8 @@ enum LTOKind { + LTOK_None, + LTOK_Full, + LTOK_Thin, +- LTOK_Unknown ++ LTOK_Unknown, ++ LTOK_Ignored + }; + + /// Driver - Encapsulate logic for constructing compilation processes +Index: llvm-toolchain-12-12.0.0~++rc3/clang/lib/Driver/Driver.cpp +=================================================================== +--- llvm-toolchain-12-12.0.0~++rc3.orig/clang/lib/Driver/Driver.cpp ++++ llvm-toolchain-12-12.0.0~++rc3/clang/lib/Driver/Driver.cpp +@@ -608,9 +608,12 @@ void Driver::setLTOMode(const llvm::opt: + LTOMode = llvm::StringSwitch(LTOName) + .Case("full", LTOK_Full) + .Case("thin", LTOK_Thin) ++ .Case("auto", LTOK_Ignored) ++ .Case("jobserver", LTOK_Ignored) + .Default(LTOK_Unknown); + + if (LTOMode == LTOK_Unknown) { ++ // FIXME: check if argument is a number, then ignore, or handle it + assert(A); + Diag(diag::err_drv_unsupported_option_argument) << A->getOption().getName() + << A->getValue(); diff --git a/debian/patches/fix-missing-include-limit.patch b/debian/patches/fix-missing-include-limit.patch new file mode 100644 index 00000000..37242b2a --- /dev/null +++ b/debian/patches/fix-missing-include-limit.patch @@ -0,0 +1,26 @@ +From b498303066a63a203d24f739b2d2e0e56dca70d1 Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Tue, 10 Nov 2020 14:55:25 +0100 +Subject: [PATCH] [nfc] Fix missing include + +Origin: backport, https://github.com/llvm/llvm-project/commit/b498303066a63a203d24f739b2d2e0e56dca70d1 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/llvm-toolchain-11/+bug/1939424 +Applied-Upstream: 12.0.0 +Reviewed-By: Sergio Durigan Junior + +--- + llvm/utils/benchmark/src/benchmark_register.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h +index 0705e219f2fa..4caa5ad4da07 100644 +--- a/llvm/utils/benchmark/src/benchmark_register.h ++++ b/llvm/utils/benchmark/src/benchmark_register.h +@@ -1,6 +1,7 @@ + #ifndef BENCHMARK_REGISTER_H + #define BENCHMARK_REGISTER_H + ++#include + #include + + #include "check.h" diff --git a/debian/patches/series b/debian/patches/series index a436aca5..82c1a119 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -147,3 +147,5 @@ D91833-bpftrace-fix-code-gen.diff scan-build-py-fix-default-bin.diff mesa-texture-failure.patch remove-cyclades.diff +D99501-ignore-lto-auto.diff +fix-missing-include-limit.patch