From 7e2823438e920d25364ff92b62ad90020c31bb59 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 5 Oct 2023 10:19:13 -0400 Subject: Reland "[HIP] Support compressing device binary" Original PR: https://github.com/llvm/llvm-project/pull/67162 The commit was reverted due to UB detected by santizer: https://lab.llvm.org/buildbot/#/builders/238/builds/5955 clang/lib/Driver/OffloadBundler.cpp:1012:25: runtime error: load of misaligned address 0xaaaae2d90e7c for type 'const uint64_t' (aka 'const unsigned long'), which requires 8 byte alignment It was fixed by using memcpy instead of dereferencing int* casted from unaligned char*. --- llvm/lib/Object/ObjectFile.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Object/ObjectFile.cpp') diff --git a/llvm/lib/Object/ObjectFile.cpp b/llvm/lib/Object/ObjectFile.cpp index 2a67246..428166f 100644 --- a/llvm/lib/Object/ObjectFile.cpp +++ b/llvm/lib/Object/ObjectFile.cpp @@ -158,6 +158,8 @@ ObjectFile::createObjectFile(MemoryBufferRef Object, file_magic Type, case file_magic::cuda_fatbinary: case file_magic::offload_binary: case file_magic::dxcontainer_object: + case file_magic::offload_bundle: + case file_magic::offload_bundle_compressed: return errorCodeToError(object_error::invalid_file_type); case file_magic::tapi_file: return errorCodeToError(object_error::invalid_file_type); -- cgit v1.1