diff options
author | Fangrui Song <i@maskray.me> | 2023-07-19 17:24:36 -0700 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2023-07-19 17:24:36 -0700 |
commit | 359f170f5f712ee714193b46bad45a45656b2c59 (patch) | |
tree | f1d834697d7932eb25f6867fd8db54f187e8f02c /lld/MachO | |
parent | fc5dcb0c22e07d76bc64db45a0c1cd584a9f2209 (diff) | |
download | llvm-359f170f5f712ee714193b46bad45a45656b2c59.zip llvm-359f170f5f712ee714193b46bad45a45656b2c59.tar.gz llvm-359f170f5f712ee714193b46bad45a45656b2c59.tar.bz2 |
[lld-macho] Use fixed chunk size for UUID
Chunk size decided by the thread count makes the UUID less deterministic
(e.g. across machines with different core counts.)
Follow ELF and just use a fixed chunksize.
Fixes: https://github.com/llvm/llvm-project/issues/63961
Reviewed By: #lld-macho, keith
Differential Revision: https://reviews.llvm.org/D155761
Diffstat (limited to 'lld/MachO')
-rw-r--r-- | lld/MachO/Writer.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp index 871e496..1b0e64a 100644 --- a/lld/MachO/Writer.cpp +++ b/lld/MachO/Writer.cpp @@ -1182,10 +1182,7 @@ void Writer::writeUuid() { TimeTraceScope timeScope("Computing UUID"); ArrayRef<uint8_t> data{buffer->getBufferStart(), buffer->getBufferEnd()}; - unsigned chunkCount = parallel::strategy.compute_thread_count() * 10; - // Round-up integer division - size_t chunkSize = (data.size() + chunkCount - 1) / chunkCount; - std::vector<ArrayRef<uint8_t>> chunks = split(data, chunkSize); + std::vector<ArrayRef<uint8_t>> chunks = split(data, 1024 * 1024); // Leave one slot for filename std::vector<uint64_t> hashes(chunks.size() + 1); SmallVector<std::shared_future<void>> threadFutures; |