From owner-freebsd-current@freebsd.org Mon Apr 16 10:58:59 2018 Return-Path: Delivered-To: freebsd-current@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 DBF87F9F36C for ; Mon, 16 Apr 2018 10:58:58 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9AA83193 for ; Mon, 16 Apr 2018 10:58:58 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (220-253-154-11.dyn.iinet.net.au [220.253.154.11]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id w3GAwqwN019958 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 16 Apr 2018 03:58:55 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: Module compiles looking in /usr/src when alternate src tree is in use To: "Rodney W. Grimes" , "Simon J. Gerraty" Cc: freebsd-current@freebsd.org References: <201804110029.w3B0TPUf025467@pdx.rh.CN85.dnsmgr.net> From: Julian Elischer Message-ID: <0c3bc880-625d-030a-392c-935d46ec9c96@freebsd.org> Date: Mon, 16 Apr 2018 18:58:47 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201804110029.w3B0TPUf025467@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 10:58:59 -0000 On 11/4/18 8:29 am, Rodney W. Grimes wrote: >> Rodney W. Grimes wrote: >> >>> I am having a compile time issue for a patched that compiled fine on my >>> r329294 system, but now failes to compile with what looks like a wrong >>> header being included. >> You may find it helpful to do something like: >> >> make -dv -C sys/modules/vmm -V CFLAGS > /tmp/dvo 2>&1 >> egrep ':.PARSE|/usr/src/sys' /tmp/dvo | grep -B1 usr/src | more >> >> The arg to -V doesn't matter btw. >> You could narrow that down if you know what var -I/usr/src/sys is in >> (probably CFLAGS but you never know) >> the above should help find the makefile that is introducing the bogus -I >> > Thank you, that does help narrow it down: (I backed up a vew lines > from the first place I saw src/.) > > ... > Global:.PARSEFILE = bsd.kmod.mk > Global:.PARSEDIR = /usr/src-topo/share/mk > Global:.PARSEFILE = bsd.kmod.mk > Result[] of :U is "/usr/src/sys" > Result[] of :U is "/usr/src/sys" > Global:SYSDIR = ${:U/usr/src/sys:tA} > Global:.PARSEDIR = /usr/src-topo/share/mk > Global:.PARSEFILE = bsd.kmod.mk > Result[] of :U is "/usr/src/sys" > Applying[] :t to "/usr/src/sys" > Result[] of :t is "/usr/src/sys" > Result[] of :U is "/usr/src/sys" > Applying[] :t to "/usr/src/sys" > Result[] of :t is "/usr/src/sys" > Result[] of :U is "/usr/src/sys" > Applying[] :t to "/usr/src/sys" > Result[] of :t is "/usr/src/sys" > Global:.MAKE.MAKEFILES = /usr/src-topo/share/mk/sys.mk /usr/src-topo/share/mk/local.sys.env.mk /usr/src-topo/share/mk/src.sys.env.mk /usr/src-topo/share/mk/bsd.mkopt.m > k /usr/src-topo/share/mk/src.sys.obj.mk /usr/src-topo/share/mk/auto.obj.mk /usr/src-topo/share/mk/bsd.suffixes.mk /usr/src-topo/share/mk/local.sys.mk /usr/src-topo/sha > re/mk/src.sys.mk /usr/src-topo/sys/modules/vmm/Makefile /usr/src-topo/share/mk/bsd.kmod.mk /usr/src/sys/conf/kmod.mk > ^^^^^^^^^^^^^^^^^^^^^^^^^ > Thats gona bust something some day.... > > Global:.PARSEDIR = /usr/src/sys/conf > Global:.PARSEFILE = kmod.mk > Global:.INCLUDEDFROMDIR = /usr/src/sys/conf > Oh my! Uggggg > > > So something in bsd.kmod.mk is going very wrong... it looks like it > starts to pull all sorts of stuff from /usr/src/sys! I seem to remember that there is code in the Makefiles that looks for the sys directory. I believe it can be directed to use a directory but in its absence it looks at some well known locations, which would probably fail if there is already a DIFFERENT tree in /usr/src. > >>> I have wrapped the long line so I can point to a difference between >>> r329294 and r332262 make log of this file. >>> >>> r329294 make output: >>> >>> cc -O2 -pipe -DVMM_KEEP_STATS -DSMP -fno-strict-aliasing -Werror -D_KERNEL \ >>> -DKLD_MODULE -nostdinc -I/usr/src-topo/sys/amd64/vmm \ >>> -I/usr/src-topo/sys/amd64/vmm/io -I/usr/src-topo/sys/amd64/vmm/intel \ >>> -I/usr/src-topo/sys/amd64/vmm/amd -I. -I/usr/src-topo/sys -fno-common \ >>> ^^^^^^^^^^^^^^^^^ this is what I would expect >>