From 097006b1466854fbd80af8d85a729d85ec52b163 Mon Sep 17 00:00:00 2001
From: Alexandre Julliard <julliard@winehq.org>
Date: Mon, 16 Nov 2015 23:30:10 +0900
Subject: [PATCH] winegcc: Disable setting image base address on Android.

The Android linker doesn't handle this correctly.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
 tools/winegcc/utils.h   | 7 ++++++-
 tools/winegcc/winegcc.c | 7 +++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/winegcc/utils.h b/tools/winegcc/utils.h
index 789b4ea973f..536fb2d2f97 100644
--- a/tools/winegcc/utils.h
+++ b/tools/winegcc/utils.h
@@ -42,7 +42,12 @@ enum target_cpu
 
 enum target_platform
 {
-    PLATFORM_UNSPECIFIED, PLATFORM_APPLE, PLATFORM_SOLARIS, PLATFORM_WINDOWS, PLATFORM_CYGWIN
+    PLATFORM_UNSPECIFIED,
+    PLATFORM_APPLE,
+    PLATFORM_ANDROID,
+    PLATFORM_SOLARIS,
+    PLATFORM_WINDOWS,
+    PLATFORM_CYGWIN
 };
 
 void error(const char* s, ...) DECLSPEC_NORETURN;
diff --git a/tools/winegcc/winegcc.c b/tools/winegcc/winegcc.c
index ee5ac6befbf..c07243b620a 100644
--- a/tools/winegcc/winegcc.c
+++ b/tools/winegcc/winegcc.c
@@ -171,6 +171,7 @@ static const struct
 {
     { "macos",   PLATFORM_APPLE },
     { "darwin",  PLATFORM_APPLE },
+    { "android", PLATFORM_ANDROID },
     { "solaris", PLATFORM_SOLARIS },
     { "cygwin",  PLATFORM_CYGWIN },
     { "mingw32", PLATFORM_WINDOWS },
@@ -229,6 +230,8 @@ static const enum target_cpu build_cpu = CPU_ARM64;
 
 #ifdef __APPLE__
 static enum target_platform build_platform = PLATFORM_APPLE;
+#elif defined(__ANDROID__)
+static enum target_platform build_platform = PLATFORM_ANDROID;
 #elif defined(__sun)
 static enum target_platform build_platform = PLATFORM_SOLARIS;
 #elif defined(__CYGWIN__)
@@ -384,6 +387,7 @@ static const strarray* get_lddllflags( const struct options *opts, const strarra
         }
         break;
 
+    case PLATFORM_ANDROID:
     case PLATFORM_SOLARIS:
     case PLATFORM_UNSPECIFIED:
         strarray_add( flags, "-shared" );
@@ -1121,6 +1125,9 @@ static void build(struct options* opts)
             strarray_add(tmp_files, mapfile);
         }
         break;
+    case PLATFORM_ANDROID:
+        /* not supported on Android */
+        break;
     default:
         if (opts->image_base)
         {
-- 
GitLab