Skip to content

Commit c548ae6

Browse files
fangererfniephaus
authored andcommitted
Workaround CPU features Xcode 15 miscomp issue (GR-49301)
1 parent 25d87bf commit c548ae6

File tree

1 file changed

+8
-2
lines changed
  • substratevm/src/com.oracle.svm.native.libchelper/src

1 file changed

+8
-2
lines changed

substratevm/src/com.oracle.svm.native.libchelper/src/cpuid.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@
4242
#ifndef _WIN64
4343
#include <cpuid.h>
4444

45+
#if defined(_MSC_VER) && !defined(__clang__)
46+
#define NO_INLINE __declspec(noinline)
47+
#else
48+
#define NO_INLINE __attribute__((noinline))
49+
#endif
50+
4551
static void read_xem_xcr0(uint32_t *eax, uint32_t *edx) {
4652
__asm__ __volatile__("xgetbv" : "=a"(*eax), "=d"(*edx) : "c"(0));
4753
}
@@ -381,8 +387,8 @@ static void initialize_cpuinfo(CpuidInfo *_cpuid_info)
381387
}
382388
}
383389

384-
// ported from from vm_version_x86.hpp::feature_flags
385-
static void set_cpufeatures(CPUFeatures *features, CpuidInfo *_cpuid_info)
390+
// ported from from vm_version_x86.cpp::feature_flags
391+
static void NO_INLINE set_cpufeatures(CPUFeatures *features, CpuidInfo *_cpuid_info)
386392
{
387393
if (_cpuid_info->std_cpuid1_edx.bits.cmpxchg8 != 0)
388394
features->fCX8 = 1;

0 commit comments

Comments
 (0)