From owner-freebsd-arch@FreeBSD.ORG Wed Jul 10 21:24:07 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D873F5CC for ; Wed, 10 Jul 2013 21:24:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ye0-f181.google.com (mail-ye0-f181.google.com [209.85.213.181]) by mx1.freebsd.org (Postfix) with ESMTP id 993531C93 for ; Wed, 10 Jul 2013 21:24:07 +0000 (UTC) Received: by mail-ye0-f181.google.com with SMTP id g12so2569271yee.12 for ; Wed, 10 Jul 2013 14:24:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=YT03z4GaXhNrKmRGrCAnDWW5yrg253duTZQ0KDTbrU4=; b=Np+j3OO8uOV/Bk8fjl+u6lDBX3FKyHF7ttxNxDedZKtY73zqfmI11uKIHsZIVb4szK B9zu8cCU2xT5Wr4L2BPAy6B3eo27lZ+7ATG94bwx/k4gBYtu0fUOIxB3KF3NUP0aEq7k 1XRY7v6MR+v7ERo9dmQzH31mIPoWnS7BXTzU/FMPJ/lXYUNIOYO83a4G5ut58pHxIcM8 STFyJr4k+YnwydVANUpSAzCSviwK5/tXSlIwJ1ihpm1+UknVAvm2dM1BzYupQdXAEaZR XjFG2dnj5wUf+6WsoYgNd8xTV5eHZ86iZJlE3XDLfjHu4xemCbW2ynHIiQrbxB4KYyOJ h0pw== X-Received: by 10.236.120.15 with SMTP id o15mr19017926yhh.224.1373488058140; Wed, 10 Jul 2013 13:27:38 -0700 (PDT) Received: from monkey-bot.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPSA id o32sm54911055yhi.5.2013.07.10.13.27.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Jul 2013 13:27:37 -0700 (PDT) Sender: Warner Losh Subject: Re: Adding a MACHINE_ARCH note Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130710195547.GB68830@ithaqua.etoilebsd.net> Date: Wed, 10 Jul 2013 14:27:30 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <2CFD4681-5299-4A7B-A099-758EF30DAB9A@bsdimp.com> References: <32F979BD-FB5C-4111-9586-4C5E7C6DFA71@bsdimp.com> <20130709234837.559e3769@bender.Home> <752588A3-C0EF-4844-A0EE-4657CAD40E4C@bsdimp.com> <20130710195547.GB68830@ithaqua.etoilebsd.net> To: Baptiste Daroussin X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQlpdWJOJ0BsiLQMZdXz7mFVx8U7kmMMxjT3WW6HEqeksZ0ds6b7P0kZFkg0LOs6cr2llzAu Cc: FreeBSD-arch Arch X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Jul 2013 21:24:07 -0000 On Jul 10, 2013, at 1:55 PM, Baptiste Daroussin wrote: > On Wed, Jul 10, 2013 at 12:26:42PM -0700, Adrian Chadd wrote: >> On 10 July 2013 09:55, Warner Losh wrote: >>=20 >>>> That's the reason I replied about it. Not specifically to make it >>>> happen _everywhere_, but to see if we're about to migrate to a tool >>>> that doesn't support it, making it a much bigger deal to migrate = again >>>> later. >>>=20 >>> I've been talking to Baptiste, and it will support this. >>=20 >> Sweet. >>=20 >> Thanks! >>=20 >>=20 >> -adrian >=20 > Yeah I need to get a simple and uniq way to gather the different ABI, = I have > been creating my own ABI string to solve this, but I'm far from being = a > specialist. uname -p > While thinking about this kind of thing, please please think about a = format that > can easily give us a way to figure out a way to get cross ABI binaries = support. The same way we've always handled it: uname -p > pkgng needs for example to allow i386 packages to be installed on = amd64 because > amd64 does support it. You'll need to maintain a list somewhere. > Maintaining a list the compatibility will be painful. >=20 > In my own version I have > os:version:family:class:... >=20 > for example here: > on FreeBSD 9 i386 we have: >=20 > freebsd:9:x86:32 >=20 > on FreeBSD 10 amd64 we have: >=20 > freebsd:9:x86:64 >=20 > now if I do want a package I can install on both amd64 and i386 I just = have to > create a package saying: >=20 > freebsd:9:x86 >=20 > or if I want a package that can be installed on all arches: >=20 > freebsd:9 The whole x86:64 thing is evil. It should just be uname -p's name. > It became complicated for arm and mips because of the multiple = variation > available. Except there uname -p uniquely defines it (apart from our transition in = current from OABI to EABI on ARM, which was justified as "weird things = happen in -current" :)). > the problem with that is that I have to read the binary supported from = the > binaries themselves which enforce me to get some magical numbers for = every > arches (which was apparently wrong on arm, thanks Andrew for the fix) = Having a > note with the direct MACHINE_ARCH will save us complicated code and = potential > failures with magic numbers. and would be more reliable that getting = from > uname(3). I'm not sure how it would be more reliable. MACHINE_ARCH is uname -p. > Just tell me where I can get the right string and how can I check the = compatible > ABI and pkgng will switch to it. I would have love this to happen a = year and a > half before that would have saved me from having to prepare a = migration path, > but better late that never :) uname -p is the first cut. It is intended to completely describe the = main ABI of the current machine. However, you're right. The kernel should export a list of ABIs that it = supports. We don't currently do that. I'd propose hw.abi that will export the ABIs the kernel supports. This = way you won't install i386 binaries on an AMD64 system that doesn't have = COMPAT_FREEBSD32 in it. But that might get more interesting, since there = are some ABIs we support that aren't uname -p. These are things like = SVR4, AOUT (on i386), and various flavors of Linux. These ABIs are = likely beyond the scope of pngng, but maybe linux isn't :) Anyway, I'll work up a patch to give you what you need, and some shell = code for what to do when it doesn't exist. Warner=