On May 6, 2025, at 16:07, Simon J. Gerraty <s...@juniper.net> wrote: > Mark Millard <mark...@yahoo.com> wrote: >> Yes, if the value of MAKEOBJDIRPREFIX isn't consistent that's going to >> cause problems (I'd call it a bug). If so don't use MAKEOBJDIRPREFIX >> directly, set some other variable and export that. >> Hmm src.sys.obj.mk plays games with MAKEOBJDIRPREFIX so that's >> probably not a good option. >> Perhaps: >> >> diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk >> index 3b48fc3c5514..3c7e570dbdbd 100644 >> --- a/share/mk/src.sys.obj.mk >> +++ b/share/mk/src.sys.obj.mk >> @@ -67,6 +67,9 @@ SB_OBJROOT?= ${SB}/obj/ >> OBJROOT?= ${SB_OBJROOT} >> .endif >> OBJROOT?= ${_default_makeobjdirprefix}${SRCTOP}/ >> +# save the value before we mess with it >> +_OBJROOT:= ${OBJROOT:tA} >> +.export _OBJROOT >> .if ${OBJROOT:M*/} != "" >> OBJROOT:= ${OBJROOT:H:tA}/ >> .else > > I think you could use something like this, which should be safe to > commit:
I do not have a commit bit. Should I submit a bugzilla entry or something for its eventual commit? > diff --git a/share/mk/src.sys.obj.mk b/share/mk/src.sys.obj.mk > index 708559edcdb8..e4fe3fa9a2aa 100644 > --- a/share/mk/src.sys.obj.mk > +++ b/share/mk/src.sys.obj.mk > @@ -73,6 +73,12 @@ OBJROOT:= ${OBJROOT:H:tA}/${OBJROOT:T} > .endif > # Must export since OBJDIR will dynamically be based on it > .export OBJROOT SRCTOP > +# if we didn't get SB_OBJROOT from env, > +# it is handy to set it now, so we can remember it > +.if empty(SB_OBJROOT) > +SB_OBJROOT:= ${OBJROOT} > +.export SB_OBJROOT > +.endif > .endif > > .if ${MK_DIRDEPS_BUILD} == "no" > > You can then use ${SB_OBJROOT} in your .MAKE.META.IGNORE_PATHS > The difference is that nothing in the FreeBSD build should ever touch > SB_OBJROOT so it should meet your need. > I think ;-) > > And the above won't break our builds - which set SB_OBJROOT > before running make. Looks to be working for both aarch64 and amd64 with ~/src.configs/make.conf as shown below. It is used in my environment's scripts via the make command line starting with: env __MAKE_CONF="/usr/home/root/src.configs/make.conf" # cat ~/src.configs/make.conf # SB_OBJROOT is an addition to share/mk/src.sys.obj.mk # provided by Simon J. Gerraty for my experimentation # with this avoidance of some unnecessary build # activity in META MODE: # # # if we didn't get SB_OBJROOT from env, # # it is handy to set it now, so we can remember it # .if empty(SB_OBJROOT) # SB_OBJROOT:= ${OBJROOT} # .export SB_OBJROOT # .endif # # TARGET.TARGET_ARCH for amd64 stays as amd64.amd64 for obj-lib32 (correct for the purpose) # MACHINE.MACHINE_ARCH for amd64 turns into i386.i386 for obj-lib32 (wrong for the purpose) # IGNORELEGACY_NOSYMLINKPREFIX= ${SB_OBJROOT}/${TARGET}.${TARGET_ARCH}/tmp/legacy/usr IGNOREOTHER_NOSYMLINKPREFIX= ${SB_OBJROOT}/${TARGET}.${TARGET_ARCH}/tmp/usr/bin # .for ignore_legacy_tool in awk basename cap_mkdb cat chmod cmp cp crunchgen crunchide cut date dd dirname echo egrep env expr fgrep file2c find gencat grep gzip head hostname jot lex lb ln ls m4 make mkcsmapper mkdir mktemp mtree mv nawk patch realpath rm sed sh sort touch tr truncate uudecode uuencode wc xargs .MAKE.META.IGNORE_PATHS+= ${IGNORELEGACY_NOSYMLINKPREFIX}/sbin/${ignore_legacy_tool} .endfor # .for ignore_other_tool in ctfconvert objcopy nm .MAKE.META.IGNORE_PATHS+= ${IGNOREOTHER_NOSYMLINKPREFIX}/${ignore_other_tool} .endfor # .MAKE.META.IGNORE_PATHS:= ${.MAKE.META.IGNORE_PATHS} === Mark Millard marklmi at yahoo.com