In string-inspired semi-realistic heterotic orbifolds models with an
anomalous $U(1)_X$, a nonzero Kobayashi-Masakawa (KM) phase is shown to arise
generically from the expectation values of complex scalar fields, which appear
in nonrenormalizable quark mass couplings. Modular covariant nonrenormalizable
superpotential couplings are constructed. A toy $Z_3$ orbifold model is
analyzed in some detail. Modular symmetries and orbifold selection rules are
taken into account and do not lead to a cancellation of the KM phase. We also
discuss attempts to obtain the KM phase solely from renormalizable
interactions.