Re: Deprecation of i386 and 32-bit powerpc for 15.0 [ an aarch64/armv7 context note for -m32 ]
Date: Sun, 22 Jun 2025 07:24:46 UTC
[Reporting: 14.3-RELEASE gets some different behavior.]
On Jun 21, 2025, at 23:35, Mark Millard <marklmi@yahoo.com> wrote:
> Konstantin Belousov <kostikbel_at_gmail.com> wrote on
> Date: Sun, 22 Jun 2025 02:55:15 UTC :
>
>> On Sat, Jun 21, 2025 at 06:39:03PM -0700, Rodney W. Grimes wrote:
>>> . . .
>>
>> The i386 world on amd64 kernel is the supported configuration, and I
>> will put the efforts to keep this going. Simultaneously, there is not
>> much value in the full world for i386, lib32 + cc -m32 is the most
>> interesting thing for me and perhaps, practically, for all other people
>> who really use 32bit (as opposed to use it for flaming on ml).
>>
>> . . .
>
> In this area, but for aarch64/armv7 instead of amd64/i386:
>
> # cc -v -m32 basic_double_use.c
>
> in an aarch64 context reports using:
>
> "/usr/bin/cc" -cc1 -triple armv4t-unknown-freebsd15.0
>
> So: not armv7 and no -gnueabihf
>
> The context has:
>
> # cc -v
> FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
> Target: aarch64-unknown-freebsd15.0
> Thread model: posix
> InstalledDir: /usr/bin
> Build config: +assertions
>
> By contrast, in an armv7 context:
>
> # cc -v
> FreeBSD clang version 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)
> Target: armv7-unknown-freebsd15.0-gnueabihf
> Thread model: posix
> InstalledDir: /usr/bin
> Build config: +assertions
>
> But . . .
>
> # cc -v -m32 basic_double_use.c
>
> reports using:
>
> "/usr/bin/cc" -cc1 -triple armv7-unknown-freebsd15.0-gnueabihf . . .
>
> as expected: armv7 and -gnueabihf in use.
>
> Thus on aarch64, one needs to be explicit about -target ,
> unlike on armv7:
>
> # cc -v -m32 -target armv7-unknown-freebsd15.0-gnueabihf basic_double_use.c
>
> reports using:
>
> "/usr/bin/cc" -cc1 -triple armv7-unknown-freebsd15.0-gnueabihf
>
> In summary: -m32 ends up with the wrong default -target
> for the modern aarch64 FreeBSD type of context.
>
>
> For reference:
>
> # cat basic_double_use.c
> int main(void)
> {
> volatile double a=10;
> volatile double b=13;
> return (a*b<b/a) ? 0 : 1;
> }
>
>
> I've updated https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272806
> with a version of these notes, as they should be clearer than my
> original submittal for the issue.
>
Note: 14.3-RELEASE has the following properties for the
undefined symbol issue . . .
# cc -v -m32 -target armv7-unknown-freebsd15.0-gnueabihf basic_double_use.c
. . .
does not report such problems. But . . .
# cc -v -m32 basic_double_use.c
. . .
"/usr/bin/cc" -cc1 -triple armv4t-unknown-freebsd14.3 . . .
. . .
"/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -o a.out /usr/lib32/crt1.o /usr/lib32/crti.o /usr/lib32/crtbegin.o -L/usr/lib32 /tmp/basic_double_use-76fb64.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib32/crtend.o /usr/lib32/crtn.o
ld: error: undefined symbol: __muldf3
>>> referenced by basic_double_use.c
>>> /tmp/basic_double_use-76fb64.o:(main)
>>> did you mean: __muldc3
>>> defined in: /usr/lib32/libgcc_s.so
ld: error: undefined symbol: __divdf3
>>> referenced by basic_double_use.c
>>> /tmp/basic_double_use-76fb64.o:(main)
>>> did you mean: __divdc3
>>> defined in: /usr/lib32/libgcc_s.so
ld: error: undefined symbol: __ltdf2
>>> referenced by basic_double_use.c
>>> /tmp/basic_double_use-76fb64.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
So the undefined symbols are tied to the armv4t and/or
lack of -gnueabihf from the bad default target in a
14.3-RELEASE context.
===
Mark Millard
marklmi at yahoo.com