From nobody Thu May 18 18:52:56 2023 X-Original-To: freebsd-arm@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 4QMfHr1rQ2z4Btm3 for ; Thu, 18 May 2023 18:53:12 +0000 (UTC) (envelope-from marklmi@yahoo.com) Received: from sonic303-25.consmr.mail.gq1.yahoo.com (sonic303-25.consmr.mail.gq1.yahoo.com [98.137.64.206]) (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 4QMfHq6Fsrz3jrp for ; Thu, 18 May 2023 18:53:11 +0000 (UTC) (envelope-from marklmi@yahoo.com) Authentication-Results: mx1.freebsd.org; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684435990; bh=yMRwXlKQa3mxl5ZD+mBjM09KROwVlEs0crxydqoDP9M=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject:Reply-To; b=C8SknhdXyUgTN5/3r6let/Mb8mH6g2Fi0MXwWgVOawejAlWIJelTGzgoqThlskpPBxs0qiyuAGOOEhNyAAziy99FwMb4oN0dYVDZYXKW9w8dBQhkdZDLRiXHBOIzf6owWMkCh8jfuSc8EjhlFYL/7AUHOdtqKothMBTXqjn6/4ZnnHZVj+1+xNZdMLc+g88SBAhvMefj8FJwNybCL9tGBBpGOwQRjOtd2j+RJ64F2FsIedu0F4+8F8Qk+u/hQGhw3Rm105gYNcxGqRwXdbFzZHkYk+10axjz2x4tq4RBEUs6J2QEqoGa+MIeCt32osCjWNQRTIrergJRakM+STJ5Qw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1684435990; bh=HwpErMC6gxneITfAelHZTdKJ6vbc7du5d1Ijtu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MmCW fwYBCZort_Zl29Se_XDCjdVr625LhLASyqrowec0SQnesUEy_WqoIWZVQu1G2tAJfY2j_xiGsHGT .gzg0w34xPSbA07qj8NrbwiK.jk0nAKNQxBKVasunStmuFEKcczJazp74xinyQ5.Me3uDRbRP2G4 ClA_6rOeNIxvsYTvJuLp4u2gsRp86ZuALXqm4fxSPW5L2K5IPOlufs_NLcvPTV9KlCFGFxunWyPK oncYH6ZAmsviB90kSChzAZT_QFUIxnE9bl3C_dpkDSP0gnzodtYDdZWX_gJZljMtj0hamy4.24rd vCQ0mEBz273Fu1JiPdayVegaTZUPibfqGD_hjHsawr.COB6KgY3D4KX4S.iGTkwCIOaR3bLLqjwJ JaXBzf3E98LoYuoBwe3GA.6Z9EhfAV4BiemuG.UOo3cFj6zyBehJ2s9NDGQEzUnY9w.cE9Pxpw_0 7ziUzFB51gSJrt5JtgbmRypXLsG_cbafz61JG3TTTF0rUY8ekSRn4d318aZIoyvjEi0dL7NvKIi5 GzNmPFYYSsNbCZ3QmnZv0uIzwTAzD7KWdiZJIlFN4p6BBvSjPceldSn_zF0mkEh9zr4UUf7adb7x vHg-- X-Sonic-MF: X-Sonic-ID: 35905dd6-5982-4b91-8a5d-76ce9bcc3274 Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Thu, 18 May 2023 18:53:10 +0000 Received: by hermes--production-ne1-574d4b7954-q7frw (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID aa2a05a9d34eb13d3a1e41238bb07b1d; Thu, 18 May 2023 18:53:08 +0000 (UTC) Content-Type: text/plain; charset=us-ascii List-Id: Porting FreeBSD to ARM processors List-Archive: https://lists.freebsd.org/archives/freebsd-arm List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-arm@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.51.1.1\)) Subject: Re: 32-bit executables on aarch64? From: Mark Millard In-Reply-To: <46BE47DA-9306-4682-8320-D2CBEB5918F7@mit.edu> Date: Thu, 18 May 2023 11:52:56 -0700 Cc: John F Carr , "freebsd-arm@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <9916CA51-E1F3-45C5-A489-6731B12D6F65@yahoo.com> References: <202305181816.34IIGA8P024382@office.dignus.com> <46BE47DA-9306-4682-8320-D2CBEB5918F7@mit.edu> To: Thomas David Rivers X-Mailer: Apple Mail (2.3731.400.51.1.1) X-Rspamd-Queue-Id: 4QMfHq6Fsrz3jrp X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:36647, ipnet:98.137.64.0/20, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-ThisMailContainsUnwantedMimeParts: N On May 18, 2023, at 11:22, John F Carr wrote: > I had to set up a jail to test 32 bit ARM on a 64 bit host. I just install a armv7 world in a directory tree and have a script that does a chroot into the directory tree after devfs and nullfs mounts (and also does the umount's). An example: # more ~/do-chroot-main-CA7.sh=20 #! /bin/sh mkdir -p /usr/obj/DESTDIRs/main-CA7-chroot/dev/ \ && mount -tdevfs devfs /usr/obj/DESTDIRs/main-CA7-chroot/dev/ \ && mkdir -p = /usr/obj/DESTDIRs/main-CA7-chroot/usr/local/poudriere/data/packages/main-C= A7-default/ \ && mount_nullfs /usr/local/poudriere/data/packages/main-CA7-default \ = /usr/obj/DESTDIRs/main-CA7-chroot/usr/local/poudriere/data/packages/main-C= A7-default/ \ && mkdir -p /usr/obj/DESTDIRs/main-CA7-chroot/usr/ports/ \ && mount_nullfs /usr/ports /usr/obj/DESTDIRs/main-CA7-chroot/usr/ports/ = \ && env IN_CHROOT=3D"main-CA7-chroot" chroot = /usr/obj/DESTDIRs/main-CA7-chroot/ umount /usr/obj/DESTDIRs/main-CA7-chroot/usr/ports/ umount = /usr/obj/DESTDIRs/main-CA7-chroot/usr/local/poudriere/data/packages/main-C= A7-default/ umount /usr/obj/DESTDIRs/main-CA7-chroot/dev/ ("IN_CHROOT" is something specific to what I set up.) Clearly I adjust some material in the armv7 world as well, such as causing it to use the path: /usr/local/poudriere/data/packages/main-CA7-default/ > If you get past the link error, expect the program to fail at startup. Yea, no system lib32 for enabling armv7 programs directly. (powerpc64 and powerpc is an example context where lib32 was put in place.) > $ file /bin/ls /usr/jail/armv7/bin/ls > /bin/ls: ELF 64-bit LSB pie executable, ARM aarch64, = version 1 (FreeBSD), dynamically linked, interpreter = /libexec/ld-elf.so.1, for FreeBSD 13.2 (1302505), FreeBSD-style, = stripped > /usr/jail/armv7/bin/ls: ELF 32-bit LSB executable, ARM, EABI5 version = 1 (FreeBSD), dynamically linked, interpreter /libexec/ld-elf.so.1, = FreeBSD-style, for FreeBSD 13.2 (1302500), stripped > $ /usr/jail/armv7/bin/ls > ELF interpreter /libexec/ld-elf.so.1 not found, error 8 > Abort trap >=20 > "Not found" means "is not a 32 bit executable." Because both 32 and = 64 bit progams use the same intepreter pathname they can't both work. >=20 >=20 >> On May 18, 2023, at 14:16, Thomas David Rivers = wrote: >>=20 >>=20 >> Tried the following with a small "hello world" program on=20 >> FreeBSD freebsd 13.2-RELEASE FreeBSD 13.2-RELEASE = releng/13.2-n254617-525ecfdad597 GENERIC arm64 >>=20 >> # cc -m32 hello.c >>=20 >> To get these errors: >>=20 >> ld: error: /tmp/hello-1eb3b8.o is incompatible with /usr/lib/crt1.o >> cc: error: linker command failed with exit code 1 (use -v to see = invocation) >>=20 >> Is building a 32-bit program not supported on 13.2 arm64? >>=20 >> man cc >>=20 >> gave me the CLANG doc... which didn't even mention "m32"; so perhaps >> I just need a different set of options? I tried -arch arm but I = still >> got 64-bit code. Also, I tried several other -arch options and = didn't >> see a difference, even with -arch x86, I still got Aarch64 code. >>=20 >> - Many thanks! - >> - Dave Rivers - >>=20 >> -- >> rivers@dignus.com Work: (919) 676-0847 >> Get your mainframe programming tools at http://www.dignus.com >>=20 >=20 =3D=3D=3D Mark Millard marklmi at yahoo.com