[PATCH] D108246: [clang-offload-wrapper] Disabled ELF offload notes embedding by default.
Vyacheslav Zakharin via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 17 14:50:30 PDT 2021
vzakhari created this revision.
vzakhari added a reviewer: jhuber6.
vzakhari added a project: OpenMP.
vzakhari requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: cfe-commits, sstefan1.
Herald added a project: clang.
This change-set puts 93d08acaacec951dbb302f77eeae51974985b6b2 <https://reviews.llvm.org/rG93d08acaacec951dbb302f77eeae51974985b6b2> functionality
under -add-omp-offload-notes switch that is OFF by default.
CUDA toolchain is not able to handle ELF images with LLVMOMPOFFLOAD
notes for unknown reason (see https://reviews.llvm.org/D99551#2950272).
I disable the ELF notes embedding until the CUDA issue is triaged and resolved.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D108246
Files:
clang/test/Driver/clang-offload-wrapper.c
clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
Index: clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
===================================================================
--- clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
+++ clang/tools/clang-offload-wrapper/ClangOffloadWrapper.cpp
@@ -76,6 +76,9 @@
"This option forces print-out of the temporary files' names."),
cl::Hidden);
+static cl::opt<bool> AddOpenMPOffloadNotes("add-omp-offload-notes",
+ cl::desc("Add LLVMOMPOFFLOAD ELF notes to ELF device images."), cl::Hidden);
+
namespace {
class BinaryWrapper {
@@ -630,7 +633,7 @@
return 1;
}
std::unique_ptr<MemoryBuffer> Buffer(std::move(*BufOrErr));
- if (File != "-") {
+ if (File != "-" && AddOpenMPOffloadNotes) {
// Adding ELF notes for STDIN is not supported yet.
Buffer = Wrapper.addELFNotes(std::move(Buffer), File);
}
Index: clang/test/Driver/clang-offload-wrapper.c
===================================================================
--- clang/test/Driver/clang-offload-wrapper.c
+++ clang/test/Driver/clang-offload-wrapper.c
@@ -19,7 +19,7 @@
//
// Check bitcode produced by the wrapper tool.
//
-// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.bc %t.tgt 2>&1 | FileCheck %s --check-prefix ELF-WARNING
+// RUN: clang-offload-wrapper -add-omp-offload-notes -target=x86_64-pc-linux-gnu -o %t.wrapper.bc %t.tgt 2>&1 | FileCheck %s --check-prefix ELF-WARNING
// RUN: llvm-dis %t.wrapper.bc -o - | FileCheck %s --check-prefix CHECK-IR
// ELF-WARNING: is not an ELF image, so notes cannot be added to it.
@@ -58,16 +58,16 @@
// Check that clang-offload-wrapper adds LLVMOMPOFFLOAD notes
// into the ELF offload images:
// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.64le -DBITS=64 -DENCODING=LSB
-// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf64le.bc %t.64le
+// RUN: clang-offload-wrapper -add-omp-offload-notes -target=x86_64-pc-linux-gnu -o %t.wrapper.elf64le.bc %t.64le
// RUN: llvm-dis %t.wrapper.elf64le.bc -o - | FileCheck %s --check-prefix OMPNOTES
// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.64be -DBITS=64 -DENCODING=MSB
-// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf64be.bc %t.64be
+// RUN: clang-offload-wrapper -add-omp-offload-notes -target=x86_64-pc-linux-gnu -o %t.wrapper.elf64be.bc %t.64be
// RUN: llvm-dis %t.wrapper.elf64be.bc -o - | FileCheck %s --check-prefix OMPNOTES
// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.32le -DBITS=32 -DENCODING=LSB
-// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf32le.bc %t.32le
+// RUN: clang-offload-wrapper -add-omp-offload-notes -target=x86_64-pc-linux-gnu -o %t.wrapper.elf32le.bc %t.32le
// RUN: llvm-dis %t.wrapper.elf32le.bc -o - | FileCheck %s --check-prefix OMPNOTES
// RUN: yaml2obj %S/Inputs/empty-elf-template.yaml -o %t.32be -DBITS=32 -DENCODING=MSB
-// RUN: clang-offload-wrapper -target=x86_64-pc-linux-gnu -o %t.wrapper.elf32be.bc %t.32be
+// RUN: clang-offload-wrapper -add-omp-offload-notes -target=x86_64-pc-linux-gnu -o %t.wrapper.elf32be.bc %t.32be
// RUN: llvm-dis %t.wrapper.elf32be.bc -o - | FileCheck %s --check-prefix OMPNOTES
// There is no clean way for extracting the offload image
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108246.367024.patch
Type: text/x-patch
Size: 3281 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210817/5251b624/attachment.bin>
More information about the cfe-commits
mailing list