From d7596bb7d004c187f40e021530b829539d404da1 Mon Sep 17 00:00:00 2001
From: Benedikt Schroeder <benedikt.schroeder@outlook.de>
Date: Thu, 17 Oct 2019 10:36:27 +0200
Subject: [PATCH 1/4] Use a version script for Linux builds to hide third party
 library exports.

---
 cake/BuildExternals.cake                          | 2 +-
 native-builds/libSkiaSharp_linux/libSkiaSharp.map | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)
 create mode 100644 native-builds/libSkiaSharp_linux/libSkiaSharp.map

diff --git a/cake/BuildExternals.cake b/cake/BuildExternals.cake
index 112327e3e5..6855bb94df 100644
--- a/cake/BuildExternals.cake
+++ b/cake/BuildExternals.cake
@@ -596,7 +596,7 @@ Task ("externals-linux")
             $"skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false " +
             $"skia_enable_gpu={(SUPPORT_GPU ? "true" : "false")} " +
             $"extra_cflags=[ '-DSKIA_C_DLL' ] " +
-            $"extra_ldflags=[ '-static-libstdc++', '-static-libgcc' ] " +
+            $"extra_ldflags=[ '-static-libstdc++', '-static-libgcc', '-Wl,--version-script={ROOT_PATH.CombineWithFilePath("native-builds/libHarfBuzzSharp_linux/libSkiaSharp.map")}' ] " +
             $"{CUSTOM_COMPILERS} " +
             $"linux_soname_version='{soname}'");
 
diff --git a/native-builds/libSkiaSharp_linux/libSkiaSharp.map b/native-builds/libSkiaSharp_linux/libSkiaSharp.map
new file mode 100644
index 0000000000..b69ea8a9cc
--- /dev/null
+++ b/native-builds/libSkiaSharp_linux/libSkiaSharp.map
@@ -0,0 +1,7 @@
+libSkiaSharp {
+    global:
+	        sk_*;
+			gr_*;
+	local:
+	        *;
+}
\ No newline at end of file

From 2eae7488e44e6c447b9f93d6744ab6d41c510f8b Mon Sep 17 00:00:00 2001
From: Benedikt Stebner <Gillibald@users.noreply.github.com>
Date: Thu, 17 Oct 2019 10:55:34 +0200
Subject: [PATCH 2/4] Update cake/BuildExternals.cake

Co-Authored-By: Matthew Leibowitz <mattleibow@live.com>
---
 cake/BuildExternals.cake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cake/BuildExternals.cake b/cake/BuildExternals.cake
index 6855bb94df..d83a6db1f1 100644
--- a/cake/BuildExternals.cake
+++ b/cake/BuildExternals.cake
@@ -596,7 +596,7 @@ Task ("externals-linux")
             $"skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false " +
             $"skia_enable_gpu={(SUPPORT_GPU ? "true" : "false")} " +
             $"extra_cflags=[ '-DSKIA_C_DLL' ] " +
-            $"extra_ldflags=[ '-static-libstdc++', '-static-libgcc', '-Wl,--version-script={ROOT_PATH.CombineWithFilePath("native-builds/libHarfBuzzSharp_linux/libSkiaSharp.map")}' ] " +
+            $"extra_ldflags=[ '-static-libstdc++', '-static-libgcc', '-Wl,--version-script={ROOT_PATH.CombineWithFilePath("native-builds/libSkiaSharp_linux/libSkiaSharp.map")}' ] " +
             $"{CUSTOM_COMPILERS} " +
             $"linux_soname_version='{soname}'");
 

From 79a3a9916622ca4f002d175e078fbfacd31694f7 Mon Sep 17 00:00:00 2001
From: Matthew Leibowitz <mattleibow@live.com>
Date: Thu, 17 Oct 2019 11:51:02 +0200
Subject: [PATCH 3/4] Added missing semicolon

---
 native-builds/libSkiaSharp_linux/libSkiaSharp.map | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/native-builds/libSkiaSharp_linux/libSkiaSharp.map b/native-builds/libSkiaSharp_linux/libSkiaSharp.map
index b69ea8a9cc..6ba09483f0 100644
--- a/native-builds/libSkiaSharp_linux/libSkiaSharp.map
+++ b/native-builds/libSkiaSharp_linux/libSkiaSharp.map
@@ -1,7 +1,7 @@
 libSkiaSharp {
-    global:
-	        sk_*;
-			gr_*;
-	local:
-	        *;
-}
\ No newline at end of file
+        global:
+                sk_*;
+                gr_*;
+        local:
+                *;
+};

From 41d0b0fb98d9a8542d6b793df1b1fc9d8206761e Mon Sep 17 00:00:00 2001
From: Matthew Leibowitz <mattleibow@live.com>
Date: Thu, 17 Oct 2019 11:52:21 +0200
Subject: [PATCH 4/4] Update libSkiaSharp.map

---
 native-builds/libSkiaSharp_linux/libSkiaSharp.map | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/native-builds/libSkiaSharp_linux/libSkiaSharp.map b/native-builds/libSkiaSharp_linux/libSkiaSharp.map
index 6ba09483f0..23928a4370 100644
--- a/native-builds/libSkiaSharp_linux/libSkiaSharp.map
+++ b/native-builds/libSkiaSharp_linux/libSkiaSharp.map
@@ -1,7 +1,7 @@
 libSkiaSharp {
-        global:
-                sk_*;
-                gr_*;
-        local:
-                *;
+    global:
+        sk_*;
+        gr_*;
+    local:
+        *;
 };