Re: [PATCH 08/12] tools/nolibc: gettimeofday(): avoid libgcc 64-bit divisions
From: Arnd Bergmann
Date: Thu Oct 30 2025 - 10:57:32 EST
On Wed, Oct 29, 2025, at 17:02, Thomas Weißschuh wrote:
> timespec::tv_nsec is going to be 64-bit wide even on 32-bit
> architectures. As not all architectures support 64-bit division
> instructions, calls to libgcc (__divdi3()) may be emitted by the
> compiler which are not provided by nolibc.
>
> As tv_nsec is guaranteed to always fit into an uint32_t, perform a
> 32-bit division instead.
>
> Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>