[lld] [lld-macho]Define a macro to allow specifying the slop size at build time. (PR #164295)
Vy Nguyen via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 22 11:33:20 PDT 2025
================
@@ -1,3 +1,8 @@
+
+option(LLD_MACHO_SLOP_FACTOR
+ "Specify the slop factor. For very large build, the default of 256 might be too small, which can cause thunk-range overrun. Recommend increasing this value to 1024 or higher as needed.", 256)
----------------
oontvoo wrote:
> Is there any better documentation we can provide as to what this actually is/does? For example do we know what is causing a thunk-range overrun? Is there some coding patterns that may cause it? This seems like we are just putting a band-aid on what may be a bad coding practice.
Ok, how about describing the root cause (ie., too many consec branches)?
As for coding patterns that might cause it, one of them could be *not* using subsection_via_symbols (or anything that prevent deadstripping), which would create a giant input-section, increasing your chance of hitting this thunk-range overrun error.
Updated the code + docs to reflect that.
https://github.com/llvm/llvm-project/pull/164295
More information about the llvm-commits
mailing list