Beyond Good and Evil: Formalizing the Security Guarantees of Compartmentalizing Compilation