Skip to content

Commit 20b2d32

Browse files
committed
[lld-macho] Work around odr-use of const non-inline static data member to fix -O0 build after D128298
``` ld.lld: error: undefined symbol: lld::macho::CodeSignatureSection::blockSize >>> referenced by SyntheticSections.cpp:1253 (/home/maskray/llvm/lld/MachO/SyntheticSections.cpp:1253) >>> tools/lld/MachO/CMakeFiles/lldMachO.dir/SyntheticSections.cpp.o:(lld::macho::CodeSignatureSection::writeHashes(unsigned char*) const::$_7::operator()(unsigned long) const) ```
1 parent c866f85 commit 20b2d32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lld/MachO/SyntheticSections.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,8 @@ void CodeSignatureSection::writeHashes(uint8_t *buf) const {
12501250
uint8_t *hashes = buf + fileOff + allHeadersSize;
12511251
parallelFor(0, getBlockCount(), [&](size_t i) {
12521252
sha256(buf + i * blockSize,
1253-
std::min(static_cast<size_t>(fileOff - i * blockSize), blockSize),
1253+
std::min(static_cast<size_t>(fileOff - i * blockSize),
1254+
static_cast<size_t>(blockSize)),
12541255
hashes + i * hashSize);
12551256
});
12561257
#if defined(__APPLE__)

0 commit comments

Comments
 (0)