core/gcc: move patch application to prepare()

Fixes #567
Merge pull request #568 from tmc/master

core/gcc: move patch application to prepare()