https://github.com/luporl requested changes to this pull request. This patch breaks the `lto-flags` test on Darwin. Please check the suggested change. Also note that I have tested the change on Darwin only. https://github.com/llvm/llvm-project/pull/74496