I don't think that's cheating. That's disobedience to arbitrary dictates. You didn't dodge the essential aspects of the exercise (learn what gcc does), just the accidental aspects.
That's like if a professor insisted that you use a particular brand of pen when writing the exam. Disobeying that order isn't cheating.
That's like if a professor insisted that you use a particular brand of pen when writing the exam. Disobeying that order isn't cheating.