From nobody Tue Aug 15 14:24:45 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 4RQD7J0lZLz4mTV0 for ; Tue, 15 Aug 2023 14:25:00 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (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-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RQD7H5N7sz4KmY for ; Tue, 15 Aug 2023 14:24:59 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-52256241c50so7441380a12.3 for ; Tue, 15 Aug 2023 07:24:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20221208.gappssmtp.com; s=20221208; t=1692109497; x=1692714297; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=8r8xPuE1HNAyxpPAXkoAEBKEsiv8KDNkXRhmBqu2WYw=; b=r9fkQ7yKTBVtiBqmB6OhGcR3Te8UqTWRWryusK7b4rxDPW0JZETyBG4bO+BfTB1+0y 14S9TYRgIr2d3SteqocGlNDyQaKDQSF9AlTP0dqej1Nv2WC7Ez4U/Pqrj7EdJg27f+Ic ZiR1MnGqYWJckaEHu1jiT/gp73wuhLkbqtOws9VchvXarYf+nSs3sTj5PggrVT4RZuJK ArfXbDWRG+h8Yl9UkAPMbDOs/1u7Ux8faEw+IfyABvGlAzyPMKckOpds3jcKyIGmD6rq Uyq+Sc52dADUMj70IbP1eNUdu/aKIQSqiamIWNfjfSMabM0mqGQe0B3+Cd7m40g5umQW SOgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692109497; x=1692714297; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8r8xPuE1HNAyxpPAXkoAEBKEsiv8KDNkXRhmBqu2WYw=; b=WzHi5b7kABpRuph6fH7C6U69Ev8skCWs6tPMrZDS87830XmnFEuGLbw7Yuqp8CLC9v Tr+P1dTFlq4ANW3WlA1ioOfSAa6f6kTYYuLIOU+DAVWdAEXqIlkxO6Z7z70KAWU5rekC 0WPoojvyCB6b8WBj59zUGhi/h0fhX0iaCMK5F4I9o8ItGRwWAwDLOLIqhjnrYZN/l850 Yy/nJt5YCOg2Emm+E0PcsU+dtg64aRBYTcAkCBCT9p5m3pB9a4bBjC4jwvSmkpfJONYx w2F/RuoLaAZ4jg9msyqMpL4RB2zQcZWAwsGEl+IejVKQ6K4SVHZ704CRYRvKFhjXvZMe 5Qwg== X-Gm-Message-State: AOJu0Yw5gPJvqJATaiL9H9tPz1MFMbz+awM0dXx4PGwKFO8cbUapjdxt UTl7+OxPbaFFP/ThRCmKwyDRcdy+4NCGykZ9MWkYXU2VQSczSmleeLk= X-Google-Smtp-Source: AGHT+IEcJuQDy+zrl+CpuBrBJsOisSVbtyhhTx4IO88fzF5aFNtgCp8hzTmosu0Afepli0cuP7rFnYJjbnQnF3Th/ow= X-Received: by 2002:a05:6402:1245:b0:525:5ed2:abed with SMTP id l5-20020a056402124500b005255ed2abedmr5365077edw.30.1692109496490; Tue, 15 Aug 2023 07:24:56 -0700 (PDT) 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 References: In-Reply-To: From: Warner Losh Date: Tue, 15 Aug 2023 08:24:45 -0600 Message-ID: Subject: Re: Float ABI confusion for armv7 To: John F Carr Cc: freebsd-arm Content-Type: multipart/alternative; boundary="00000000000075b2c20602f6f131" X-Rspamd-Queue-Id: 4RQD7H5N7sz4KmY X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] --00000000000075b2c20602f6f131 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable There's two changes you should look into: (1) The -m32 for arm llvm change (which has been implicated for other issues in other email threads): commit f1d5183124d3e18d410ded61e45adb9a23b23c83 Author: Mike Karels Date: Tue Jul 25 18:58:51 2023 -0500 arm64 lib32: change clang to allow -m32 on arm64 The FreeBSD driver support for clang tested explicitly for 32-bit Intel, MIPS, or PowerPC targets where /usr/lib32/libcrt1.o was present to decide whether -m32 should use /usr/lib32. At jrtc27's suggestion, simply test for a 32-bit platform rather than adding arm to the list. Upstreamed as https://github.com/llvm/llvm-project/commit/3450272fc281979388bb845a9fffb59= b42cc2e7e Bump the freebsd version to force a bootstrap build. This is one step in adding support for -m32 on arm64. Reviewed by: jrtc27, brooks, dim Differential Revision: https://reviews.freebsd.org/D40943 and (2) Some of my cleanup: commit 2726978bd801ceca07075f150d6ad9ef55470a21 Author: Warner Losh Date: Tue Jul 5 10:16:19 2022 -0600 Makefile.inc1: Remove redundant test for armv[67] If MACHINE is arm, then MACHINE_ARCH is going to be either armv6* or armv7*. Sponsored by: Netflix I suspect #1, but maybe #2 is implicated as well. Despite looking like it had an earlier date, #2 landed later. Warner On Tue, Aug 15, 2023 at 7:52=E2=80=AFAM John F Carr wrote: > Has something changed in llvm to cause soft float to be the default for > armv7? > > I am cross-compiling using poudriere on a 64 bit ARM host to target armv7= . > This used to work. After updating my jail (poudriere jail -u -msrc=3D...= ) I > get an > unnecessarily mysterious failure building pkg. Poudriere erases the > evidence, > poudriere -i does not work as advertised, pkg's configure script spawns > subshells > to prevent set -x from working, and the subshell directs error messages t= o > /dev/null. > After getting past all that, > > # cc -target armv7-freebsd -o /tmp/a.out autosetup/jimsh0.c > > in the pkg source directory results in undefined symbols such as __eqdf2. > > # cc -target armv7-freebsd-gnueabihf -o /tmp/a.out autosetup/jimsh0.c > > works fine. > > # cc -v > FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git > llvmorg-16.0.6-0-g7cbf1a259152) > Target: armv7-unknown-freebsd14.0 > Thread model: posix > InstalledDir: /usr/bin > > > --00000000000075b2c20602f6f131 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
There's two changes you should look into:

(1) The -m32 for arm llvm change (which has been implicated for othe= r issues in other email threads):

commit f1d518312= 4d3e18d410ded61e45adb9a23b23c83
Author: Mike Karels <karels@FreeBSD.o= rg>
Date: =C2=A0 Tue Jul 25 18:58:51 2023 -0500

=C2=A0 =C2=A0 = arm64 lib32: change clang to allow -m32 on arm64

=C2=A0 =C2=A0 The F= reeBSD driver support for clang tested explicitly for 32-bit
=C2=A0 =C2= =A0 Intel, MIPS, or PowerPC targets where /usr/lib32/libcrt1.o was
=C2= =A0 =C2=A0 present to decide whether -m32 should use /usr/lib32.=C2=A0 At j= rtc27's
=C2=A0 =C2=A0 suggestion, simply test for a 32-bit platform = rather than adding
=C2=A0 =C2=A0 arm to the list.=C2=A0 Upstreamed as=C2=A0 =C2=A0 https://github.com/llvm/llvm-project/c= ommit/3450272fc281979388bb845a9fffb59b42cc2e7e
=C2=A0 =C2=A0 Bump th= e freebsd version to force a bootstrap build.=C2=A0 This is one
=C2=A0 = =C2=A0 step in adding support for -m32 on arm64.

=C2=A0 =C2=A0 Revie= wed by: =C2=A0 =C2=A0jrtc27, brooks, dim
=C2=A0 =C2=A0 Differential Revi= sion: =C2=A0https://reviews.= freebsd.org/D40943

and (2) Some of my clea= nup:

commit 2726978bd801ceca07075f150d6ad9ef55470a= 21
Author: Warner Losh <imp@FreeBSD.org>
Date: =C2=A0 Tue Jul 5= 10:16:19 2022 -0600

=C2=A0 =C2=A0 Makefile.inc1: Remove redundant t= est for armv[67]

=C2=A0 =C2=A0 If MACHINE is arm, then MACHINE_ARCH = is going to be either armv6* or
=C2=A0 =C2=A0 armv7*.

=C2=A0 =C2= =A0 Sponsored by: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Netflix
=
I suspect #1, but maybe #2 is implicated as well.=C2=A0 Desp= ite looking like it had an earlier
date, #2 landed later.

Warner


On Tue, Aug 15, 2023 at 7:52= =E2=80=AFAM John F Carr <jfc@mit.edu&= gt; wrote:
Has s= omething changed in llvm to cause soft float to be the default for armv7?
I am cross-compiling using poudriere on a 64 bit ARM host to target armv7.<= br> This used to work.=C2=A0 After updating my jail (poudriere jail -u -msrc=3D= ...) I get an
unnecessarily mysterious failure building pkg.=C2=A0 Poudriere erases the e= vidence,
poudriere -i does not work as advertised, pkg's configure script spawns= subshells
to prevent set -x from working, and the subshell directs error messages to = /dev/null.
After getting past all that,

# cc -target armv7-freebsd -o /tmp/a.out autosetup/jimsh0.c

in the pkg source directory results in undefined symbols such as __eqdf2.
# cc -target armv7-freebsd-gnueabihf -o /tmp/a.out autosetup/jimsh0.c

works fine.

# cc -v
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-p= roject.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: armv7-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin


--00000000000075b2c20602f6f131--