fix generation for arm platforms Based on patch by Roman Yeryomin <roman@advem.lv>