Cross-compiling NetBSD

Building current from a stable release

We want to keep the tools there – no need to rebuild them each time

find sys/arch/amd64/conf/
time ./build.sh -T /root/tools -O /root/obj -j 16 tools
time ./build.sh -T /root/tools -O /root/obj -j 16 kernel=XEN3_DOMU

Building i386 from NetBSD/amd64

time sh build.sh -m i386 -j16 tools > ../make.tools.i386.log && echo TOOLS READY

then

time sh build.sh -m i386 kernel=LESSPLUS
#-T /usr/src/tooldir.NetBSD-8.0-i386/
#-u
#rm -rf /usr/src/sys/arch/i386/compile/obj/LESSPLUS
#rm -rf /usr/src/sys/arch/i386/compile/LESSPLUS

gzip -9 -c < /usr/src/sys/arch/i386/compile/obj/LESSPLUS/netbsd > ~/netbsd.LESSPLUS.gz

Building NetBSD from GNU/Linux

even though you do not need a destdir yet, it gets defined somewhere already

cd /var/tmp/usr/src/
time ./build.sh -m amd64 -T ../tools -O ../obj -D ../destdir -j 16 -u tools > ../make.tools.log && echo TOOLS ARE READY
#-n for dummy mode
#14m46.140s vs 4m40.773s

Resources

current

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/amd64/conf/XEN3_DOMU

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/amd64/conf/XEN3_DOMU?rev=HEAD

i386

https://www.netbsd.org/docs/guide/en/chap-build.html

https://www.netbsd.org/docs/guide/en/chap-build.html#chap-boot-cross-compiling-kernel

http://www.ki.nu/~makoto/diary/2003/01/11/

https://wiki.netbsd.org/bsd_make/

ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/share/mk/bsd.README

TRASH / DOES NOT WORK

echo $kernel
cd /usr/src/sys/arch/`uname -m`/conf/
rm -rf ../compile/$kernel/
USETOOLS=yes /usr/src/tooldir.NetBSD-8.0-i386/bin/nbconfig $kernel
cd ../compile/$kernel/
USETOOLS=yes /usr/src/tooldir.NetBSD-8.0-i386/bin/nbmake -j16 depend > /data/build/make.depend.log && echo done
USETOOLS=yes /usr/src/tooldir.NetBSD-8.0-i386/bin/nbmake -j16 > /data/build/make.log && echo done

mv /usr/share/mk/bsd.sys.mk /usr/share/mk/bsd.sys.mk.dist 
ln -s /data/build/usr/src/share/mk/bsd.sys.mk /usr/share/mk/bsd.sys.mk 

TRASH / TROUBLESHOOTING

http://www.rafb.me/results/tkHbVe93.html ../../../../sys/lwp.h:181:12: error: inline function ‘lwp_suspend’ declared but never defined [-Werror]

https://mail-index.netbsd.org/current-users/2017/08/06/msg032150.html defined i386 otherwise it may ask for i486 gcc


HOME | GUIDES | BENCHMARKS | html