From 85157dae45754d7071446032f5934f6617e8b04c Mon Sep 17 00:00:00 2001 From: Gianfranco Costamagna Date: Wed, 25 Nov 2020 10:45:21 +0100 Subject: [PATCH] Add upstream patch D92052 to fix a gcn offload compiler issue with gcc (Closes: #975692) --- debian/changelog | 4 ++ debian/patches/D92052.patch | 77 +++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 82 insertions(+) create mode 100644 debian/patches/D92052.patch diff --git a/debian/changelog b/debian/changelog index cd6c48e8..c6b29d38 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,13 @@ llvm-toolchain-snapshot (1:12~++20201124100523+245052ac3080-1~exp1) UNRELEASED; urgency=medium + [ Sylvestre Ledru ] * experimental New snapshot release * Workaround a static_assert on https://bugs.llvm.org/show_bug.cgi?id=48259 "static assertion failed: Recycler allocation size is less than object size!" + [ Gianfranco Costamagna ] + * Add upstream patch D92052 to fix a gcn offload compiler issue with gcc (Closes: #975692) + -- Sylvestre Ledru Tue, 24 Nov 2020 10:08:59 +0100 llvm-toolchain-snapshot (1:12~++20201105093023+cc2a2bb5ce5-1~exp1) experimental; urgency=medium diff --git a/debian/patches/D92052.patch b/debian/patches/D92052.patch new file mode 100644 index 00000000..4c198788 --- /dev/null +++ b/debian/patches/D92052.patch @@ -0,0 +1,77 @@ +Index: llvm/lib/MC/MCParser/ELFAsmParser.cpp +=================================================================== +--- a/llvm/lib/MC/MCParser/ELFAsmParser.cpp ++++ b/llvm/lib/MC/MCParser/ELFAsmParser.cpp +@@ -652,10 +652,13 @@ + !(SectionName == ".eh_frame" && Type == ELF::SHT_PROGBITS)) + Error(loc, "changed section type for " + SectionName + ", expected: 0x" + + utohexstr(Section->getType())); +- if (Section->getFlags() != Flags) ++ // Check that flags are used consistently. However, the GNU assembler permits ++ // to leave out in subsequent uses of the same sections; for compatibility, ++ // do likewise. ++ if ((Flags || Size || !TypeName.empty()) && Section->getFlags() != Flags) + Error(loc, "changed section flags for " + SectionName + ", expected: 0x" + + utohexstr(Section->getFlags())); +- if (Section->getEntrySize() != Size) ++ if ((Flags || Size || !TypeName.empty()) && Section->getEntrySize() != Size) + Error(loc, "changed section entsize for " + SectionName + + ", expected: " + Twine(Section->getEntrySize())); + +Index: llvm/test/MC/ELF/section-entsize-changed.s +=================================================================== +--- a/llvm/test/MC/ELF/section-entsize-changed.s ++++ b/llvm/test/MC/ELF/section-entsize-changed.s +@@ -10,3 +10,26 @@ + .pushsection .foo,"aM",@progbits,4 + + .pushsection .foo,"aM",@progbits,1 ++ ++ ++bar: ++.section .bar,"ax",@progbits ++ ++.section .bar ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .bar, expected: 0x6 ++.section .bar,"awx",@progbits ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .bar, expected: 0x6 ++.pushsection .bar,"a",@progbits ++ ++.pushsection .bar ++ ++foobar: ++.section .foobar,"ax",@progbits; .byte 1 ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .foobar, expected: 0x6 ++.section .foobar,"",@progbits; .byte 2 ++ ++# CHECK: {{.*}}.s:[[# @LINE+1]]:1: error: changed section flags for .foobar, expected: 0x6 ++.section .foobar,"a",@progbits; .byte 3 +Index: llvm/test/MC/ELF/section-omitted-attributes.s +=================================================================== +--- /dev/null ++++ llvm/test/MC/ELF/section-omitted-attributes.s +@@ -0,0 +1,21 @@ ++# RUN: llvm-mc -triple=x86_64 %s -o - | FileCheck %s ++ ++// CHECK: .section .foo,"aM",@progbits,1 ++// CHECK: .section .bar,"aM",@progbits,4 ++ ++foo: ++.section .foo,"aM",@progbits,1 ++ ++.section .foo ++ ++.pushsection .foo ++ ++.pushsection .foo ++ ++.section .bar,"aM",@progbits,4 ++ ++.section .bar ++ ++.pushsection .bar,"aM",@progbits,4 ++ ++.pushsection .bar diff --git a/debian/patches/series b/debian/patches/series index 8dbf74d1..09deebe3 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -136,3 +136,4 @@ print-lldb-path.patch libcxx-armhf-ftbfs.diff lld-use-link-atomic-i386.diff workaround-bug-48259.diff +D92052.patch