Support gcc 8 on arm (cherry picked from commit 361f4164) (cherry picked from commit cb17e9874fb881d0147d44b29163e35471cf00f6)