Re: Float ABI confusion for armv7

From: Warner Losh <imp_at_bsdimp.com>
Date: Tue, 15 Aug 2023 14:24:45 UTC
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 <karels@FreeBSD.org>
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/3450272fc281979388bb845a9fffb59b42cc2e7e
    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 <imp@FreeBSD.org>
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 AM John F Carr <jfc@mit.edu> 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=...) 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 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-project.git
> llvmorg-16.0.6-0-g7cbf1a259152)
> Target: armv7-unknown-freebsd14.0
> Thread model: posix
> InstalledDir: /usr/bin
>
>
>