Occurs when compiling opencv3.4.10
/opencv-2.4.10/modules/core/src/system.cpp:280:10: Error: Operand constraint inconsistent in ' ASM '
In the global domain:
Cc1plus: Warning: Unrecognized command line option "-wno-unnamed-type-template-args" [Default enabled]
Cc1plus: Warning: Unrecognized command line option "-wno-delete-non-virtual-dtor" [Default enabled]
Cc1plus: Warning: Unrecognized command line option "-wno-narrowing" [Default enabled]
MAKE[2]: * * * [MODULES/CORE/CMAKEFILES/OPENCV_CORE.DIR/SRC/SYSTEM.CPP.O] Error 1
MAKE[1]: * * * [Modules/core/cmakefiles/opencv_core.dir/all] Error 2
Make: * * * [ALL] Error 2
Workaround: Go to the following directory to modify
Modules/core/src/system.cpp
|
@@ -267,14 +267,17 @@ -267,14 hwfeatures |
|
|
: "CC" |
|
|
); |
|
|
#else |
|
|
+//We need to preserve ebx since we are compiling PIC code. |
|
|
+//This means we cannot use ' =b ' for the 2nd output register. |
|
|
ASM volatile |
|
|
( |
|
|
"Pushl%%ebx\n\t" |
|
|
"Movl $7,%%eax\n\t" |
|
|
"Movl $0,%%ecx\n\t" |
275 |
|
"Cpuid\n\t" |
|
|
+ "Movl%%ebx,%1\n\t" |
276 |
|
"Popl%%ebx\n\t" |
277 |
|
-: "=a" (Cpuid_data[0]), "=b" (cpuid_data[1), "=c" (cpuid_data[2)), "=d" (cpuid_data[3)) |
|
|
+: "=a" (Cpuid_data[0]), "=r" (cpuid_data[1), "=c" (cpuid_data[2)), "=d" (cpuid_data[3) |
|
|
: |
|
|
: "CC" |
|
|
); |
|
Modules/core/src/system.cpp