From owner-svn-src-all@FreeBSD.ORG Mon May 26 14:39:47 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2935E107; Mon, 26 May 2014 14:39:47 +0000 (UTC) Received: from i3mail.icecube.wisc.edu (i3mail.icecube.wisc.edu [128.104.255.23]) by mx1.freebsd.org (Postfix) with ESMTP id 7301F2978; Mon, 26 May 2014 14:39:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by i3mail.icecube.wisc.edu (Postfix) with ESMTP id 8EC0138056; Mon, 26 May 2014 09:39:45 -0500 (CDT) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from i3mail.icecube.wisc.edu ([127.0.0.1]) by localhost (i3mail.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id WoXjiXshSXcc; Mon, 26 May 2014 09:39:45 -0500 (CDT) Received: from comporellon.tachypleus.net (polaris.tachypleus.net [75.101.50.44]) by i3mail.icecube.wisc.edu (Postfix) with ESMTPSA id 8728138051; Mon, 26 May 2014 09:39:44 -0500 (CDT) Message-ID: <5383522F.30108@freebsd.org> Date: Mon, 26 May 2014 07:39:43 -0700 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Tijl Coosemans , Warner Losh Subject: Re: svn commit: r266553 - head/release/scripts References: <201405221922.s4MJM4Y9025265@svn.freebsd.org> <537F6706.6070509@freebsd.org> <20140523153619.GF72340@ivaldir.etoilebsd.net> <537F6EBC.3080008@freebsd.org> <20140523162020.GG72340@ivaldir.etoilebsd.net> <20140524165940.3c687553@kalimero.tijl.coosemans.org> <5380C311.60201@freebsd.org> <20140524185345.263f230d@kalimero.tijl.coosemans.org> <1400955835.1152.323.camel@revolution.hippie.lan> <5380EBA8.1030200@freebsd.org> <20140525011307.142b41ab@kalimero.tijl.coosemans.org> <3CCAFAD3-FABE-40EF-ABF9-815FE5826349@bsdimp.com> <9FE34CE4-C71F-4806-9EF6-30CB1051C62F@bsdimp.com> <20140526113502.239db74d@kalimero.tijl.coosemans.org> In-Reply-To: <20140526113502.239db74d@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=ISO-8859-7; format=flowed Content-Transfer-Encoding: 8bit Cc: Baptiste Daroussin , src-committers@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, Glen Barber , svn-src-head@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 May 2014 14:39:47 -0000 On 05/26/14 02:35, Tijl Coosemans wrote: > On Sat, 24 May 2014 19:00:18 -0600 Warner Losh wrote: >> On May 24, 2014, at 5:53 PM, Warner Losh wrote: >>> On May 24, 2014, at 5:13 PM, Tijl Coosemans wrote: >>>> There isn't necessarily any chroot environment. There's one kernel, >>>> two equally valid ABIs (ILP32 and LP64) and any binary like uname might >>>> use either of them. If uname -p returns a different result depending on >>>> which of these two ABIs it was compiled for that could be a problem for >>>> any script that uses it. >>> Well, it depends on what you want to do with the script, eh? If you want >>> to know the ABI of the native binary uname, that¢s one thing. But if you >>> want to know the supported ABIs, you are doing it wrong by using uname. >>> You should be using sysctl kern.supported_abi. That will tell you all the >>> ABIs that you can install packages for on this machine, which is what you >>> really want to know. So I¢m having trouble connecting the dots between >>> this and what you are saying here. >>> >>> I still am absolutely flabbergasted why the MACHINE_ARCH names aren¢t >>> necessary and sufficient for packaging. I¢ve yet to see any coherent >>> reason to not use them. >> Why do I care that they match? Good question. When I was doing FreeNAS, I >> looked at integrating pkgng into nanobsd. At the time this was quite >> difficult because every single architecture name was different between >> pkgng and MACHINE_ARCH. This would mean I¢d have to drag around a huge >> table to know how to translate one to the other (there was no simple regex >> either, and things like mipsn32 wouldn¢t have fit into the scheme at the >> time). I would very much like us to see us keep these names in sync and >> avoid large translation tables that are difficult to maintain. >> >> Now, do you need to get it from uname -p? No. If you want to parse elf >> files to get it, that¢s fine, so long as the names map directly to the >> MACHINE_ARCH names that we¢ve been using for years. They completely >> describe the universe of supported platforms. Are they perfect? No, around >> the edge there may be an odd-ball that¢s possible to build, but is >> unsupported and likely doesn¢t work at all. Have we learned from these >> mistakes? Yes. Anything that¢s actively supported has a proper name. This >> name is needed, btw, so that any machine can self-host, a nice feature of >> the /usr/src system. > ABI consists of the following elements: > > - OS > - OS ABI version (major version number in FreeBSD) > - instruction set > - programming model (ILP32 or LP64) > - byte order (little/big endian) > > These are almost orthogonal dimensions in the sense that almost any > combination is possible. (A combination that isn't possible is a > 32-bit instruction set with LP64.) > > What you are asking for now is to combine two dimensions into one and > combination in this case means multiplication so if you have 3 > instruction sets and 2 programming models, the combined dimension needs > 6 different values. You need to make the case for why you think this > is a good idea. For the past 20 years we got away with this because > on every installation of FreeBSD we only used one programming model at > a time. This is still the case for byte order of course. > > What I'm saying is to keep the option open for installations with > multiple programming models, where most binaries could use ILP32 and > only the ones that actually need a 64-bit address space use LP64. > You query the instruction set using uname and the programming models > using getconf. > > I suppose you could replace the "x86" in the pkg scheme with i386/amd64, > but then you'd still be talking about i386:32, amd64:32 and amd64:64 > instead of x86:32, x86:x32 and x86:64. > No. We support multiple "models" now and have for ten years. That's what MACHINE_ARCH is for: it defines the choice of the last three things you list above. Specifically, a shared value of MACHINE_ARCH guarantees and OS version guarantees, in FreeBSD-land, complete binary compatibility of executables. Kernels support multiple ones, in general (e.g. i386 binaries on amd64, powerpc binaries on powerpc64). They may support more in the future (x32 on amd64, potentially even cross-endian binaries). We have a nice flexible scheme in FreeBSD for supporting this. If you want to find out the list of the things the installed kernel can run, check the kern.supported_archs sysctl. Simple. These strings are just as expressive as the ones in pkg. They are the standard. They're what external build systems test against, what the src, doc, and ports trees use to define what to do universally. It's what users and code expect. The wheel we've had for 20 years is perfectly good -- why invent a new, incompatible one? -Nathan