DTrace instrumentation build error
Mark Johnston
markj at freebsd.org
Mon May 27 14:32:04 UTC 2019
On Sat, May 25, 2019 at 02:42:48PM -0700, Cy Schubert wrote:
> In message <20190524145650.GB72269 at raichu>, Mark Johnston writes:
> > On Fri, May 24, 2019 at 05:55:51AM -0700, Cy Schubert wrote:
> > > Hi,
> > >
> > > I'm helping rmacklem@ with instrumentation of mountd with USDT
> > > probes.It builds fine on amd64 however fails on i386
> > >
> > > ===> sbin/sconfig (all)
> > > ld: error: cannot open /usr/lib32/dtrace/drti.o: No such file or
> > > directory
> > > dtrace: failed to link script /home/cy/stable12/usr.sbin/mountd/mountd_d
> > > t.d: fai
> > > led to link mountd_dt.o: ld exited with status 1
> > > --- mountd_dt.o ---
> > > *** [mountd_dt.o] Error code 1
> > >
> > > make[6]: stopped in /home/cy/stable12/usr.sbin/mountd
> > > 1 error
> > >
> > > make[6]: stopped in /home/cy/stable12/usr.sbin/mountd
> > > --- all_subdir_usr.sbin/mountd ---
> > > *** [all_subdir_usr.sbin/mountd] Error code 2
> > >
> > > A couple of interesting things here:
> > >
> > > 1. /usr/lib32/dtrace/drti.o doesn't exist in the universe12a and
> > > universe12b jails.
> >
> > /usr/lib32 is entirely missing in those jails.
> >
> > > 2. Why would buildworld (tinderbox in this case) link against an object
> > > outside of /usr/obj?
> >
> > It is simply dtrace(1)'s default behaviour. I believe this patch is
> > sufficient to fix the problem for both native and 32-bit compat builds.
> > I think it is a bit too hacky though: we should probably only add
> > -x libdir during a world build. A standalone make -C usr.sbin/mountd
> > should use the host drti.o. What's the right predicate for that?
> >
> > diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk
> > index 5d0aac91f1b4..ce008fdba324 100644
> > --- a/share/mk/bsd.dep.mk
> > +++ b/share/mk/bsd.dep.mk
> > @@ -147,6 +147,9 @@ OBJS_DEPEND_GUESS.${_YC:R}.o+= ${_YC}
> > # DTrace probe definitions
> > .if ${SRCS:M*.d}
> > CFLAGS+= -I${.OBJDIR}
> > +.if exists(${OBJTOP}/cddl/lib/drti/drti.o)
> > +DTRACEFLAGS+= -x libdir=${OBJTOP}/cddl/lib/drti
> > +.endif
> > .endif
> > .for _DSRC in ${SRCS:M*.d:N*/*}
> > .for _D in ${_DSRC:R}
>
> Thanks Mark. I'll run another tinderbox with this.
>
> Wouldn't -L also work?
Yes, -L and -x libdir are synonyms.
> incdir will also need updating.
I'm not sure why. dtrace should probably get whatever include paths are
defined in CFLAGS.
> My initial thoughts were to add a -R option implementing --sysroot.
I don't see why it's needed.
More information about the freebsd-hackers
mailing list