Back to stock toolchain

Revert "Fix a bunch of small system/core bugs."

This reverts commit b31ad0e41dc193a3a0bd5b6791e84b5f1c4710ab.

Revert "Fix build"

This reverts commit 8de22ef1a00f417fa862ed3a5035df34905f053f.

Revert "Fix build with gcc-4.8+ and unused-parameter error"

This reverts commit 78ac286ba5fbf7cf017523b19c5af3ca99a27775.