Closed soobinrho closed 1 year ago
Closing this issue as I've discovered the following passage from /usr/src/share/mk/bsd.obj.mk
:
# MAKEOBJDIR A pathname for the directory where the targets
# are built. Note: MAKEOBJDIR is an *environment* variable
# and works properly only if set as an environment variable,
# not as a global or command line variable!
#
# E.g. use `env MAKEOBJDIR=temp-obj make'
Following this fixed the issue completely. The problem was on my code. My bad!
What is this issue?
The build process exits with a fetal error as shown above. This error is dependent on where the
mfsbsd
folder is located, which means this error doesn't happen if it's located in certain places, but it does occur if it's located in, for instance,/usr/src/contrib/mfsbsd
.It's my understanding that the cause of this unexpected behavior stems from the specific way MAKE(1) handles
.OBJDIR
. According to the documentation,Normally,
.OBJDIR
value doesn't matter in a regular mfsBSD build. However, whenmfsbsd
directory is located at/usr/src/ocntrib/mfsbsd
, the value of.OBJDIR
comes into play, and in this case, Make is not able to find/usr/src/contrib/mfsbsd/work/roothack/roothack
because its.OBJDIR
is set to a wrong location. In my case, it was set to/usr/obj/usr/src/${ARCH}/contrib
, as opposed to what it should have been, which is/usr/src/contrib/mfsbsd
.Identified Fix
Change in one line of
mfsbsd/Makefile
(line number 504) fixes this issue. I also submitted a PR.How to replicate the issue
Here are the exact command lines that produced this error: