host-utils: Drop workaround for buggy Apple Clang __builtin_subcll()
PATCH 1/1 host-utils: Drop workaround for buggy Apple Clang __builtin_subcll()
In commit b0438861efe ("host-utils: Avoid using __builtin_subcll on buggy versions of Apple Clang") we added a workaround for a bug in Apple Clang 14 where its __builtin_subcll() implementation was wrong. This bug was only present in Apple Clang 14, not in upstream clang, and is not present in Apple Clang versions 15 and newer.
Since commit 4e035201 we have required at least Apple Clang 15, so we no longer build with the buggy versions. We can therefore drop the workaround. This is effectively a revert of b0438861efe.
This should not be backported to stable branches, which may still need to support Apple Clang 14.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3030
--- include/qemu/compiler.h | 13 ------------- include/qemu/host-utils.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-)
include/qemu/compiler.h +0 -13
@@ -182,19 +182,6 @@#define QEMU_DISABLE_CFI #endif -/* -* Apple clang version 14 has a bug in its __builtin_subcll(); define -* BUILTIN_SUBCLL_BROKEN for the offending versions so we can avoid it. -* When a version of Apple clang which has this bug fixed is released -* we can add an upper bound to this check. -* See https://gitlab.com/qemu-project/qemu/-/issues/1631 -* and https://gitlab.com/qemu-project/qemu/-/issues/1659 for details. -* The bug never made it into any upstream LLVM releases, only Apple ones. -*/ -#if defined(__apple_build_version__) && __clang_major__ >=14 -#define BUILTIN_SUBCLL_BROKEN -#endif -#if __has_attribute (annotate)#define QEMU_ANNOTATE (x) __attribute__((annotate(x)))#else
include/qemu/host-utils.h +1 -1
@@ -677,7 +677,7 @@ static inline uint64_t uadd64_carry(uint64_t x, uint64_t y, bool *pcarry)*/ static inline uint64_t usub64_borrow (uint64_t x,uint64_t y,bool *pborrow) { -#if __has_builtin (__builtin_subcll) && !defined(BUILTIN_SUBCLL_BROKEN ) +#if __has_builtin (__builtin_subcll)unsigned long long b = *pborrow; x =__builtin_subcll (x, y, b, &b); *pborrow = b &1 ;
Signature · 1 line
2.43.0
Quoted 13 lines · Peter Maydell
In commit
b0438861efe("host-utils: Avoid using__builtin_subcllon buggy versions of Apple Clang") we added a workaround for a bug in Apple Clang 14 where its__builtin_subcll()implementation was wrong. This bug was only present in Apple Clang 14, not in upstream clang, and is not present in Apple Clang versions 15 and newer.Since commit
4e035201we have required at least Apple Clang 15, so we no longer build with the buggy versions. We can therefore drop the workaround. This is effectively a revert ofb0438861efe.This should not be backported to stable branches, which may still need to support Apple Clang 14.
Quoted 6 lines
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3030
Signed-off-by Peter Maydell <[email protected]>--- include/qemu/compiler.h | 13 ------------- include/qemu/host-utils.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-)
Quoted 13 lines · Peter Maydell
In commit
b0438861efe("host-utils: Avoid using__builtin_subcllon buggy versions of Apple Clang") we added a workaround for a bug in Apple Clang 14 where its__builtin_subcll()implementation was wrong. This bug was only present in Apple Clang 14, not in upstream clang, and is not present in Apple Clang versions 15 and newer.Since commit
4e035201we have required at least Apple Clang 15, so we no longer build with the buggy versions. We can therefore drop the workaround. This is effectively a revert ofb0438861efe.This should not be backported to stable branches, which may still need to support Apple Clang 14.
Quoted 6 lines
Resolves:https://gitlab.com/qemu-project/qemu/-/issues/3030
Signed-off-by Peter Maydell<[email protected]>--- include/qemu/compiler.h | 13 ------------- include/qemu/host-utils.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-)
Commit 4e035201 was in 9.2.0, but indeed there's no point in backporting to any stable branch.
r~
Quoted 13 lines · Peter Maydell
In commit
b0438861efe("host-utils: Avoid using__builtin_subcllon buggy versions of Apple Clang") we added a workaround for a bug in Apple Clang 14 where its__builtin_subcll()implementation was wrong. This bug was only present in Apple Clang 14, not in upstream clang, and is not present in Apple Clang versions 15 and newer.Since commit
4e035201we have required at least Apple Clang 15, so we no longer build with the buggy versions. We can therefore drop the workaround. This is effectively a revert ofb0438861efe.This should not be backported to stable branches, which may still need to support Apple Clang 14.
Quoted 6 lines
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3030
Signed-off-by Peter Maydell <[email protected]>--- include/qemu/compiler.h | 13 ------------- include/qemu/host-utils.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-)
Quoted 15 lines · Philippe Mathieu-Daudé
Quoted 13 lines · Peter Maydell
In commit
b0438861efe("host-utils: Avoid using__builtin_subcllon buggy versions of Apple Clang") we added a workaround for a bug in Apple Clang 14 where its__builtin_subcll()implementation was wrong. This bug was only present in Apple Clang 14, not in upstream clang, and is not present in Apple Clang versions 15 and newer.Since commit
4e035201we have required at least Apple Clang 15, so we no longer build with the buggy versions. We can therefore drop the workaround. This is effectively a revert ofb0438861efe.This should not be backported to stable branches, which may still need to support Apple Clang 14.
Quoted 8 lines
Quoted 6 lines
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3030
Signed-off-by Peter Maydell <[email protected]>--- include/qemu/compiler.h | 13 ------------- include/qemu/host-utils.h | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-)Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks all for the review; I'll pick this up via target-arm.next.
-- PMM