diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-12-08 17:15:51 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-12-11 17:41:04 -0800 |
commit | 91478930711c99c876f0df9475c056445eea96b6 (patch) | |
tree | bb8c8999bd268ec49ee4db6684caabdcd78edf19 /src/corelib/thread | |
parent | cf78b5ec9519a0f03a7e33de08e4c38074f341eb (diff) |
qYieldCpu: ensure we don't use asm statement with MSVC on ARM
Amends a7f227f56cfe562280e89d3c73040f7e8384129e.
It doesn't support that anywhere except i386, and even there it has a
different syntax than what we're using here. This code assumed ARM was
only ued with GCC-like compilers.
qglobal.c.obj : error LNK2019: unresolved external symbol asm referenced in function tst_qYieldCpu
tests\auto\corelib\global\qglobal\tst_qglobal.exe : fatal error LNK1120: 1 unresolved externals
Note: if we're getting here, it means the _YIELD_PROCESSOR() generic
macro was not used, which means there is no ARM YIELD being emitted for
MSVC on ARM for C code (for C++, the macro appears to be working). This
is likely to be a performance issue, which will need to be fixed by
someone who has an interest in improving performance on those
conditions.
Fixes: QTBUG-119881
Pick-to: 6.7
Change-Id: Ica7a43f6147b49c187ccfffd179f04e1ab643302
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r-- | src/corelib/thread/qyieldcpu.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/thread/qyieldcpu.h b/src/corelib/thread/qyieldcpu.h index b54e54568d..db39b2f9e5 100644 --- a/src/corelib/thread/qyieldcpu.h +++ b/src/corelib/thread/qyieldcpu.h @@ -48,7 +48,7 @@ void qYieldCpu(void) #elif __has_builtin(__builtin_arm_yield) __builtin_arm_yield(); -#elif defined(Q_PROCESSOR_ARM) && Q_PROCESSOR_ARM >= 7 +#elif defined(Q_PROCESSOR_ARM) && Q_PROCESSOR_ARM >= 7 && defined(Q_CC_GNU) asm("yield"); // this works everywhere #elif __has_builtin(__builtin_riscv_pause) |