From bc33c2fa0c2a68a0431df0d825cc6df99a1883db Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 21 Jul 2022 09:25:43 -0400 Subject: [PATCH] [Binary] Hard-code the alignment of the offloading binary Summary: We previously used `alignof` to get the necessary alignment of the binary header. However this was different on 32-bit platforms and caused a few tests to fail because of it. This patch just changes this to be a hard-coded constant of 8. --- llvm/include/llvm/Object/OffloadBinary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/include/llvm/Object/OffloadBinary.h b/llvm/include/llvm/Object/OffloadBinary.h index 311e21f..4bff91c 100644 --- a/llvm/include/llvm/Object/OffloadBinary.h +++ b/llvm/include/llvm/Object/OffloadBinary.h @@ -80,7 +80,7 @@ public: /// Serialize the contents of \p File to a binary buffer to be read later. static std::unique_ptr write(const OffloadingImage &); - static uint64_t getAlignment() { return alignof(Header); } + static uint64_t getAlignment() { return 8; } ImageKind getImageKind() const { return TheEntry->TheImageKind; } OffloadKind getOffloadKind() const { return TheEntry->TheOffloadKind; } -- 2.7.4