make changes to adapt to gnu toolchain