The syntactic and phonological literatures often diverge in their approach to affix ordering. The syntactic literature assumes that affix order results directly from syntactic processes, while the phonological literature assumes that affixes are ordered by PF. I present a bridge between these two viewpoints, called Optimal Linearization, comprising a set of freely rerankable OT constraints which enforce correspondence between syntactic structure and linear ordering. This system has the benefit of making clear typological predictions about the relationship between sub-word affix order and sentence-level word order. I illustrate the workings of this system with an affix ordering puzzle from Arabic.