There is no such option either for the Darwin/OS X ld
or GNU/Linux ld
.
The error-limiting options of compilers - clang's -ferror-limit
, gcc's -fmax-errors
-
draw motivation from the fact that a compiler stands the same chance of detecting
the first error anytime as it munches your code, and once it has detected the
first one, the chances of detecting more escalate. It compiles some, detects an
error; compiles some more as best it can; detects another error, compiles some more,
and so on.
So if you tell it N errors maximum, you are telling it: When you hit N errors, you can
call it a day and save our time.
It's different for linkage. No matter how many unresolved symbol references the linker racks
up as it consumes input files, the next input file can resolve them all. So it hasn't
got any undefined symbol errors until it has consumed the last input file,
and then it has got them all.
So if you could tell it N undefined symbol errors maximum, you'd be telling it: Do all
the work and detect all the errors anyway, but I only want to hear about the first N.
The linker writers haven't thought this a compelling capability so far.