devel/valgrind make failure with -j 4

git describe
12-eol-16521-gb8d05bfbbb02

If I run "make" in devel/valgrind or devel/valgrind-devel, then no problem.

If I run make -j 4 then it fails

--- post-build-DOCS-on ---
cd /usr/ports/devel/valgrind/work/valgrind-3.23.0/docs && /usr/bin/env PERL_USE_UNSAFE_INC=1 XDG_DAT
A_HOME=/usr/ports/devel/valgrind/work XDG_CONFIG_HOME=/usr/ports/devel/valgrind/work XDG_CACHE_HOM
E=/usr/ports/devel/valgrind/work/.cache HOME=/usr/ports/devel/valgrind/work PATH=/usr/ports/devel/v
algrind/work/.bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/paulf/bin:/home
/paulf/bin PKG_CONFIG_LIBDIR=/usr/ports/devel/valgrind/work/.pkgconfig:/usr/local/libdata/pkgconfig:
/usr/local/share/pkgconfig:/usr/libdata/pkgconfig MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/
sh NO_LINT=YES DEFAULT_AUTOCONF=2.72 PREFIX=/usr/local LOCALBASE=/usr/local CC="cc" CFLAGS="-O2 -p
ipe -fno-strict-aliasing " CPP="cpp" CPPFLAGS="" LDFLAGS=" " LIBS="" CXX="c++" CXXFLAGS="-O2 -pi
pe -fno-strict-aliasing " BSD_INSTALL_PROGRAM="install -m 555" BSD_INSTALL_LIB="install -m 064
4" BSD_INSTALL_SCRIPT="install -m 555" BSD_INSTALL_DATA="install -m 0644" BSD_INSTALL_MAN="inst
all -m 444" gmake html-docs
: invalid option -- J
Usage: gmake [options] [target] ...
Options:
-b, -m Ignored for compatibility.

Nothing much in /etc/make.conf:
SENDMAIL_CF_DIR= /usr/local/share/sendmail/cf
DEVELOPER=yes

This is on amd64 FreeBSD 14.0-RELEASE-p5.

EDIT:

On aarch64 (FreeBSD 14.0-RELEASE again) I get exactly the same thing.
aarch64 needs the patch here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278594
 
I know that. Where is that uppercase J coming from?
It's part of make's magic to pass flags to child processes for recursive make. Unfortunately, both bmake and gmake use MAKEFLAGS for that purpose, but their methods to coordinate parallel recursive builds are incompatible.

The ports framework offers MAKE_JOBS* variables to allow parallel builds of ports using some "make" for their build. That's what you should use, you should never use the -j flag in the ports tree. MAKE_JOBS_NUMBER will be used to construct an explicit -j flag for the child make, it should default to the number of CPUs on your machine.
 
Back
Top