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

This commit is contained in:
Sylvestre Ledru 2021-03-30 09:02:36 +02:00
parent 92859112c1
commit 7ea12d7eda
3 changed files with 33 additions and 0 deletions

1
debian/changelog vendored
View File

@ -4,6 +4,7 @@ llvm-toolchain-snapshot (1:13~++20210218085556+fcdef15d77bd-1~exp1) UNRELEASED;
* New snapshot release
* "run-clang-tidy" install it
* Only enable libomp-13-doc on supported archs
* Cherry-pick https://reviews.llvm.org/D99501 to allow -flto=auto
[ John Paul Adrian Glaubitz ]
* Add upstream patch D98574 to fix clang macro definitions on sparc64

View File

@ -0,0 +1,31 @@
Index: llvm-toolchain-snapshot_13~++20210330090254+142d522dedbb/clang/include/clang/Driver/Driver.h
===================================================================
--- llvm-toolchain-snapshot_13~++20210330090254+142d522dedbb.orig/clang/include/clang/Driver/Driver.h
+++ llvm-toolchain-snapshot_13~++20210330090254+142d522dedbb/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-snapshot_13~++20210330090254+142d522dedbb/clang/lib/Driver/Driver.cpp
===================================================================
--- llvm-toolchain-snapshot_13~++20210330090254+142d522dedbb.orig/clang/lib/Driver/Driver.cpp
+++ llvm-toolchain-snapshot_13~++20210330090254+142d522dedbb/clang/lib/Driver/Driver.cpp
@@ -610,9 +610,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

@ -139,3 +139,4 @@ print-lldb-path.patch
libcxx-armhf-ftbfs.diff
lld-use-link-atomic-i386.diff
lower-python-dep.diff
D99501-ignore-lto-auto.diff