Don't build openmp with versioned symbols.

We ship these as a static library. Versioned symbols require that a
version script be passed at link time, which would require that flag
to be passed by every user of openmp. We can't reasonably ask every
NDK build system to do this, so just disable the symbol versioning.

Test: Build clang, build NDK with that Clang, build OpenCV with
      OpenMP support.
Bug: https://github.com/android-ndk/ndk/issues/401

Change-Id: I61b1edf23d8deee1d67b8ccf2aff9cf2f9ea4729
diff --git a/generate-headers.py b/generate-headers.py
old mode 100644
new mode 100755
index 07ffc1c..ebf7bd0
--- a/generate-headers.py
+++ b/generate-headers.py
@@ -43,7 +43,14 @@
         arch = 'i386'
     elif arch == 'arm64':
         arch = 'aarch64'
-    return ('cmake', THIS_DIR, '-DLIBOMP_ARCH=%s' % arch)
+    return (
+        'cmake',
+        THIS_DIR,
+        '-DLIBOMP_ARCH=%s' % arch,
+
+        # Can't use versioned symbols with static libraries.
+        '-DLIBOMP_USE_VERSION_SYMBOLS=OFF',
+    )
 
 
 # Run cmake configuration step for this particular arch
diff --git a/runtime/src/generated/arm/kmp_config.h b/runtime/src/generated/arm/kmp_config.h
index be684d8..da3c6ca 100644
--- a/runtime/src/generated/arm/kmp_config.h
+++ b/runtime/src/generated/arm/kmp_config.h
@@ -23,7 +23,7 @@
 #if ! LIBOMP_USE_ITT_NOTIFY
 # define INTEL_NO_ITTNOTIFY_API
 #endif
-#define LIBOMP_USE_VERSION_SYMBOLS 1
+#define LIBOMP_USE_VERSION_SYMBOLS 0
 #if LIBOMP_USE_VERSION_SYMBOLS
 # define KMP_USE_VERSION_SYMBOLS
 #endif
diff --git a/runtime/src/generated/arm64/kmp_config.h b/runtime/src/generated/arm64/kmp_config.h
index c5a8397..f881d86 100644
--- a/runtime/src/generated/arm64/kmp_config.h
+++ b/runtime/src/generated/arm64/kmp_config.h
@@ -23,7 +23,7 @@
 #if ! LIBOMP_USE_ITT_NOTIFY
 # define INTEL_NO_ITTNOTIFY_API
 #endif
-#define LIBOMP_USE_VERSION_SYMBOLS 1
+#define LIBOMP_USE_VERSION_SYMBOLS 0
 #if LIBOMP_USE_VERSION_SYMBOLS
 # define KMP_USE_VERSION_SYMBOLS
 #endif
diff --git a/runtime/src/generated/kmp_i18n_default.inc b/runtime/src/generated/kmp_i18n_default.inc
index ba4d3d7..632a77d 100644
--- a/runtime/src/generated/kmp_i18n_default.inc
+++ b/runtime/src/generated/kmp_i18n_default.inc
@@ -1,5 +1,5 @@
 // Do not edit this file! //
-// The file was generated from en_US.txt by message-converter.pl on Wed May  3 18:04:38 2017. //
+// The file was generated from en_US.txt by message-converter.pl on Tue May 30 13:57:29 2017. //
 
 static char const *
 __kmp_i18n_default_meta[] =
diff --git a/runtime/src/generated/kmp_i18n_id.inc b/runtime/src/generated/kmp_i18n_id.inc
index bae30f8..a869524 100644
--- a/runtime/src/generated/kmp_i18n_id.inc
+++ b/runtime/src/generated/kmp_i18n_id.inc
@@ -1,5 +1,5 @@
 // Do not edit this file! //
-// The file was generated from en_US.txt by message-converter.pl on Wed May  3 18:04:38 2017. //
+// The file was generated from en_US.txt by message-converter.pl on Tue May 30 13:57:29 2017. //
 
 enum kmp_i18n_id {
 
diff --git a/runtime/src/generated/mips/kmp_config.h b/runtime/src/generated/mips/kmp_config.h
index 56a183b..3038f97 100644
--- a/runtime/src/generated/mips/kmp_config.h
+++ b/runtime/src/generated/mips/kmp_config.h
@@ -23,7 +23,7 @@
 #if ! LIBOMP_USE_ITT_NOTIFY
 # define INTEL_NO_ITTNOTIFY_API
 #endif
-#define LIBOMP_USE_VERSION_SYMBOLS 1
+#define LIBOMP_USE_VERSION_SYMBOLS 0
 #if LIBOMP_USE_VERSION_SYMBOLS
 # define KMP_USE_VERSION_SYMBOLS
 #endif
diff --git a/runtime/src/generated/mips64/kmp_config.h b/runtime/src/generated/mips64/kmp_config.h
index 1f9e9df..51343ac 100644
--- a/runtime/src/generated/mips64/kmp_config.h
+++ b/runtime/src/generated/mips64/kmp_config.h
@@ -23,7 +23,7 @@
 #if ! LIBOMP_USE_ITT_NOTIFY
 # define INTEL_NO_ITTNOTIFY_API
 #endif
-#define LIBOMP_USE_VERSION_SYMBOLS 1
+#define LIBOMP_USE_VERSION_SYMBOLS 0
 #if LIBOMP_USE_VERSION_SYMBOLS
 # define KMP_USE_VERSION_SYMBOLS
 #endif
diff --git a/runtime/src/generated/x86/kmp_config.h b/runtime/src/generated/x86/kmp_config.h
index 5888421..2bc7d43 100644
--- a/runtime/src/generated/x86/kmp_config.h
+++ b/runtime/src/generated/x86/kmp_config.h
@@ -23,7 +23,7 @@
 #if ! LIBOMP_USE_ITT_NOTIFY
 # define INTEL_NO_ITTNOTIFY_API
 #endif
-#define LIBOMP_USE_VERSION_SYMBOLS 1
+#define LIBOMP_USE_VERSION_SYMBOLS 0
 #if LIBOMP_USE_VERSION_SYMBOLS
 # define KMP_USE_VERSION_SYMBOLS
 #endif
diff --git a/runtime/src/generated/x86_64/kmp_config.h b/runtime/src/generated/x86_64/kmp_config.h
index 4636534..d404dd3 100644
--- a/runtime/src/generated/x86_64/kmp_config.h
+++ b/runtime/src/generated/x86_64/kmp_config.h
@@ -23,7 +23,7 @@
 #if ! LIBOMP_USE_ITT_NOTIFY
 # define INTEL_NO_ITTNOTIFY_API
 #endif
-#define LIBOMP_USE_VERSION_SYMBOLS 1
+#define LIBOMP_USE_VERSION_SYMBOLS 0
 #if LIBOMP_USE_VERSION_SYMBOLS
 # define KMP_USE_VERSION_SYMBOLS
 #endif