Revert "Switch back to GCC 4.7"

This reverts commit b401dea4a99900c5bc4e8c70caf7fda6f0620ac8.
Adapt gcc 4.7 for slim