I'm very used to building netbsd with build.sh. I would also like to use the cross tools built by netbsd to build other programs for a target netbsd system. Normally ld knows to link in libc and crt0, etc. The cross tools don't seem to: $ /usr/obj/gdt-5/tools/i386--netbsdelf/bin/gcc test.c /usr/obj/gdt-5/tools/lib/gcc/i386--netbsdelf/4.1.3/../../../../i386--netbsdelf/bin/ld: crt0.o: No such file: No such file or directory collect2: ld returned 1 exit status So, it seems that I have to pass flags to the linker to find a bunch of things, and perhaps to tell cc and ld not to look in the host system. In mk/bsd.prog.mk, it appears that all of those arguments are constructed into the link target. I'm sure I can replicate all of that, but it would seem easier to have wrapper scripts that act like the native commands, but grab from the destdir. In my case I am crossbuilding to the netbsd target I just built netbsd for, so having the destdir baked in is fine. Has anyone else struggled with this? Am I on the right track, or confused?
Attachment:
pgpSazgjdLtjc.pgp
Description: PGP signature