Diagnostics from tools like gcc/ld are reported as errors regardless of whether the tool call was successful
See the output in #27060, gcc reports a bunch of warnings that we report as errors:
```
rts/Interpreter.c:255:32: error:
note: in expansion of macro ‘Sp_plusB’
255 | #define Sp_plusW(n) ((void*)Sp_plusB((ptrdiff_t)(n) * (ptrdiff_t)sizeof(W_)))
| ^~~~~~~~
|
255 | #define Sp_plusW(n) ((void*)Sp_plusB((ptrdiff_t)(n) * (ptrdiff_t)sizeof(W_)))
| ^
...
rts/Capability.h:281:27: error:
warning: inlining failed in call to ‘getCapability’: function not considered for inlining [-Winline]
281 | INLINE_HEADER Capability *getCapability(uint32_t i)
| ^~~~~~~~~~~~~
|
281 | INLINE_HEADER Capability *getCapability(uint32_t i)
| ^
```
Confusingly, the build carries on regardless of these errors, because the tool call actually succeeded.
I suggest that we should report tool diagnostics as warnings if the tool call succeeds (i.e. with a non-zero exit code).
issue