i am currently playing around with netbsd a bit and i was very positively impressed by being able to crossbuild kernel and userland on a linux host. Now i wanted to see if it was possible to do the same for binary packages but i am hitting a wall and i am not really sure if i am doing something wrong or if it's just not possible (yet?).
At least the pkgsrc readme on crossbuilding seems to suggest that it's only supported on netbsd across different architectures and setting USE_CROSS_COMPILE=yes / CROSS_TOOLDIR=[tooldir-path] / CROSS_DESTDIR=[destdir-path] doesn't seem to work. The directory pointed to by CROSS_TOOLDIR contains the toolchain generated by build.sh during the build of the system, so there should be a usable toolchain available but from what i understand it isn't even used during the package build process. It seems to insist on building for linux and the architecture chosen by MACHINE_ARCH.
I managed to (somewhat) force it to use the cross toolchain by setting MACHINE_GNU_PLATFORM=i486--netbsdelf / NATIVE_MACHINE_GNU_PLATFORM=x86_64--netbsd and adding the the [tooldir]/bin directory to the path before running bmake but i doubt that's really the appropriate solution and it's not producing any usable results anyways. While it sometimes seems to work the linker regularly gets stuck trying link binaries which should come out native to netbsd against libraries/objects from the host system, which obviously fails.
Anyways, at this point i am out of ideas. Any pointers or information on if what i am trying to do is even possible would be greatly appreciated. I really don't want to run qemu just for building packages but i've spend so much time on trying to get this working already that unless someone has some kind of hint or suggestion i'll probably give up and bite the bullet. It would be quite awesome if i wouldn't have to though.
Thanks for your time and sorry for my weird English!
Edit: If my post is better suited for the pkgsrc section i'd appreciate it being moved.