Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 May 2025 15:15:27 +0200
From:      Dimitry Andric <dim@FreeBSD.org>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        "current@freebsd.org" <current@FreeBSD.org>
Subject:   Re: (arm64) link_elf: symbol __floatundidf undefined ...
Message-ID:  <B8278D86-38F2-4792-839B-2246A5C9A2E2@FreeBSD.org>
In-Reply-To: <n773q04n-p268-581p-o4qs-595412n0qr7s@yvfgf.mnoonqbm.arg>
References:  <0r5n4p87-3pn0-3247-8n6q-n20qn0ro27r9@yvfgf.mnoonqbm.arg> <74650476-D42E-4074-A18F-D7F474EC271B@FreeBSD.org> <n773q04n-p268-581p-o4qs-595412n0qr7s@yvfgf.mnoonqbm.arg>

next in thread | previous in thread | raw e-mail | index | archive | help
On 26 May 2025, at 15:05, Bjoern A. Zeeb =
<bzeeb-lists@lists.zabbadoz.net> wrote:
>=20
> On Mon, 26 May 2025, Dimitry Andric wrote:
>=20
> Hi,
>=20
> thanks for the quick answer.
>=20
>> On 26 May 2025, at 14:25, Bjoern A. Zeeb =
<bzeeb-lists@lists.zabbadoz.net> wrote:
>>>=20
>>> I've just compiled and installed a new arm64/main with my own kernel
>>> config to have wifi bits as modules.
>>>=20
>>> I am a bit puzzed as to where this comes from in the kernel.
>>>=20
>>> # kldload wlan
>>> link_elf: symbol __floatundidf undefined: 0xffff000143ed1370 =
0xffff000143ecf9f0 11496 0xffff000143ed26d8 0x2
>>> kldload: can't load wlan: No such file or directory
>>>=20
>>> % nm modules/usr/src/sys/modules/wlan/wlan.ko.full | grep float
>>>                U __floatundidf
>>>=20
>>> Anyone any idea?
>>=20
>> _Something_ is converting a unsigned long to a double, but what? Can =
you figure out which object file it is?
>=20
> % nm ieee80211_ioctl.o | grep __floatundidf
>                 U __floatundidf
>=20
> This may be a local change I have adding an extra 10% of space in the
> ioctl code to accomodate for enlargement of a result set for testing.
> size_t space;
> ...
> space *=3D 1.10;
>=20
> Given it's likely that it's that I think the real question is, why is =
this
> not an issue on amd64 but on arm64 as I've been running that change =
for
> days on amd64?

My guess is that it's inlined on amd64. For me simple cases also inline =
on arm64, but maybe you are doing something more complicated:

$ cat convert.c
#include <stddef.h>

size_t f(size_t s)
{
  return s * 1.10;
}

$ cc -target aarch64-freebsd -S convert.c -o -
        .text
        .file   "convert.c"
        .section        .rodata.cst8,"aM",@progbits,8
        .p2align        3, 0x0                          // -- Begin =
function f
.LCPI0_0:
        .xword  0x3ff199999999999a              // double =
1.1000000000000001
        .text
        .globl  f
        .p2align        2
        .type   f,@function
f:                                      // @f
        .cfi_startproc
// %bb.0:                               // %entry
        sub     sp, sp, #16
        .cfi_def_cfa_offset 16
        str     x0, [sp, #8]
        ldr     d0, [sp, #8]
        ucvtf   d0, d0
        adrp    x8, .LCPI0_0
        ldr     d1, [x8, :lo12:.LCPI0_0]
        fmul    d0, d0, d1
        fcvtzu  x0, d0
        add     sp, sp, #16
        .cfi_def_cfa_offset 0
        ret
.Lfunc_end0:
        .size   f, .Lfunc_end0-f
        .cfi_endproc
                                        // -- End function
        .ident  "FreeBSD clang version 19.1.7 =
(https://github.com/llvm/llvm-project.git =
llvmorg-19.1.7-0-gcd708029e0b2)"
        .section        ".note.GNU-stack","",@progbits
        .addrsig

-Dimitry




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B8278D86-38F2-4792-839B-2246A5C9A2E2>