In the end it wasn't hardware problem. It was debian mirror problem. I have changed it and reinstalled gcc and libc6-dev, and it started working normally. mirror was deb http://http.us.debian.org/debian/ unstable main now it is deb http://nl.arm.mirror.debian.net/debian unstable main