summaryrefslogtreecommitdiffstats
path: root/a85c798f91bfef796116f3ebf5e5e7e479c8683f.patch
blob: 4956dbae4af54e03edf0dac37b439c1bfcc205c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From a85c798f91bfef796116f3ebf5e5e7e479c8683f Mon Sep 17 00:00:00 2001
From: Magnus Edenhill <magnus@edenhill.se>
Date: Thu, 29 Jun 2017 10:35:23 +0200
Subject: [PATCH] configure crc32 for x32: try to avoid dead-code removal

---
 configure.librdkafka | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/configure.librdkafka b/configure.librdkafka
index 903b0276..923dd48f 100644
--- a/configure.librdkafka
+++ b/configure.librdkafka
@@ -86,11 +86,13 @@ function checks {
     mkl_compile_check crc32chw WITH_CRC32C_HW disable CC "" \
                       "
 #include <inttypes.h>
+#include <stdio.h>
 #define LONGx1 \"8192\"
 #define LONGx2 \"16384\"
 void foo (void) {
    const char *n = \"abcdefghijklmnopqrstuvwxyz0123456789\";
    uint64_t c0 = 0, c1 = 1, c2 = 2;
+   uint64_t s;
    uint32_t eax = 1, ecx;
    __asm__(\"cpuid\"
            : \"=c\"(ecx)
@@ -104,6 +106,8 @@ void foo (void) {
            \"crc32q\t\" LONGx2 \"(%3), %2\"
            : \"=r\"(c0), \"=r\"(c1), \"=r\"(c2)
            : \"r\"(n), \"0\"(c0), \"1\"(c1), \"2\"(c2));
+  s = c0 + c1 + c2;
+  printf(\"avoiding unused code removal by printing %d, %d, %d\n\", (int)s, (int)eax, (int)ecx);
 }
 "