Skip to content

Commit 359f170

Browse files
committed
[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: llvm#63961 Reviewed By: #lld-macho, keith Differential Revision: https://reviews.llvm.org/D155761
1 parent fc5dcb0 commit 359f170

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lld/MachO/Writer.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,10 +1182,7 @@ void Writer::writeUuid() {
11821182
TimeTraceScope timeScope("Computing UUID");
11831183

11841184
ArrayRef<uint8_t> data{buffer->getBufferStart(), buffer->getBufferEnd()};
1185-
unsigned chunkCount = parallel::strategy.compute_thread_count() * 10;
1186-
// Round-up integer division
1187-
size_t chunkSize = (data.size() + chunkCount - 1) / chunkCount;
1188-
std::vector<ArrayRef<uint8_t>> chunks = split(data, chunkSize);
1185+
std::vector<ArrayRef<uint8_t>> chunks = split(data, 1024 * 1024);
11891186
// Leave one slot for filename
11901187
std::vector<uint64_t> hashes(chunks.size() + 1);
11911188
SmallVector<std::shared_future<void>> threadFutures;

0 commit comments

Comments
 (0)