From owner-freebsd-arch@FreeBSD.ORG Thu Jul 11 04:25:44 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 023CF478 for ; Thu, 11 Jul 2013 04:25:44 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by mx1.freebsd.org (Postfix) with ESMTP id C31F41F5A for ; Thu, 11 Jul 2013 04:25:42 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id f4so16979013iea.11 for ; Wed, 10 Jul 2013 21:25:42 -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=vohFR26xUoWI4EpjPrvZeB4RiqyTk/CE9/oOechRSd0=; b=DlrwxagIeE/R/wHOOboSqByOPbw5zNp3yftiE0cPhAMu8lttp+utZX8MBv4K/kaYHI lgh/yfblOrJwoyPISS97gPHjWpUled26Mrucf+CcBjKkERoQzrWawo1LPg3qg9LecLVW uI7e/4bgnWLee5q/LnEsBdkE2VRIBU7CC69UrsGyE+J2d/VkAu7Vmb+6g/2kDye6pBfv HOFVDPHTjl+Je5CfQtNpzyCrHMmrJcg+pBODM+akhF8LPACksbWplROh7FcI5Fd9rbUe lY4iAk4DDd7Re8ubd+gqpP9Tm10H+kvb2hAD4W8rDD23eXn9QuFV5S4BC8A3s7vxVtUL 1qCQ== X-Received: by 10.50.129.38 with SMTP id nt6mr10684394igb.16.1373516742455; Wed, 10 Jul 2013 21:25:42 -0700 (PDT) Received: from 53.imp.bsdimp.com (50-78-194-198-static.hfc.comcastbusiness.net. [50.78.194.198]) by mx.google.com with ESMTPSA id jg5sm38614308igb.0.2013.07.10.21.25.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 10 Jul 2013 21:25:41 -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: Date: Wed, 10 Jul 2013 22:25:39 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <32F979BD-FB5C-4111-9586-4C5E7C6DFA71@bsdimp.com> <20130709234837.559e3769@bender.Home> <752588A3-C0EF-4844-A0EE-4657CAD40E4C@bsdimp.com> <20130710195547.GB68830@ithaqua.etoilebsd.net> <2CFD4681-5299-4A7B-A099-758EF30DAB9A@bsdimp.com> To: Tim Kientzle X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnbF8Ixqf9TJga8jYtpkOjgGSUKHgoP6Th/BqbYdtz4Xpy/ygpN47sC8Y3Q1a7C1PPf+v52 Cc: Baptiste Daroussin , 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: Thu, 11 Jul 2013 04:25:44 -0000 On Jul 10, 2013, at 10:03 PM, Tim Kientzle wrote: > On Jul 10, 2013, at 1:27 PM, Warner Losh wrote: >=20 >> On Jul 10, 2013, at 1:55 PM, Baptiste Daroussin wrote: >>=20 >>> 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 :) >>=20 >> uname -p is the first cut. It is intended to completely describe the = main ABI of the current machine. >>=20 >> However, you're right. The kernel should export a list of ABIs that = it supports. We don't currently do that. >>=20 >> I'd propose hw.abi that will export the ABIs the kernel supports.=20 >=20 > How does this work in the case where I'm building an armv6 image > on an i386 system? Or doing package installs directly on my NFS > server, which isn't the same architecture as the diskless systems > running from it? For that matter, just querying the kernel would > give wrong results for an i386 jail running on amd64, where the > kernel might support amd64 but 64-bit libraries aren't available. Sounds like a good number of cases for an override flag. > In all of these cases, it's the ABI of the target system that matters, > and there's no running kernel to query. Usually you have a kernel to query. When you don't, the user will have = to tell the pkg tools what to use. > This is why pkgng today looks at ELF information in /bin/sh to > determine what is supported by the target system. But that's still not right, since it will only allow you to install one = ABI. It would be impossible to install i386 packages on an amd64 = machine, so I'm not sure this is a winning argument. > How can we code information equivalent to uname -p in > a place where it can be statically determined from an image > of a non-running system? I would wager that most of the time, uname -p is what you want. Since = you are trying to second guess what's going on, while still allowing for = a wider variety of things, we'd need to have some automatic way of = determining what's supported, but also some way to override it. Most of the time, pkgng is used by a user installing packages on the = system he or she will be running on. We should optimize that path, while = still allowing others to work with an override flag. Much like we = default to the current running system in buildworld, unless you = override, and we don' t allow you to install on a system where = TARGET_ARCH !=3D MACHINE_ARCH unless you specify an override. Warner=