8151841: Build needs additional flags to compile with GCC 6 [plus parts of 8149647 & 8032045]

C++ standard needs to be explicitly set and some optimisations turned off to build on GCC 6

Reviewed-by: erikj, dholmes, kbarrett
4 files changed