Hello,
I am having trouble cross-compiling NetBSD pkgsrc on my faster Windows 11 PC
under Windows Subsystem for Linux (WSL). I am either making this more
complicated than it should be or I'm missing something totally obvious that I'm
going to smack my forehead when I finally learn what it is.
The NetBSD I'm using is NetBSD 10.0_BETA.
I have no problem cross-compiling NetBSD src and xsrc for an
amd64 system while on an amd64 machine running WSL on Windows 11.
To cross-compile NetBSD for amd64 I ran these commands after untaring everything.
I installed this on another PC without any problems.
build.sh -U -O ~/netbsd/obj.amd64 -j4 -u -m amd64 tools
build.sh -U -O ~/netbsd/obj.amd64 -j4 -u -x -X ~/netbsd/xsrc -m amd64 release
build.sh -U -O ~/netbsd/obj.amd64 -j4 -u -x -X ~/netbsd/xsrc -m amd64 install-image
build.sh -U -O ~/netbsd/obj.amd64 -j4 -u -x -X ~/netbsd/xsrc -m amd64 live-image
After untaring pkgsrc.tgz into the directory ~/netbsd/pkgsrc/ I did:
cd ~/netbsd/pkgsrc/bootstrap
nohup ./bootstrap --gzip-binary-kit ~/netbsd/pkgsrc.bootstrap.tgz --mk-fragment \
~/netbsd/mk-short.conf --prefix ~/netbsd/pkgsrc.pkg --unprivileged
Inside nohup.out at the end of the first configure I find:
...
checking for MACHINE & MACHINE_ARCH...
defaults: MACHINE=linux5, MACHINE_ARCH=x86_64
Using: MACHINE=linux5, MACHINE_ARCH=x86_64
Using: MKSRC=${srcdir}/mk
configure: creating ./config.status
...
What are the options to get bootstrap to compile for NetBSD amd64 target machine
using NetBSD's
CROSS_DESTDIR and
TOOLDIR I have set in my mk.conf file.
Below is my mk.conf.
---------------------------
UNPRIVILEGED=yes
USE_CROSS_COMPILE=yes
OBJMACHINE=YES
PREFER_PKGSRC=yes
USE_CWRAPPERS=no
PKG_DEVELOPER=yes
WRAPPER_DEBUG=yes
ECHO_WRAPPER_MSG=${ECHO}
WRAPPER_UPDATE_CACHE=no
#MACHINE_GNU_PLATFORM=NetBSD-10.0-x86_64
#NATIVE_MACHINE_PLATFORM=NetBSD-10.0-x86_64
#OPSYS=NetBSD
ABI=64
MACHINE_ARCH=amd64
TARGET_ARCH=amd64
MACHINE_PLATFORM=NetBSD-10-${MACHINE_ARCH}
MACHINE_GNU_PLATFORM=${MACHINE_ARCH}-unknown-NetBSD
MY_NETBSD_DIR=/home/jdf/netbsd
CROSS_DESTDIR=${MY_NETBSD_DIR}/obj.amd64/destdir.amd64
TOOLDIR=${MY_NETBSD_DIR}/obj.amd64/tooldir.Linux-5.15.90.1-microsoft-standard-WSL2-x86_64
PKGSRCDIR=${MY_NETBSD_DIR}/pkgsrc
LOCALBASE=${MY_NETBSD_DIR}/pkgsrc.pkg
WRKOBJDIR=${MY_NETBSD_DIR}/pkgsrc.work.${MACHINE_ARCH}
DISTDIR=${MY_NETBSD_DIR}/pkgsrc.distfiles
PACKAGES?=${MY_NETBSD_DIR}/pkgsrc.packages.${MACHINE_ARCH}