gcc: fix build for non-arm and remove bashism