Least-squares spectral methods for ODE eigenvalue problems