`make tinderbox -DMAKE_ONLY_WORLDS` passes.
More details in case someone else explores providers for the build:
Using a custom libthr dtrace provider which requires bootstrapping a newer
dtrace and libs early on to get revisions like rS364438 and rS356477 into
the build's dtrace.
I'm not sure on the upstreamability for this yet but most likely it can be.
This patch was used downstream for the bootstrap needs. It predates D27200
which should have it using `LOCAL_BSTOOL_DIRS` and `LOCAL_XTOOL_DIRS`
instead.
```
diff --git Makefile.inc1 Makefile.inc1
index 900817a3fcd2..dc0b052d4623 100644
--- Makefile.inc1
+++ Makefile.inc1
@@ -2117,12 +2117,17 @@ _kerberos5_bootstrap_tools= \
${_bt}-usr.bin/mandoc: ${_bt}-lib/libopenbsd
+_isi_dtrace_bs+= lib/librtld_db lib/libproc cddl/lib/libdtrace
+${_bt}-lib/libproc: ${_bt}-lib/librtld_db
+${_bt}-cddl/lib/libdtrace: ${_bt}-lib/libproc ${_bt}-lib/librtld_db
+
bootstrap-tools: .PHONY
# Please document (add comment) why something is in 'bootstrap-tools'.
# Try to bound the building of the bootstrap-tool to just the
# FreeBSD versions that need the tool built at this stage of the build.
.for _tool in \
+ ${_isi_dtrace_bs} \
${_clang_tblgen} \
${_kerberos5_bootstrap_tools} \
${_strfile} \
@@ -2237,6 +2242,9 @@ _btxld= usr.sbin/btxld
.if ${MK_CDDL} != "no"
_dtrace_tools= cddl/lib/libctf cddl/usr.bin/ctfconvert \
cddl/usr.bin/ctfmerge
+_dtrace_tools+= cddl/lib/drti cddl/usr.sbin/dtrace
.endif
# If we're given an XAS, don't build binutils.
```
This was also needed at some point and may make sense to commit separately.
```
diff --git tools/build/mk/Makefile.boot tools/build/mk/Makefile.boot
index 0b4c41b8d95f..f72a1b40837d 100644
--- tools/build/mk/Makefile.boot
+++ tools/build/mk/Makefile.boot
@@ -1,6 +1,6 @@
# $FreeBSD$
-CFLAGS+= -I${WORLDTMP}/legacy/usr/include
+CFLAGS+= -isystem ${WORLDTMP}/legacy/usr/include
DPADD+= ${WORLDTMP}/legacy/usr/lib/libegacy.a
LDADD+= -legacy
LDFLAGS+= -L${WORLDTMP}/legacy/usr/lib
```
For libthr in particular this is needed in lib/libthr/Makefile, from
what I recall, to avoid errors with linking readonly sections.
```
LDFLAGS+=-Wl,-znotext
```
This is also needed for something like libthr to avoid any (small) performance
overhead caused by loading dtrace even when not used; it only loads dtrace
when required.
```
DTRACEFLAGS+= -x lazyload
```