core/gcc: move patch application to prepare()

Fixes #567