From owner-freebsd-current@freebsd.org Sat Oct 31 06:51:03 2015 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78220A22035 for ; Sat, 31 Oct 2015 06:51:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 54F611100 for ; Sat, 31 Oct 2015 06:51:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 51185A22034; Sat, 31 Oct 2015 06:51:03 +0000 (UTC) Delivered-To: current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 509D1A22033 for ; Sat, 31 Oct 2015 06:51:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22b.google.com (mail-pa0-x22b.google.com [IPv6:2607:f8b0:400e:c03::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DA3110FD; Sat, 31 Oct 2015 06:51:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by padhy1 with SMTP id hy1so88559761pad.0; Fri, 30 Oct 2015 23:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=d7kuQ6TzogmWmkXbOYMi5xLzFg3xUEtHqs7NavpiaLo=; b=0+a5pCCLngequpVChMPxfP49xz02EAZaNeQwpgZCtgMlHEWWZfiPXlF11fJVOJxm5a swK0gkX7o8mf536YRvg6TBIuvV7ZjKYySZHHa4zsPOXRbCrx8Cc6FD77lMKpJNRR0Wdt Xw+bPfALC2+kzkqpnV1ObykfW+C9A6I4cn+piwpTWtVmNCYQWnrq2+ZOnQ4EoXjnSavK INCzube/qndmtkmchZ86LWAOWd1HwoTDHvWLxiU2Si1lelZp7YP8wauZZeEFJOeogQuN +jnmD5zmv8EdeQLKTUJ0Dn0y6iMEkFMFH6VAZdYFpSqXhe5V1dD7oi8sk1pxD4tuxuX6 7A4A== X-Received: by 10.66.185.228 with SMTP id ff4mr10650613pac.79.1446274262734; Fri, 30 Oct 2015 23:51:02 -0700 (PDT) Received: from [192.168.20.7] (c-24-16-212-205.hsd1.wa.comcast.net. [24.16.212.205]) by smtp.gmail.com with ESMTPSA id im9sm11906605pbc.1.2015.10.30.23.51.01 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 30 Oct 2015 23:51:02 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: Compilation failure with WITH_DTRACE_TESTS on mips/mips and powerpc/powerpc; it's trying to compile a host object on mips/powerpc because MAKEOBJDIRPREFIX is incorrect From: NGie Cooper In-Reply-To: <6585.1446248620@chaos> Date: Fri, 30 Oct 2015 23:51:00 -0700 Cc: Bryan Drewery , Ed Maste , Mark Johnston , FreeBSD CURRENT Content-Transfer-Encoding: quoted-printable Message-Id: <9192D4AA-FCF1-4841-89FD-A4E5D93C6941@gmail.com> References: <653F31AA-982B-4026-BEF5-F608BCFFFD3A@gmail.com> <6585.1446248620@chaos> To: "Simon J. Gerraty" X-Mailer: Apple Mail (2.2104) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 31 Oct 2015 06:51:03 -0000 > On Oct 30, 2015, at 16:43, Simon J. Gerraty wrote: >=20 > NGie Cooper wrote: >> I tried doing buildworld on powerpc/powerpc with = -DWITH_DTRACE_TESTS and I ran into this linker issue below. I have no = idea (yet) why it=E2=80=99s trying to compile an x64 object when I = specify powerpc/powerpc =E2=80=94 and more importantly, why is the = object not being put in obj.powerpc? >> I ran into the same issue on ref11-amd64.freebsd.org when I ran = =E2=80=9Cmake tinderbox". >=20 > Is it possible that the file is left over from a previous build (of = amd64?) >=20 > Does your log show it being built? >=20 >=20 >> dtrace -C -x nolibs -G -o usdt.o -s = /usr/src/svn/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt= .d tst.usdt.o >> dtrace: failed to link script = /usr/src/svn/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/json/usdt= .d: incorrect ELF machine type for object file: tst.usdt.o >> *** Error code 1 >> $ find /usr/obj/usr/src/svn/ -name tst.usdt.o >> = /usr/obj/usr/src/svn/cddl/usr.sbin/dtrace/tests/common/json/tst.usdt.o >> $ file = /usr/obj/usr/src/svn/cddl/usr.sbin/dtrace/tests/common/json/tst.usdt.o >> = /usr/obj/usr/src/svn/cddl/usr.sbin/dtrace/tests/common/json/tst.usdt.o: = ELF 64-bit LSB relocatable, x86-64, version 1 (FreeBSD), not stripped Still running into issues on ref11-amd64: cc1: error: unrecognized command line option "-m64" dtrace: failed to compile script = /scratch/tmp/ngie/svn/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/= json/usdt.d: Preprocessor failed to process input program --- usdt.h --- *** [usdt.h] Error code 1 Let=E2=80=99s see what happens if I use make buildenv $ env MAKEOBJDIRPREFIX=3D/scratch/tmp/$USER/obj make buildenv = TARGET=3Dmips TARGET_ARCH=3Dmips Entering world for mips:mips $ make -VMAKEOBJDIRPREFIX /scratch/tmp/ngie/obj/mips.mips $ which dtrace /usr/sbin/dtrace Uh=E2=80=A6 yeah=E2=80=A6 running the copy from the build host is no = bueno. So, that root causes that issue. I=E2=80=99ll file a bug for that = (dtrace needs to be built as a bootstrap/cross tool). The -m64 issue is = because it=E2=80=99s compiled for amd64 and is running arguments that = are only supposed to =E2=80=9Cwork=E2=80=9D for x86 platforms (in = reality, there=E2=80=99s also no reason why -m32/-m64 need to be passed = to ${CC}/${CPP}): 1256 #ifdef illumos 1257 #ifdef __x86 1258 /* 1259 * On x86 systems, __i386 is defined for = for 32-bit 1260 * compiles and __amd64 is defined for 64-bit compiles. = Unlike SPARC, 1261 * they are defined exclusive of one another (see PSARC = 2004/619). 1262 */ 1263 if (dtp->dt_conf.dtc_ctfmodel =3D=3D CTF_MODEL_LP64) { 1264 if (dt_cpp_add_arg(dtp, "-D__amd64") =3D=3D NULL) 1265 return (set_open_errno(dtp, errp, = EDT_NOMEM)); 1266 } else { 1267 if (dt_cpp_add_arg(dtp, "-D__i386") =3D=3D NULL) 1268 return (set_open_errno(dtp, errp, = EDT_NOMEM)); 1269 } 1270 #endif 1271 #else 1272 #if defined(__amd64__) || defined(__i386__) 1273 if (dtp->dt_conf.dtc_ctfmodel =3D=3D CTF_MODEL_LP64) { 1274 if (dt_cpp_add_arg(dtp, "-m64") =3D=3D NULL) 1275 return (set_open_errno(dtp, errp, = EDT_NOMEM)); 1276 } else { 1277 if (dt_cpp_add_arg(dtp, "-m32") =3D=3D NULL) 1278 return (set_open_errno(dtp, errp, = EDT_NOMEM)); 1279 } 1280 #endif 1281 #endif As for why the original issue occurred on my VM (which was the = powerpc:powerpc case), I=E2=80=99m not sure yet. I=E2=80=99m working on = figuring that out. Thanks! -NGie=