Upstream CyanogenMod changes and use more stable optimization flags