Re: [PATCH kvm-unit-tests v2] arm64: Fix compiling with ancient compiler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 03, 2022 at 04:13:44PM +0100, Andrew Jones wrote:
> When compiling with an ancient compiler (gcc-4.8.5-36.el7_6.2.aarch64)
> the build fails with
> 
>   lib/libcflat.a(alloc.o): In function `mult_overflow':
>   /home/drjones/kvm-unit-tests/lib/alloc.c:19: undefined reference to `__multi3'
> 
> According to kernel commit fb8722735f50 ("arm64: support __int128 on
> gcc 5+") gcc older than 5 will emit __multi3 for __int128 multiplication.
> To fix this, let's just use check_mul_overflow(), which does overflow
> checking with GCC7.1+ and nothing for older gcc. We lose the fallback
> for older gcc, but oh, well, the heavily negative diffstat is just too
> tempting to go for another solution.
> 
> While we're cleaning up lib/alloc.c with the function deletion also take
> the opportunity to clean up the include style and add an SPDX header.
> 
> Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
> ---
>  lib/alloc.c | 41 ++++++-----------------------------------
>  1 file changed, 6 insertions(+), 35 deletions(-)
>

Applied to misc/queue
https://gitlab.com/rhdrjones/kvm-unit-tests/-/commits/misc/queue

Thanks,
drew




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux