[llvm] r342549 - [benchmark] Cherrypick fix for MinGW/ARM from upstream

Martin Storsjo via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 19 07:30:46 PDT 2018


Author: mstorsjo
Date: Wed Sep 19 07:30:45 2018
New Revision: 342549

URL: http://llvm.org/viewvc/llvm-project?rev=342549&view=rev
Log:
[benchmark] Cherrypick fix for MinGW/ARM from upstream

This fixes building for Windows on ARM, with MinGW headers.
(Building for Windows on ARM with Windows SDK still is unsupported
by the benchmark library.)

Differential Revision: https://reviews.llvm.org/D52262

Modified:
    llvm/trunk/utils/benchmark/README.LLVM
    llvm/trunk/utils/benchmark/src/cycleclock.h
    llvm/trunk/utils/benchmark/src/internal_macros.h

Modified: llvm/trunk/utils/benchmark/README.LLVM
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/benchmark/README.LLVM?rev=342549&r1=342548&r2=342549&view=diff
==============================================================================
--- llvm/trunk/utils/benchmark/README.LLVM (original)
+++ llvm/trunk/utils/benchmark/README.LLVM Wed Sep 19 07:30:45 2018
@@ -17,3 +17,5 @@ Changes:
   is applied to fix 32-bit build failure on macOS
 * https://github.com/google/benchmark/commit/52613079824ac58d06c070aa9fbbb186a5859e2c
   is applied to fix cross compilation with MinGW headers
+* https://github.com/google/benchmark/commit/439d6b1c2a6da5cb6adc4c4dfc555af235722396
+  is applied to fix building with MinGW headers for ARM

Modified: llvm/trunk/utils/benchmark/src/cycleclock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/benchmark/src/cycleclock.h?rev=342549&r1=342548&r2=342549&view=diff
==============================================================================
--- llvm/trunk/utils/benchmark/src/cycleclock.h (original)
+++ llvm/trunk/utils/benchmark/src/cycleclock.h Wed Sep 19 07:30:45 2018
@@ -41,7 +41,7 @@ extern "C" uint64_t __rdtsc();
 #pragma intrinsic(__rdtsc)
 #endif
 
-#ifndef BENCHMARK_OS_WINDOWS
+#if !defined(BENCHMARK_OS_WINDOWS) || defined(BENCHMARK_OS_MINGW)
 #include <sys/time.h>
 #include <time.h>
 #endif

Modified: llvm/trunk/utils/benchmark/src/internal_macros.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/benchmark/src/internal_macros.h?rev=342549&r1=342548&r2=342549&view=diff
==============================================================================
--- llvm/trunk/utils/benchmark/src/internal_macros.h (original)
+++ llvm/trunk/utils/benchmark/src/internal_macros.h Wed Sep 19 07:30:45 2018
@@ -35,6 +35,9 @@
   #define BENCHMARK_OS_CYGWIN 1
 #elif defined(_WIN32)
   #define BENCHMARK_OS_WINDOWS 1
+  #if defined(__MINGW32__)
+    #define BENCHMARK_OS_MINGW 1
+  #endif
 #elif defined(__APPLE__)
   #define BENCHMARK_OS_APPLE 1
   #include "TargetConditionals.h"




More information about the llvm-commits mailing list