Cherry-pick https://reviews.llvm.org/D99501 to allow -flto=auto

This commit is contained in:
Sylvestre Ledru 2021-03-30 09:00:54 +02:00
parent 0ec7afdacf
commit be30768c5e
3 changed files with 36 additions and 1 deletions

5
debian/changelog vendored
View File

@ -3,7 +3,10 @@ llvm-toolchain-12 (1:12.0.0~++rc3-5) UNRELEASED; urgency=medium
[ Matthias Klose <doko@ubuntu.com> ]
* Add optimize=-lto to DEB_BUILD_MAINT_OPTIONS.
-- Gianfranco Costamagna <locutusofborg@debian.org> Mon, 22 Mar 2021 16:50:05 +0100
[ Sylvestre Ledru ]
* Cherry-pick https://reviews.llvm.org/D99501 to allow -flto=auto
-- Sylvestre Ledru <sylvestre@debian.org> Tue, 30 Mar 2021 09:00:26 +0200
llvm-toolchain-12 (1:12.0.0~++rc3-4) unstable; urgency=medium

View File

@ -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<LTOKind>(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();

View File

@ -135,3 +135,4 @@ print-lldb-path.patch
libcxx-armhf-ftbfs.diff
lld-use-link-atomic-i386.diff
bring-reporter-back.patch
D99501-ignore-lto-auto.diff