From owner-freebsd-hackers@freebsd.org Fri Apr 16 19:36:00 2021 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D1F4F5DCF91 for ; Fri, 16 Apr 2021 19:36:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FMRJw2wj3z4lNv for ; Fri, 16 Apr 2021 19:35:59 +0000 (UTC) (envelope-from avg@FreeBSD.org) X-Originating-IP: 195.64.148.76 Received: from [192.168.0.88] (unknown [195.64.148.76]) (Authenticated sender: andriy.gapon@uabsd.com) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3ADEBE0003; Fri, 16 Apr 2021 19:35:56 +0000 (UTC) To: Peter Blok , freebsd-hackers@freebsd.org References: <376DADB2-A7A9-4519-888C-BCD8A32B62B3@bsd4all.org> From: Andriy Gapon Subject: Re: cross building i386 on amd64 Message-ID: <98964b07-b9a5-ca23-ef9d-7cb87d086282@FreeBSD.org> Date: Fri, 16 Apr 2021 22:35:55 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <376DADB2-A7A9-4519-888C-BCD8A32B62B3@bsd4all.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FMRJw2wj3z4lNv X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; ASN(0.00)[asn:29169, ipnet:217.70.176.0/20, country:FR] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Apr 2021 19:36:00 -0000 On 16/04/2021 20:22, Peter Blok wrote: > Hi, > > I’m cross building 12-STABLE i386 on a 12-STABLE amd64 system. Sources are refreshed every day. > > Build runs fine and put everything in the right directory. For the target i386 system it is in /usr/obj/i386TARGET. > > Next I NFS mount the source /on /usr/src and /usr/obj/i386TARGET on /usr/obj on the target machine > > When I run make installworld it will use install from /usr/obj/usr/src/i386.i386/tmp/legacy/usr/bin because it is the first install it finds in the PATH set by installworld. This tanks because install is compiled for amd64. > > I understand why the legacy path is compiled for amd64. This is needed to build a distribution. > > So is this is bug or is the way I distribute the objects not supported? I used this method only for same architecture installations. Never tried it for different architectures, so I cannot tell if this is a regression. However, I can share the method I use. On the build machine I just installworld into an empty directory and then tar it up. In fact, I am doing that without even requiring local root. I use DESTDIR=/some/path NO_ROOT=t DB_FROM_SRC=t. And then tar -c --use-compress-program pbzip2 -f image.tbz -C /some/path "@METALOG" pbzip2 is just for speed. -- Andriy Gapon