Re: How to build only one part of NetBSD system
>> As always before such an operation, "do the kernel first". > > How do you do the kernel first without building the userland to > build the updated tools? The "do the kernel first" is sort of a "general warning". Whether it is strictly needed depends on what version user-land and what version source you are trying to mix. Ultimately, if you e.g. install a -current libc and still run a 9.3 kernel, I predict that you are going to have a hard time recovering from the mistake. As for the build error, it's difficult to say. Building the kernel typically requires that it *not* be done against the (possibly old) headers of the running system, and possibly also with the compiler and tools in the "tools" build.sh result. It's difficult to know what failed in your case without significantly more details. Regards, - Håvard
Re: How to build only one part of NetBSD system
> >> I tried going into libexec/ld.elf_so and running "make > >> install" but that didn't work or even come close. > > It would be something like: > > cd src/libexec/ld.elf_so > > ${TOOLDIR}/bin/nbmake-${arch} dependall > > ${TOOLDIR}/bin/nbmake-${arch} install > and if the tool nbmake was built with a different DESTDIR > configured e.g. via "build.sh -D ", you would need > ${TOOLDIR}/bin/nbmake-${arch} DESTDIR= dependall > ${TOOLDIR}/bin/nbmake-${arch} DESTDIR= install > to build this against the currently installed system and to > install it. > As always before such an operation, "do the kernel first". > Regards, > - HÃ¥vard How do you do the kernel first without building the userland to build the updated tools? I tried again to build for amd64 but failed on something with amdgpu. *** Signal 11 Stop. nbmake[7]: stopped in /BETA1/netbsd-HEAD/usr/src/sys/modules/amdgpu *** Failed target: dependall *** Failed command: cd "/BETA1/netbsd-HEAD/usr/src/sys/modules/amdgpu"; /BETA1/netbsd-HEAD/usr/src/../tooldir/bin/nbmake realall *** Error code 1 I don't know what to do further regarding NetBSD update, except maybe try for i386, where there seems to be no reference to amdgpu. Tom
Re: How to build only one part of NetBSD system
>> I tried going into libexec/ld.elf_so and running "make >> install" but that didn't work or even come close. > > It would be something like: > > cd src/libexec/ld.elf_so > ${TOOLDIR}/bin/nbmake-${arch} dependall > ${TOOLDIR}/bin/nbmake-${arch} install and if the tool nbmake was built with a different DESTDIR configured e.g. via "build.sh -D ", you would need ${TOOLDIR}/bin/nbmake-${arch} DESTDIR= dependall ${TOOLDIR}/bin/nbmake-${arch} DESTDIR= install to build this against the currently installed system and to install it. As always before such an operation, "do the kernel first". Regards, - Håvard
Re: How to build only one part of NetBSD system
On Thu, Jan 19, 2023 at 05:33:03AM +, Thomas Mueller wrote: > >From /usr/src/UPDATING, > Recent changes: ^^^ > > 20230112: > > New binutils require an updated ld.elf_so. If you are doing > > (unsupported) in-place self builds (with the -E flag to build.sh), > > make sure to have installed latest ld.elf_so before you rebuild > > userland. > > So how do I build /usr/src/lbexec/ld.elf_so preliminary to rebuilding the > > whole NetBSD (current)? > If you are not using something like "build.sh -E -D /" you should ignore that > entry. > > I tried going into libexec/ld.elf_so and running "make install" but that > > didn't work or even come close. > It would be something like: > cd src/libexec/ld.elf_so > ${TOOLDIR}/bin/nbmake-${arch} dependall > ${TOOLDIR}/bin/nbmake-${arch} install > > I don't think I could have used build.sh for just this component. > Right. > > I had two failed builds of NetBSD-current (10.99.2) before looking more > > closely at /usr/src/UPDATING. > Failed builds how? If you are using "build.sh -u" you may need to manually > clean the object dir for all instances of "binutils" (depending on when > you did the last sucessful build). > A safe way is to completely remove the object dir and build everything from > scratch. > Martin I remember I did remove object dir and old tools (from TOOLDIR and DESTDIR), which were from NetBSD amelia2 9.99.82 NetBSD 9.99.82 (NetBSD-HEAD amd64.nb999-20210601) #0: Tue Jun 1 21:21:00 GMT 2021 root@amelia2:/usr/obj/usr/src/sys/arch/amd64/compile/SANDY7 amd64 I have never used -E with build.sh, heeding the advice on the hazards that would entail. Where the error showed toward the end of the build log, Stop. nbmake[7]: stopped in /BETA1/netbsd-HEAD/usr/src/sys/modules/amdgpu *** Failed target: dependall *** Failed command: cd "/BETA1/netbsd-HEAD/usr/src/sys/modules/amdgpu"; /BETA1/netbsd-HEAD/usr/src/../tooldir/bin/nbmake realall *** Error code 1 Stop. nbmake[6]: stopped in /BETA1/netbsd-HEAD/usr/src/sys/modules/amdgpu *** Failed target: dependall-amdgpu *** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/modules/"; real="/BETA1/netbsd-HEAD/usr/src/sys/modules" ;; *) this="sys/modules/${dir}/"; real="/BETA1/netbsd-HEAD/usr/src/sys/modules/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /BETA1/netbsd-HEAD/usr/src/../tooldir/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget amdgpu dependall *** Error code 1 Stop. nbmake[5]: stopped in /BETA1/netbsd-HEAD/usr/src/sys/modules *** Failed target: dependall-modules *** Failed command: _makedirtarget() { dir="$1"; shift; target="$1"; shift; case "${dir}" in /*) this="${dir}/"; real="${dir}" ;; .) this="sys/"; real="/BETA1/netbsd-HEAD/usr/src/sys" ;; *) this="sys/${dir}/"; real="/BETA1/netbsd-HEAD/usr/src/sys/${dir}" ;; esac; show=${this:-.}; echo "${target} ===> ${show%/}${1:+ (with: $@)}"; cd "${real}" && /BETA1/netbsd-HEAD/usr/src/../tooldir/bin/nbmake _THISDIR_="${this}" "$@" ${target}; }; _makedirtarget modules dependall *** Error code 1 I just did what you suggested, it seemed to build and install, I will have to try again after running "cvs up -dP -A" in src and xsrc directories. Thanks for your help; I don't know if this will give me a successful build until I try it, hopefully this upcoming weekend. Tom
Re: How to build only one part of NetBSD system
On Thu, Jan 19, 2023 at 05:33:03AM +, Thomas Mueller wrote: > >From /usr/src/UPDATING, > > Recent changes: > ^^^ > > 20230112: > New binutils require an updated ld.elf_so. If you are doing > (unsupported) in-place self builds (with the -E flag to build.sh), > make sure to have installed latest ld.elf_so before you rebuild > userland. > > So how do I build /usr/src/lbexec/ld.elf_so preliminary to rebuilding the > whole NetBSD (current)? If you are not using something like "build.sh -E -D /" you should ignore that entry. > I tried going into libexec/ld.elf_so and running "make install" but that > didn't work or even come close. It would be something like: cd src/libexec/ld.elf_so ${TOOLDIR}/bin/nbmake-${arch} dependall ${TOOLDIR}/bin/nbmake-${arch} install > I don't think I could have used build.sh for just this component. Right. > I had two failed builds of NetBSD-current (10.99.2) before looking more > closely at /usr/src/UPDATING. Failed builds how? If you are using "build.sh -u" you may need to manually clean the object dir for all instances of "binutils" (depending on when you did the last sucessful build). A safe way is to completely remove the object dir and build everything from scratch. Martin
How to build only one part of NetBSD system
>From /usr/src/UPDATING, Recent changes: ^^^ 20230112: New binutils require an updated ld.elf_so. If you are doing (unsupported) in-place self builds (with the -E flag to build.sh), make sure to have installed latest ld.elf_so before you rebuild userland. So how do I build /usr/src/lbexec/ld.elf_so preliminary to rebuilding the whole NetBSD (current)? I tried going into libexec/ld.elf_so and running "make install" but that didn't work or even come close. I don't think I could have used build.sh for just this component. I had two failed builds of NetBSD-current (10.99.2) before looking more closely at /usr/src/UPDATING. So I feel like I might have been missing sommething before looking at BUILDING and UPDATING files. I looked at build.sh script but didn't see anything about building only this one component. Tom