Browse code

Don't warn on x86_64 vs i386 mismatches (bb #2214).

With -m32 LLVM gets the target arch right, and configure gets it wrong.
LLVM's detection always overrides the arch, so don't warn on these mismatches.

startup.cbc will get the correct arch when JIT is available, which is the only
case where the arch matters anyway.
When there is no JIT the arch reported to startup.cbc will be configure's which might be wrong.
But since there is no JIT startup.cbc shouldn't need to check the arch anyway.
It will still be able to detect sparc vs x86 though, not 32 vs 64-bit.

Török Edvin authored on 2010/08/18 17:01:33
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Aug 18 11:01:10 EEST 2010 (edwin)
2
+-------------------------------------
3
+ * libclamav/c++/detect.cpp: don't warn on x86_64 vs i386 mismatches (bb #2214).
4
+
1 5
 Tue Aug 17 13:10:00 CEST 2010 (tk)
2 6
 ----------------------------------
3 7
  * sigtool/sigtool.c: fix EOL matching in --find-sigs (bb#2164)
... ...
@@ -101,8 +101,14 @@ void cli_detect_env_jit(struct cli_environment *env)
101 101
 	case Triple::x86_64:
102 102
 	    earch = arch_x86_64;
103 103
 	    if (env->arch != earch) {
104
-		/* bb #2153 */
105
-		if (env->os_category != os_darwin || env->arch != arch_i386)
104
+		/* bb #2153, bb #2214 */
105
+		/* configure can't detect -m32, so it thinks we are x86_64, when
106
+		 * in fact we are i386 only.
107
+		 * LLVM correctly detects which one it is using preprocessor
108
+		 * macros, so don't warn here, startup.cbc will just have to
109
+		 * rely on the LLVM provided info, and not the configure
110
+		 * provided one! */
111
+		if (env->arch != arch_i386)
106 112
 		    conflicts = true;
107 113
 	    }
108 114
 	    break;