tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: building 9.1 kernel with /usr/src elsewhere?



> Date: Tue, 7 Mar 2023 18:32:46 -0500 (EST)
> From: Mouse <mouse%Rodents-Montreal.ORG@localhost>
> 
> This completed apparently normally, reporting the build directory and
> telling me to remember to make depend.  I then went to ~/kbuild/GEN91
> and ran make depend && make.  It failed fast - no more than a second or
> two - with
> 
> make[1]: don't know how to make absvdi2.c. Stop

Does it make a difference if you set
NETBSDSRCDIR=/home/abcxyz/netbsd-9.1/usr/src when you run make?

I always build out of my home directory, never /usr/src, but I also
always use build.sh and the make wrapper it creates to pass all the
right options to make (including for cross-builds).  My usual build
incantation is:

./build.sh -O ../obj.amd64 -U -u -m amd64 -j4 -N1 tools kernel=GENERIC

or

./build.sh -O ../obj.arm64 -U -u -m evbarm64 -j4 -N1 -V MKCROSSGDB=yes -V MKDEBUG=yes -V USE_PIGZGZIP=yes tools kernel=GENERIC64

or similar.

(Once `tools' is built once, no need to build it again during kernel
development.)

FYI, if you use build.sh, you don't need to do the build from inside
netbsd-9.1 on the same architecture.  I mostly do development of
netbsd-current on 9.x, but you could also do it from macOS or Linux
too.  I suspect that explicitly running /usr/bin/config for a
non-cross-build is an unusual use case these days.  And you will get a
more consistent toolchain, and a more consistent build product
(including the option of a 100% reproducible build with MKREPRO), if
you use build.sh.


Home | Main Index | Thread Index | Old Index