fix endianess build in a better way