upstream lithium changes (almost no PPC code yet)