In GNAT, we record compilation arguments in the ALI file (which is logically, though not physically, part of the object file). The ada make utility (gnatmake) has an option to consider a change of compiler options as reason to recompile.