Sync with brian's upstream

* Merge HG1310e
* Add slc6 compatibility patches