That reads as if your toolchain is picking up the host's sys/types.h rather than the target's sys/types.h
(ARM and most risc are different in a few details)
Someone asked on here recently if it made a difference which sys/types.h was used.
Answer: (days late) YES, it does.
gcc -E ...
Will show you the full paths of the include files being picked up.