Waveform-controlled relativistic high-order-harmonic generation