From owner-freebsd-current@FreeBSD.ORG Sat Jun 14 23:31:18 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7B9C430 for ; Sat, 14 Jun 2014 23:31:18 +0000 (UTC) Received: from mail-ig0-f169.google.com (mail-ig0-f169.google.com [209.85.213.169]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9692958 for ; Sat, 14 Jun 2014 23:31:18 +0000 (UTC) Received: by mail-ig0-f169.google.com with SMTP id a13so2680823igq.4 for ; Sat, 14 Jun 2014 16:31:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:content-type:mime-version:subject :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=ynse+hluI28ooh440RWAc7Ue+bMgdaSWAdm1DhnXuEw=; b=QZ+o633tvRwNFSMW3iClyoy5CWicYmhkrGOFpihefXVdjuRxtmYMbyFQ/zQciT2dRZ 2wNVMymxL5o7jGcYlf4q1TWrnrlp1Tb6a8o8RvBCdzquRupAdwEFQ1FqeM8sxBVgVZAt s609jpMC4muorcHlZmxCGEnjrIsc9oOxgL2OGgQozW5gD4zV+1jvgMNtc+tgpGWNBz8y aAY2/wpjj/mXUUIgxgDsGilgnCRpR7P1aj5z/FfKNb4daOhk+VO2wofUNFOdCxEBHBpF G7ur9ZJuFV5Wv74lem48ezUwFSZygwVO7bgSXVRIf88D2dCUgI9PzfNkVjPasB1Dq4rz mKjw== X-Gm-Message-State: ALoCoQlxGZCbfT1ZlHRZqlenfqJgfmLL+OVs0UMMOQqKEsxzmUzFZPXhKIpRVzvAxTK/Q34FDLFL X-Received: by 10.50.153.8 with SMTP id vc8mr15284216igb.16.1402788677202; Sat, 14 Jun 2014 16:31:17 -0700 (PDT) Received: from [10.0.0.119] (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id pm8sm439690igb.2.2014.06.14.16.31.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 14 Jun 2014 16:31:16 -0700 (PDT) Sender: Warner Losh From: Warner Losh X-Google-Original-From: Warner Losh Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: building i386 kernel on amd64 host In-Reply-To: Date: Sat, 14 Jun 2014 17:31:21 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <66AD5DED-0B46-4C59-849E-AC84B25F06AB@gmail.com> References: <201406131059.01450.jhb@freebsd.org> To: Oliver Pinter X-Mailer: Apple Mail (2.1878.2) Cc: gavin@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 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, 14 Jun 2014 23:31:18 -0000 On Jun 14, 2014, at 3:57 PM, Oliver Pinter = wrote: > On 6/13/14, John Baldwin wrote: >> On Friday, June 13, 2014 6:21:28 am Oliver Pinter wrote: >>> Hi All! >>>=20 >>> When I try to build i386 kernel on amd64 host running compile error >>> due wrong cpufunc.h picked up by build system. >>>=20 >>> I used the attached script to build the kernel, and I attached a = build >>> log. >>>=20 >>> Any suggestion how can I fix this? >>=20 >> To build an i386 kernel on an amd64 host do this: >>=20 >> cd /usr/src (or some other tree) >> make TARGET=3Di386 kernel-toolchain >> make TARGET=3Di386 buildkernel >> make TARGET=3Di386 installkernel DESTDIR=3D/some/place >>=20 >> And your i386 kernel will end up in /some/place/boot/kernel/kernel. = (You >> can >> set things like KERNCONF to pick an alternate kernel config just as = with >> normal 'make buildkernel'.) >>=20 >> (Your attachment was size zero for me btw) >>=20 >> -- >> John Baldwin >>=20 >=20 > I used this script to build the kernel: > = http://svnweb.freebsd.org/socsvn/soc2014/op/tools/build_kernel_32bit.csh?v= iew=3Dlog >=20 > And the error log are there: > https://gist.github.com/opntr/cf8aa0e404c0c5ed6f90 . > I get this error, when I first build kernel for amd64 system, and > after that i386 kernel, and only the kernel. >=20 > Now seems like I can build the whole system with buildworld > buildkernel on vanilla master, I removed the objdir and do a clean > buildworld. Now I test the modified kernel build, after the > buildworld. >=20 > It is broken too. When I do only make kernel-toolchain buildkernel, > than this are broken for vanilla freebsd source and for my version to. >=20 > summary: > OK: make buildworld buildkernel > BROKEN: make kernel-toolchain buildkernel On the same line? O?r is that just a summary? > Seems like someone in build environment bootstrapping are broken. I=92ve not been able to reproduce this. rm -rf $OBJDIR make TARGET=3Di386 kernel-toolchain make TARGET=3Di386 buildkernel works just fine on current with a clean tree and an empty/missing = make.conf and src.conf. As for your script, don=92t define MACHINE and MACHINE_ARCH. That=92s = almost always wrong since that overrides things on the command line, = which is what make buildkernel winds up translating to. You never need = to define those yourself in any supported environment, and likely most = unsupported ones. Also, I=92d strongly recommend doing it as two invocations to make, not = one. kernel-toolchain likely doesn=92t have all the right guards in = place for it that buildworld likely does. Or you can dive in and figure = that out. You can=92t really do anything *kernel* related until = kernel-toolchain finishes=85 Warner