From owner-freebsd-hackers@freebsd.org Mon May 27 14:32:04 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 9AE30159829C for ; Mon, 27 May 2019 14:32:04 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8C106F6F5; Mon, 27 May 2019 14:32:03 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-vs1-xe41.google.com with SMTP id z11so10659366vsq.9; Mon, 27 May 2019 07:32:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Fg0lgS4zhvfac/k27bd5Kn5PT5y+wQSPk8PwouWm3Ns=; b=kvojdgm4NyhSlmjuPq33xdZqr+ghXwa+4VkEePOH8Hdw3xtzYQ8i7qonJya7mQsjw8 P5y5scZLXFOhFq7f/IqQkFdET9fWmI2YL+Khtq0r1j+epiS56kSwgs+A/XK8Vlvh9kIq AWSTytu/einj4kVAEd81+zK7ycQW+OexFBsmqk/Rpw5sovX/AlEu7mvQThKOEVXAawx4 N3ol5k/f/aocCdGe2kypOY0mbeGw+FaeDn2TBeJCHe6gZpJt+bWP3WvrnEVF+J37SeNH StcprZBSkl7oXtFYSo2lNM3vdineWvI40AtFuTZjPABGBDNVKDK0GVCuRlZjUFDyWge1 v0pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Fg0lgS4zhvfac/k27bd5Kn5PT5y+wQSPk8PwouWm3Ns=; b=fDJP5R1nQhkOlmnzqcYqSWM07BZKeaHgguYdauxoYV1hVL7LPEXPVpb+rty7sjTwDq PTbPKsEZiiPqbS6jgzUSrAsvRX1TbmxK+Bc6MuBThhWs+TkdWtsRwfgv2/VTR73UfYFH t0f00KSul9rCyWwY6RyVmy2DY8XuRGXHrGbjKb3dBqJx+fevEdUANWXmfEV4LFQaya3M rmsaOQGoa9SOvEkJNZYwOU6zkgEsiXwezNf4LmazmpcEePUNT5jci/ln0WtChggh4fkd llGY/O7wOsitL2vqQwW3VnXyolxGY2h/yXiOGDZtKYjUEzKLf7CYYqO2ChO0eGWHjixo gFDg== X-Gm-Message-State: APjAAAUbzWY2nujyQOxr0Q69D/3VV762O5VacJOtl0nEtqPjALcGlI3U BGgGlt5yXt+60GZ1fJvXxUHc1MVA X-Google-Smtp-Source: APXvYqxnIP3v5jjaG0H+I6hHdIqDC6oidJkgsrZL3PnFAAh+fEHNRPsO76v3/v1VUv8VRKWdoPIfXg== X-Received: by 2002:a67:2e15:: with SMTP id u21mr42839819vsu.50.1558967523210; Mon, 27 May 2019 07:32:03 -0700 (PDT) Received: from raichu (toroon0560w-lp130-12-70-50-22-99.dsl.bell.ca. [70.50.22.99]) by smtp.gmail.com with ESMTPSA id e76sm12136054vke.54.2019.05.27.07.32.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 27 May 2019 07:32:02 -0700 (PDT) Sender: Mark Johnston Date: Mon, 27 May 2019 10:31:57 -0400 From: Mark Johnston To: Cy Schubert Cc: freebsd-hackers@freebsd.org, rmacklem@freebsd.org Subject: Re: DTrace instrumentation build error Message-ID: <20190527143157.GA82831@raichu> References: <20190524145650.GB72269@raichu> <201905252142.x4PLgmEo098646@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201905252142.x4PLgmEo098646@slippy.cwsent.com> User-Agent: Mutt/1.11.4 (2019-03-13) X-Rspamd-Queue-Id: B8C106F6F5 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=kvojdgm4; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::e41 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-3.24 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; RCVD_IN_DNSWL_NONE(0.00)[1.4.e.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.99)[-0.986,0]; IP_SCORE(-0.54)[ip: (2.94), ipnet: 2607:f8b0::/32(-3.30), asn: 15169(-2.29), country: US(-0.06)]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; MIME_TRACE(0.00)[0:+]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com] 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: Mon, 27 May 2019 14:32:04 -0000 On Sat, May 25, 2019 at 02:42:48PM -0700, Cy Schubert wrote: > 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? 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.