Re: Someone broke /usr/src

From: Simon J. Gerraty <sjg_at_juniper.net>
Date: Sun, 03 Aug 2025 00:12:46 UTC
Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> I'm not sure how to debug this.  msun's Makefile is
> rather messy.  I do note that bmake was recently
> updated:

Actually it was updated more recently than that.

a8c56be47166 2025-07-19 sjg Merge bmake-20250707

you can use -dm to learn more about what is going on
eg.

Setting main node to "buildenv"
Make_ExpandUse: examine all
ExamineLater: need to examine "beforebuild"
ExamineLater: need to examine ".WAIT_1"
ExamineLater: need to examine "libm.a"
ExamineLater: need to examine "libm.so.5"
ExamineLater: need to examine "all-man"
ExamineLater: need to examine "buildconfig"
ExamineLater: need to examine "buildfiles"
ExamineLater: need to examine "buildincludes"
ExamineLater: need to examine ".WAIT_5"
ExamineLater: need to examine "staging"
Make_ExpandUse: examine beforebuild
...

That 'Setting main node to ' something other than "all" is usualy a bad
sign (eg. cookie targets not marked with .NOTMAIN)

In this case it is from src.init.mk:

.if !target(buildenv)
buildenv: .PHONY
        ${_+_}@env BUILDENV_DIR=${.CURDIR} ${MAKE} -C ${SRCTOP} buildenv
.endif

You might also want to enable META_MODE - looking at e_fmod.o.meta
shows it does not use e_fmode.c on amd64 at least (you didn't mention
what architecture you were building for):

# Meta data file /var/obj/FreeBSD/main/obj/amd64.amd64/lib/msun/e_fmod.o.meta
CMD cc -O2 -pipe -fno-common
  -I/h/sjg/work/FreeBSD/main/src/lib/msun/x86
  -I/h/sjg/work/FreeBSD/main/src/lib/msun/ld80
  -I/h/sjg/work/FreeBSD/main/src/lib/msun/amd64
  -ffp-exception-behavior=maytrap -fno-math-errno
  -I/h/sjg/work/FreeBSD/main/src/lib/msun/src
  -I/h/sjg/work/FreeBSD/main/src/lib/libc/include
  -I/h/sjg/work/FreeBSD/main/src/lib/libc/amd64 -g -gz=zlib -std=gnu17
  -Wno-format-zero-length -fstack-protector-strong
  -Wno-error=ignored-pragmas -Wsystem-headers -Werror -Wno-pointer-sign
  -Wdate-time -Wno-unknown-pragmas -Wno-empty-body -Wno-string-plus-int
  -Wno-unused-const-variable -Wno-error=unused-but-set-parameter
  -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality
  -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef
  -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum
  -Wno-knr-promoted-parameter -Wno-parentheses  -Qunused-arguments
  --sysroot=/var/obj/FreeBSD/main/obj/stage/amd64.amd64    -c
  /h/sjg/work/FreeBSD/main/src/lib/msun/amd64/e_fmod.S -o e_fmod.o
CWD /var/obj/FreeBSD/main/obj/amd64.amd64/lib/msun