From nobody Sun Mar 5 18:08:14 2023 X-Original-To: freebsd-ports@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PV8pR2pcMz3wlC8 for ; Sun, 5 Mar 2023 18:08:31 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic312-24.consmr.mail.gq1.yahoo.com (sonic312-24.consmr.mail.gq1.yahoo.com [98.137.69.205]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PV8pQ1JF8z3jpQ for ; Sun, 5 Mar 2023 18:08:30 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=yahoo.com header.s=s2048 header.b=qs644zej; spf=pass (mx1.freebsd.org: domain of marklmi@yahoo.com designates 98.137.69.205 as permitted sender) smtp.mailfrom=marklmi@yahoo.com; dmarc=pass (policy=reject) header.from=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1678039708; bh=MjxvPkadepRaRegWF7LeZUeY4OvRwZkxIpV7zd4bdhQ=; h=From:Subject:Date:References:To:In-Reply-To:From:Subject:Reply-To; b=qs644zejw7mARJINg455IhdkSNxCVQD97iDtvYf60K17qmC6zV4OJ7pb99mMiFr7D1QSg1J96zxtmMg26X7AaVTcINBd0cRDvckJZzz6gkDfULtFGdyzv+276d9y19eyFLXjEUwHQEAqIvpprVvvuds0y8OivkeCYTD9O/dvQ5CdbRwvfE/qAObkZly1ngNNKIpw2To94I0jIP2ZxJBOi5h8jAMSqT7c566OK4PrjGPhSvtuG1EFUBoZy9I2zeMPLFE3NKVYxwwPrqVGxi08U5r66WLXUCgxm8EvrUb60k8aRV0JdKCyPphXz3ZDdtmQhc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iMWlSmrszmZTLou73SAJxqtSMmte3HhUrVl_GfXbn67ZswaCZl94YAeBks0 .Y_Xjaoy5mZrvYbs7t7YsL6Hr_HEPZTYxvk1UJoCMq7tK76tCEqZpfKCgIK7L3PiMiWGW8OalWla OTNHsDydy8aN3dIxqTsubjVAIo4V8CslNgxyvkRWCrmrIwq6TRnt9QRE6sXx2GghvfC33PdnnU4g 9JVWlRfK3le3LUQluqSOeys6VTdbic7RHYtVFIo7WfUJHEGREonqUn3_y.8sVDRgZgpfOYpS492n lKnbyAeWRtvxFV9dR9KKphqOEO1JcOLO0oM4TTf6apmXgSTigd9N4d8qUH1gsYCplQoAAeG9p4io FHcCsaeC5khXlgTyyrfDyN.ARIXGddKaRdW2wxSICPZI8gU_yRrnZCV4XGOZdYLr42b8aZUF2HEa uZGubUnA4wcaLcCplb7KJcOkUcm2skO65v90CM9HbCDAMUfRMXFm7PdgRKKTftWUeE2dI_CI8_uO mlpnUXeSJaTOkccs8B5D_GK3t1t_ryJeA8cXyZLbw9l1rpZaEB0bKOM_sRtzkR9u6xIy.vjcAH.r KHrWu2ihSPiteXKblpigu0E2LUYKvin20F5hDNC0Ht715PMk8kqtVmKGX3Frmpi8iOzGLxfx_EeZ .knc76HlZih7yfxDCLB8PEOjGMNJrQJnDZBB5i2w0v5jb4IuajaIjiE9ff9muLRmlJIkGsXYNmg- - X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic312.consmr.mail.gq1.yahoo.com with HTTP; Sun, 5 Mar 2023 18:08:28 +0000 Received: by hermes--production-gq1-6cf7749bc8-sm5v9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7587221ce5d3f46b975d0faee4edb710; Sun, 05 Mar 2023 18:08:24 +0000 (UTC) From: Mark Millard Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: Porting software to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-ports List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports@freebsd.org X-BeenThere: freebsd-ports@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: How do I determine the ABI string used by pkg? Date: Sun, 5 Mar 2023 10:08:14 -0800 References: <65BCB61E-6A83-4550-9049-D503544A0AF6@yahoo.com> To: list_freebsd@bluerosetech.com, Baptiste Daroussin , FreeBSD Mailing List In-Reply-To: <65BCB61E-6A83-4550-9049-D503544A0AF6@yahoo.com> Message-Id: <60B35343-127D-43AB-A0A6-41689BFB2EEE@yahoo.com> X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Spamd-Result: default: False [-2.43 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.93)[-0.934]; DMARC_POLICY_ALLOW(-0.50)[yahoo.com,reject]; MV_CASE(0.50)[]; R_DKIM_ALLOW(-0.20)[yahoo.com:s=s2048]; R_SPF_ALLOW(-0.20)[+ptr:yahoo.com]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; DWL_DNSWL_NONE(0.00)[yahoo.com:dkim]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US]; RCVD_IN_DNSWL_NONE(0.00)[98.137.69.205:from]; RCVD_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[yahoo.com]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; DKIM_TRACE(0.00)[yahoo.com:+]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[yahoo.com]; MLMMJ_DEST(0.00)[freebsd-ports@freebsd.org] X-Rspamd-Queue-Id: 4PV8pQ1JF8z3jpQ X-Spamd-Bar: -- X-ThisMailContainsUnwantedMimeParts: N On Mar 5, 2023, at 09:54, Mark Millard wrote: > Mel Pilgrim wrote on > Date: Thu, 02 Mar 2023 07:50:13 UTC : > >> I need to determine the ABI string pkg uses on a given system, and need >> to do so when there are no pkgs installed. > > There may be more to that question than you are expecting > and you may have to establish more about what you want > (and why). > > pkg itself is a package and so you have specified it is not > installed. You have not indicated why pkg can not be installed > the normal way and then used. (The question might be if this > can be unblocked or not.) > > You have not indicated the range of system versions to be > covered. 12..14? All? > > What about when an LP64 architecture is supported for also > running an ILP32 counterpart, so there are 2 ABIs? > > LP64 ILP32 counterpart > amd64 i386 > powerpc64 powerpc > mips64* mips* > aarch64 armv6/armv7 > > (I question the accuracy of the armv6 in the "man 7 arch" > table, although I could change the kernel to switch from > armv7 to armv6 as the counterpart --and once helped someone > build a special kernel that did so.) > > So how do you know which ABI you are interested in for > those? > >> I've read through libpkg/pkg_elf.c and I can see how it's reading ELF >> headers from well-known files. That's all easy enough to replicate, but >> I'm a bit stuck on how it's determining the arch string for x86. > > There are also examples like: > > # pkg config ABI > FreeBSD:14:armv7 > > # pkg config ALTABI > freebsd:14:armv7:32:el:eabi:hardfp > > Notably, "man 5 pkg.conf" does not even mention ALTABI , just > ABI . > > Also, https://pkg.freebsd.org/ only lists the ABI form, > not the ALTABI form. But it does not mention riscv64 , > riscv64sf , any mips64* , any mips* , sparc64 , > plain "arm" , armeb , pc98 , ia64 , or alpha at all. > > aarch64 is more like amd64: > > # pkg config ABI > FreeBSD:14:aarch64 > > # pkg config ALTABI > freebsd:14:aarch64:64 > > But I'll note that I used the same machine (without > rebooting) for both armv7 and aarch64 above: armv7 > was via a chroot and was without qemu involved (qemu > is not even installed). > > Do you always have a already active execution context > to work with that is the one of interest, such as being > in a chroot? > >> How/When does pkg decide to use FreeBSD:13:amd64 instead of >> FreeBSD:13:x86:64? > > It might be that it provides ALTABI but makes no use of it? > That would allow other things to make use of the extra > information in ALTABI text. > >> Can I safely assume one or the other? > > Likely purpose driven, no universal answer otherwise. You > may need to indicate what the ABI ( or ALTABI ) strings > are to be used for. > > It used to be that some of the arm variants could be built > for either softfloat or hardfloat. Going back further some > that now have hardfloat instead used a form of softfloat. > It another example of your not having indicated the limits > on your range of interest in the possibilities over FreeBSD's > history. One thing I know is available is kern.supported_archs : # sysctl kern.supported_archs kern.supported_archs: aarch64 armv7 (Also, note the lack of armv6 being listed. The alternate kernel that I mentioned listed armv6 instead of armv7. The infrastructure does not allow for listing both as things are.) So, using that as a source of ARCH names, each: FreeBSD:VERSION:A_SUPPORTED_ARCH_NAME appears to be a valid ABI value on a running system, and the only valid ABI values for that running system. I'll note that even when chrooted into a armv7 context on a aarch64 system with AArch32 support: # sysctl kern.supported_archs kern.supported_archs: aarch64 armv7 So it does not report specifically on what the chroot context is for. === Mark Millard marklmi at yahoo.com