Fix build errors from toolchain upgrade (gcc6-> gcc9)