-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Description
The ld GNU linker supports the --dependency-file= flag to report a .d dependency file so that build systems can relink if anything the linker uses changes. The ROCm support in armclang will generate temporary object files that are then reported by the linker in these dependency files. When the frontend then cleans up these temporary files, the build system gets "grumpy" and either complains that a dependency doesn't exist and cannot be made or gives up and just forces the command to rerun (therefore never having a "clean" build).
I have filed a binutils RFE to support a new flag to suppress reporting of frontend-marked temporary object files in these dependency files but this requires detecting linker support for the flag in the first place. On the frontend side, we have a few possible mitigations until a suitable binutils is "everywhere":
- accept an
--offload-object-dirflag to place the objects in and make them non-temporary (don't clean them up) so that the build system can at least make sure they're in a per-link unique place to avoid conflicts - intercept
-Wl,--dependency-file=and rewrite it to remove the temporary objects (blech, but mentioned for completeness)