fix gcc version related build errors