aboutsummaryrefslogtreecommitdiff
path: root/multimedia/cmrt
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2018-11-22 00:07:22 +0000
committerJan Beich <jbeich@FreeBSD.org>2018-11-22 00:07:22 +0000
commit47998cb69eb4026c16bf5a8362dfcc4310e229cc (patch)
treee354fa59209f7613885640bee90cbe8c07542528 /multimedia/cmrt
parent3daca92a8f4b95992fa95af76c76bdce13a5efd1 (diff)
downloadports-47998cb69eb4026c16bf5a8362dfcc4310e229cc.tar.gz
ports-47998cb69eb4026c16bf5a8362dfcc4310e229cc.zip
multimedia/cmrt: improve i386 fix to not break x32
Notes
Notes: svn path=/head/; revision=485566
Diffstat (limited to 'multimedia/cmrt')
-rw-r--r--multimedia/cmrt/files/patch-i38625
1 files changed, 19 insertions, 6 deletions
diff --git a/multimedia/cmrt/files/patch-i386 b/multimedia/cmrt/files/patch-i386
index b04474e9f775..6273e1380328 100644
--- a/multimedia/cmrt/files/patch-i386
+++ b/multimedia/cmrt/files/patch-i386
@@ -1,27 +1,40 @@
+Don't use compile-time constant to detect 32-bit registers:
+* GCC defines __ILP32__ only in -mx32 but Clang also in -m32
+* -mx32 uses 64-bit registers but doesn't define __LP64__
+
In file included from cm_device.cpp:31:
In file included from ./cm_device.h:37:
In file included from ./cm_array.h:31:
./cm_mem.h:200:17: error: invalid output size for constraint '=a'
:"=a"(local_rax), "=r"(local_rbx),
^
+https://github.com/intel/cmrt/issues/18
--- src/cm_mem.h.orig 2016-09-07 23:51:38 UTC
+++ src/cm_mem.h
-@@ -194,7 +194,9 @@ inline void GetCPUID(int CPUInfo[4], int InfoType)
+@@ -183,7 +182,7 @@ inline void GetCPUID(int CPUInfo[4], int InfoType)
+ __try {
+ #endif
+
+- if (sizeof(void *) == 4) {
++#ifdef __i386__
+ unsigned int local_eax, local_ebx, local_ecx, local_edx;
+ __asm__ __volatile__("pushl %%ebx \n\t" "cpuid \n\t" "movl %%ebx, %1 \n\t" "popl %%ebx \n\t" /* restore the old %ebx */
+ :"=a"(local_eax), "=r"(local_ebx),
+@@ -194,7 +193,7 @@ inline void GetCPUID(int CPUInfo[4], int InfoType)
CPUInfo[1] = local_ebx;
CPUInfo[2] = local_ecx;
CPUInfo[3] = local_edx;
- } else {
-+ }
-+#ifdef __LP64__
-+ else {
++#else
uint64_t local_rax, local_rbx, local_rcx, local_rdx;
__asm__ __volatile__("push %%rbx \n\t" "cpuid \n\t" "mov %%rbx, %1 \n\t" "pop %%rbx \n\t" /* restore the old %ebx */
:"=a"(local_rax), "=r"(local_rbx),
-@@ -206,6 +208,7 @@ inline void GetCPUID(int CPUInfo[4], int InfoType)
+@@ -205,7 +204,7 @@ inline void GetCPUID(int CPUInfo[4], int InfoType)
+ CPUInfo[1] = local_rbx;
CPUInfo[2] = local_rcx;
CPUInfo[3] = local_rdx;
- }
+- }
+#endif
#ifndef NO_EXCEPTION_HANDLING