Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
armv4--netbsdelf-eabi-gcc -o try -O2 -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -O2 -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib try.c -lm -lcrypt -lpthread
./try
and I got the following output:
sh: Cannot execute ELF binary ./try
The program compiled OK, but exited with status 2.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.