From owner-freebsd-hackers@freebsd.org Sat May 25 21:43:01 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9051315B7120 for ; Sat, 25 May 2019 21:43:01 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CBCA8A95E; Sat, 25 May 2019 21:43:00 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id UeRGhRecIGusjUeRIh5y17; Sat, 25 May 2019 15:42:53 -0600 X-Authority-Analysis: v=2.3 cv=fOdHIqSe c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=E5NmQfObTbMA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=Gn0eYT8Q2L8r4I93X6cA:9 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 08FF21C44; Sat, 25 May 2019 14:42:49 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id x4PLgm8c098652; Sat, 25 May 2019 14:42:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id x4PLgmEo098646; Sat, 25 May 2019 14:42:48 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201905252142.x4PLgmEo098646@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mark Johnston cc: Cy Schubert , freebsd-hackers@freebsd.org, rmacklem@freebsd.org Subject: Re: DTrace instrumentation build error In-Reply-To: Message from Mark Johnston of "Fri, 24 May 2019 10:56:50 -0400." <20190524145650.GB72269@raichu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 25 May 2019 14:42:48 -0700 X-CMAE-Envelope: MS4wfM+pcMs46qkW3bvf99wp+o2i7jgcYDkNiKJIdtvVDUqSNZUfoci+EaoaAvhxrptmLYlh9JTpKkHEAgMtuaRpnu+OpPlzDn81s3BXvQefx1QDwCTiOuDe O+ZdpZKA3VVJp8v2e45t0CzxQalmnaPqrbHPIzLzSgWBOYbmxGFme80FOL327ECPTkaayyCvNtrc8yTwWf5kIU/Vn4IS8tUl97BqA9vbIEQwkO5fESez5eMe 77OyHj/b5CldT/NRFUROIw== X-Rspamd-Queue-Id: 4CBCA8A95E X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-5.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; RECEIVED_SPAMHAUS_PBL(0.00)[17.125.67.70.zen.spamhaus.org : 127.0.0.11]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; HAS_XAW(0.00)[]; HAS_REPLYTO(0.00)[Cy.Schubert@cschubert.com]; TO_DN_SOME(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: spqr.komquats.com]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_SPF_NA(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[138.136.59.64.list.dnswl.org : 127.0.5.1]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:6327, ipnet:64.59.128.0/20, country:CA]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.45)[ip: (-6.43), ipnet: 64.59.128.0/20(-3.25), asn: 6327(-2.50), country: CA(-0.09)]; FROM_EQ_ENVFROM(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 21:43:01 -0000 In message <20190524145650.GB72269@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? incdir will also need updating. My initial thoughts were to add a -R option implementing --sysroot. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few.