From owner-freebsd-questions@FreeBSD.ORG Thu Jun 26 21:52:48 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A52A5106564A for ; Thu, 26 Jun 2008 21:52:48 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr12.xs4all.nl (smtp-vbr12.xs4all.nl [194.109.24.32]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE0A8FC2F for ; Thu, 26 Jun 2008 21:52:47 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr12.xs4all.nl (8.13.8/8.13.8) with ESMTP id m5QLqdXe060393; Thu, 26 Jun 2008 23:52:39 +0200 (CEST) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id DF1C5BA83; Thu, 26 Jun 2008 23:52:38 +0200 (CEST) Date: Thu, 26 Jun 2008 23:52:38 +0200 From: Roland Smith To: Erik Trulsson Message-ID: <20080626215238.GA5666@slackbox.xs4all.nl> References: <4863F317.6010701@tundraware.com> <4863F4A7.1070909@FreeBSD.org> <4863F5A3.6050209@tundraware.com> <4863FC2A.5040909@FreeBSD.org> <4864015C.7010805@tundraware.com> <20080626211915.GA65600@owl.midgard.homeip.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD" Content-Disposition: inline In-Reply-To: <20080626211915.GA65600@owl.midgard.homeip.net> X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: by XS4ALL Virus Scanner Cc: Kris Kennaway , Tim Daneliuk , FreeBSD Mailing List Subject: Re: Making World For amd64 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2008 21:52:48 -0000 --HlL+5n6rz5pIUxbD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 26, 2008 at 11:19:15PM +0200, Erik Trulsson wrote: > On Thu, Jun 26, 2008 at 03:51:40PM -0500, Tim Daneliuk wrote: > > Kris Kennaway wrote: > > > Tim Daneliuk wrote: > > >> Kris Kennaway wrote: > > >>> Tim Daneliuk wrote: > > >>>> Is there anything special one has to do when doing a make world > > >>>> intended for 64-bit FreeBSD or is it sufficient to build the 64-bit > > >>>> kernel and make world as everywhere else? > > >>> The same as everywhere else. > > >>> > > >>> Kris > > >> > > >> So, I take it that this means that all the userspace programs, ports, > > >> packages, utilities, etc. do *not* take advantage of the 64-bit > > >> extensions. That is, only the kernel gets the benefit of the > > >> wider word. Is that correct? > > >> > > >=20 > > > No, everything is 100% native. > > >=20 > > > Kris > > >=20 > >=20 > > OK, these may be really stupid questions but: > >=20 > > 1) How does make world know whether to build 32-bit or 64-bit binaries? >=20 > It will build for whatever system you have installed. The system Makefile calls 'uname -p' to get the system's processor architecture.=20 > If you are running a 32-bit system it will make 32-bit binaries, and if > you are running a 64-bit system it will make 64-bit binaries. By default, amd64 also builds 32-bit libraries (/usr/lib32), unless you set WITHOUT_LIB32=3Dtrue in /etc/src.conf.=20 > > 2) Can a binary from a 32-bit FreeBSD system be run unmodified on the > > 64-bit system? >=20 > Assuming the 32-bit system is 'i386' and the 64-bit system is 'amd64' then > you are supposed to be able to do so=20 You will need a kernel (such as GENERIC) built with 'options COMPAT_IA32'. >(but I don't know how well it works in > practice). Otherwise no. (Running a i386 binary on a sparc64 system won= 't > work.) You will also need all the libraries that the application depends on in 32-bit versions. Either by copying them from a 32-bit system (built from the same source version) or by doing a cross-build. There was a thread some time ago (not sure if it was in -questions or -amd64) about using a 32-bit jail on amd64. That might be of interest. > > 3) If I reboot with 32-bit or 64-bit kernels, does the system magically > > somehow make the userland stuff work natively at the word width? > > If so, how? >=20 > If you have installed the amd64 variant of FreeBSD (for example) then > all binaries (userland and kernel alike) will have been compiled for > the amd64 architecture (and thus 64-bit.) If you are running the i386 > variant then all binaries will have been compiled for i386 (and thus > 32-bit.) You can have both 32-bit and 64-bit systems on one machine, provided you put them on separate slices/partitions. Obviously you cannot have both a 32-bit and a 64-bit version of e.g. /bin/sh on one partition. Roland --=20 R.F.Smith http://www.xs4all.nl/~rsmith/ [plain text _non-HTML_ PGP/GnuPG encrypted/signed email much appreciated] pgp: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 (KeyID: C321A725) --HlL+5n6rz5pIUxbD Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkhkD6YACgkQEnfvsMMhpyUwowCgnEqnuTOTn/hHAuyhAPo70Tpx zU0AnA+1eljzIh07iIf4iAP8/MQ2ma7t =3wo/ -----END PGP SIGNATURE----- --HlL+5n6rz5pIUxbD--