diff options
| author | Khem Raj <raj.khem@gmail.com> | 2021-04-13 19:00:58 -0700 |
|---|---|---|
| committer | Joshua Watt <JPEWhacker@gmail.com> | 2021-04-13 22:07:29 -0500 |
| commit | 7fecef947eadbe9c7fc6c2a9fae1000a831b8d4f (patch) | |
| tree | a58c989a7573f8d2a3e727194143fcd58e7983cd /recipes-devtools | |
| parent | 5543c32b8addb6cb88b43d296c0eac5ee57b018d (diff) | |
| download | meta-mingw-7fecef947eadbe9c7fc6c2a9fae1000a831b8d4f.tar.gz | |
mingw-w64: Check for __builtin_ia32_rdtsc
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Diffstat (limited to 'recipes-devtools')
| -rw-r--r-- | recipes-devtools/mingw-w64/files/0001-intrincs-Check-for-__builtin_ia32_rdtsc.patch | 33 | ||||
| -rw-r--r-- | recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_7.0.0.bb | 2 |
2 files changed, 35 insertions, 0 deletions
diff --git a/recipes-devtools/mingw-w64/files/0001-intrincs-Check-for-__builtin_ia32_rdtsc.patch b/recipes-devtools/mingw-w64/files/0001-intrincs-Check-for-__builtin_ia32_rdtsc.patch new file mode 100644 index 0000000..ce4ba81 --- /dev/null +++ b/recipes-devtools/mingw-w64/files/0001-intrincs-Check-for-__builtin_ia32_rdtsc.patch | |||
| @@ -0,0 +1,33 @@ | |||
| 1 | From 346de7591f58015d111f4d4f3b001382c04d5557 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 13 Apr 2021 18:44:25 -0700 | ||
| 4 | Subject: [PATCH] intrincs: Check for __builtin_ia32_rdtsc | ||
| 5 | |||
| 6 | on modern gcc ( >=4.6 ) __rdtsc function is implemented using | ||
| 7 | special builtin function called __builtin_ia32_rdtsc, its actually | ||
| 8 | a define in gcc, so __has_builtin check fails for __rdtsc even | ||
| 9 | though it is defined to imply __builtin_ia32_rdtsc(), therefore | ||
| 10 | check for existence of __builtin_ia32_rdtsc as well | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 14 | --- | ||
| 15 | mingw-w64-crt/intrincs/rdtsc.c | 2 +- | ||
| 16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 17 | |||
| 18 | diff --git a/mingw-w64-crt/intrincs/rdtsc.c b/mingw-w64-crt/intrincs/rdtsc.c | ||
| 19 | index bf9c03b..df04711 100644 | ||
| 20 | --- a/mingw-w64-crt/intrincs/rdtsc.c | ||
| 21 | +++ b/mingw-w64-crt/intrincs/rdtsc.c | ||
| 22 | @@ -11,7 +11,7 @@ | ||
| 23 | #define __has_builtin(x) 0 | ||
| 24 | #endif | ||
| 25 | |||
| 26 | -#if !__has_builtin(__rdtsc) | ||
| 27 | +#if !__has_builtin(__rdtsc) && !__has_builtin(__builtin_ia32_rdtsc) | ||
| 28 | unsigned __int64 __rdtsc(void) | ||
| 29 | { | ||
| 30 | #ifdef _WIN64 | ||
| 31 | -- | ||
| 32 | 2.31.1 | ||
| 33 | |||
diff --git a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_7.0.0.bb b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_7.0.0.bb index 9f79ffe..0368841 100644 --- a/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_7.0.0.bb +++ b/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_7.0.0.bb | |||
| @@ -2,6 +2,8 @@ DESCRIPTION = "Runtime libraries from MinGW-w64 project" | |||
| 2 | 2 | ||
| 3 | require mingw-w64.inc | 3 | require mingw-w64.inc |
| 4 | 4 | ||
| 5 | SRC_URI += "file://0001-intrincs-Check-for-__builtin_ia32_rdtsc.patch;striplevel=2" | ||
| 6 | |||
| 5 | S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-crt" | 7 | S = "${WORKDIR}/mingw-w64-v${PV}/mingw-w64-crt" |
| 6 | B = "${WORKDIR}/build-${TARGET_SYS}" | 8 | B = "${WORKDIR}/build-${TARGET_SYS}" |
| 7 | 9 | ||
