Remove DT_Failed mode
At the moment if -dynamic-too
fails then we rerun the whole pipeline as if we were just in -dynamic
mode. I argue this is
a misfeature and we should remove the so-called DT_Failed
mode.
In what situations do we fall back to DT_Failed
?
- If the
dyn_hi
file corresponding to ahi
file is missing completely. - If the interface hash of
dyn_hi
doesn't match the interface hash ofhi
.
What happens in DT_Failed
mode?
- The whole compiler pipeline is rerun as if the user had just passed
-dynamic
. - Therefore
dyn_hi/dyn_o
files are used which don't agree with thehi/o
files. (As evidenced bydynamicToo001
test). - This is very confusing as now a single compiler invocation has produced further
hi
/dyn_hi
files which are different to each other.
Why should we remove it?
- In
--make
mode, which is predominately usedDT_Failed
does not work (#19782 (closed)), there can't be users relying on this functionality. - In
-c
mode, the recovery doesn't fix the root issue, which is thedyn_hi
andhi
files are mismatched. We should instead produce an error and pass responsibility to the build system using-c
to ensure that the prerequisites for-dynamic-too
(dyn_hi/hi) files are there before we start compiling. - It is a misfeature to support use cases like
dynamicToo001
which allow you to mix different versions of dynamic/non-dynamic interface files. It's more likely to lead to subtle bugs in your resulting programs where out-dated build products are used rather than a deliberate choice. - In practice, people are usually compiling with
-dynamic-too
rather than separately with-dynamic
and-static
, so the build products always match andDT_Failed
is only entered due to compiler bugs (see !6583 (closed))
What should we do instead?
- In
--make
mode, for home packages check during recompilation checking thatdyn_hi
andhi
are both present and agree, recompile the modules if they do not. - For package modules, when loading the interface check that
dyn_hi
andhi
are there and that they agree but fail with an error message if they are not. - In
--oneshot
mode, fail with an error message if the right files aren't already there.