I have a NetBSD VM that I created using qemu, and I am trying to compile a simple Hello World.c
program with the cross compiled toolchain that I built using the build.sh
script that comes with the NetBSD source. However, I can not get the program to compile.
I built the toolchain with the following commands,
./build.sh -m evbarm tools
./build.sh -m evbarm -U distribution
And the output from the above commands yields,
===> Tools built to /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386
===> build.sh ended: Sat Nov 28 12:52:34 CST 2015
===> Summary of results:
build.sh command: ./build.sh -m evbarm tools
build.sh started: Sat Nov 28 12:48:47 CST 2015
NetBSD version: 4.0
MACHINE: evbarm
MACHINE_ARCH: arm
Build platform: NetBSD 4.0.1 i386
HOST_SH: /bin/sh
No nonexistent/bin/nbmake, needs building.
Bootstrapping nbmake
TOOLDIR path: /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386
DESTDIR path: /opt/cross/evbarm/usr/src/destdir.evbarm
RELEASEDIR path: /opt/cross/evbarm/usr/src/releasedir
Created /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/nbmake
makewrapper: /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/nbmake-evbarm
Updated /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/nbmake-evbarm
Tools built to /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386
build.sh ended: Sat Nov 28 12:52:34 CST 2015
===> .
make distribution started at: Sat Nov 28 14:31:23 CST 2015
make distribution finished at: Sat Nov 28 15:04:34 CST 2015
===> Successful make distribution
===> build.sh ended: Sat Nov 28 15:04:34 CST 2015
===> Summary of results:
build.sh command: ./build.sh -m evbarm -U distribution
build.sh started: Sat Nov 28 14:31:20 CST 2015
NetBSD version: 4.0
MACHINE: evbarm
MACHINE_ARCH: arm
Build platform: NetBSD 4.0.1 i386
HOST_SH: /bin/sh
No nonexistent/bin/nbmake, needs building.
Bootstrapping nbmake
TOOLDIR path: /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386
DESTDIR path: /opt/cross/evbarm/usr/src/destdir.evbarm
RELEASEDIR path: /opt/cross/evbarm/usr/src/releasedir
Created /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/nbmake
makewrapper: /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/nbmake-evbarm
Updated /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/nbmake-evbarm
Successful make distribution
build.sh ended: Sat Nov 28 15:04:34 CST 2015
===> .
However, when I try to compile helloARM.c
using the nbmake-evbarm
wrapper I get the following output,
$ nbmake-evbarm ./helloARM
/opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/arm--netbsdelf-gcc -O2 -Werror -nostdinc -isystem /opt/cross/evbarm/usr/src/destdir.evbarm/usr/include -o ./helloARM ./helloARM.c
/opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/lib/gcc/arm--netbsdelf/4.1.2/../../../../arm--netbsdelf/bin/ld: crt0.o: No such file: No such file or directory
collect2: ld returned 1 exit status
*** Failed target: ./helloARM
*** Failed command: /opt/cross/evbarm/usr/src/tooldir.NetBSD-4.0.1-i386/bin/arm--netbsdelf-gcc -O2 -Werror -nostdinc -isystem /opt/cross/evbarm/usr/src/destdir.evbarm/usr/include -o ./helloARM ./helloARM.c
*** Error code 1
Stop.
nbmake: stopped in /home/capin/apps