Fix symbol visibility for preemption.

Entry functions need to have default visibility instead of protected
visibility to allow symbol preemption during linking (i.e. when not
using dlsym() to explicitly obtain pointers to entry functions). See:
https://bugs.llvm.org//show_bug.cgi?id=30960

Bug swiftshader:64

Change-Id: Ia2d3ae8fb4faec9a75d811c643e3164bfb7d0423
Reviewed-on: https://swiftshader-review.googlesource.com/10028
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
Tested-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libEGL/BUILD.gn b/src/OpenGL/libEGL/BUILD.gn
index dd16e82..979fd23 100644
--- a/src/OpenGL/libEGL/BUILD.gn
+++ b/src/OpenGL/libEGL/BUILD.gn
@@ -35,13 +35,10 @@
       cflags += [ "-Wno-unused-but-set-variable" ]
     }
 
-    defines += [ "LOG_TAG=\"swiftshader_libEGL\"" ]
-
-    if (is_linux) {
-      defines += [ "EGLAPI=__attribute__((visibility(\"protected\")))" ]
-    } else {
-      defines += [ "EGLAPI=__attribute__((visibility(\"default\")))" ]
-    }
+    defines += [
+      "LOG_TAG=\"swiftshader_libEGL\"",
+      "EGLAPI=__attribute__((visibility(\"default\")))",
+    ]
   }
 }
 
diff --git a/src/OpenGL/libGLESv2/BUILD.gn b/src/OpenGL/libGLESv2/BUILD.gn
index 3762324..1cdb672 100644
--- a/src/OpenGL/libGLESv2/BUILD.gn
+++ b/src/OpenGL/libGLESv2/BUILD.gn
@@ -49,13 +49,8 @@
       "LOG_TAG=\"swiftshader_libGLESv2\"",
       "__STDC_CONSTANT_MACROS",
       "__STDC_LIMIT_MACROS",
+      "GL_APICALL=__attribute__((visibility(\"default\")))",
     ]
-
-    if (is_linux) {
-      defines += [ "GL_APICALL=__attribute__((visibility(\"protected\")))" ]
-    } else {
-      defines += [ "GL_APICALL=__attribute__((visibility(\"default\")))" ]
-    }
   }
 }