https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119435
--- Comment #3 from Iain Sandoe <iains at gcc dot gnu.org> --- (In reply to Sergey Fedorov from comment #2) > (In reply to Iain Sandoe from comment #1) > > I am actually surprised we don't have an enhancement bug for this. > > > > The reason we do not have this is because it needs linker support (for a > > complete impl.) I have looked into the possibility of using collect2 to do > > this (but inconclusive) .. so let's track this as an enhancement bug. > > > > In the meantime, you have no solution except to make the priority attribute > > conditional on !defined(__APPLE__). > > Thank you. Indeed, surprising that nobody reported it. I have seen an old > issue in OpenBLAS repo re Solaris and Darwin, but it was of 2015, I assumed > it might have been fixed for common targets since then: > https://github.com/OpenMathLib/OpenBLAS/issues/700 > > Does it work with clang btw? Let's be clear - without linker support, the ordering of CDTORs within one TU will be honoured (but _not_ between TUs without linker support ----- except that if you build the whole project with LTO then, effectively, that's one TU) AFAIR, clang accepts the option (for recent clang) but the constraints above still apply I have considered removing the error (matching clang) - but the trouble is as above and I think that will just lead to more BZs about wrong ordering.