Bug 1001320. Part 5: Use #pragma GCC visibility on B2G. r=glandium
☠☠ backed out by 8da004bc9a6d ☠ ☠
authorRobert O'Callahan <robert@ocallahan.org>
Sun, 11 May 2014 23:37:14 -0700
changeset 183859 8433a3609a541d08e22450839533216af97a676b
parent 183858 3604a71625156dc9c68d5fb00c90dd585f213b19
child 183860 be0dd45203f6d8250652588523141bfb137972cb
push id43703
push userrocallahan@mozilla.com
push dateTue, 20 May 2014 11:22:47 +0000
treeherdermozilla-inbound@8433a3609a54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1001320
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1001320. Part 5: Use #pragma GCC visibility on B2G. r=glandium
config/gcc_hidden_dso_handle.h
config/system-headers
configure.in
dom/system/gonk/android_audio/AudioSystem.h
js/src/configure.in
widget/gonk/GonkPermission.cpp
widget/gonk/nativewindow/GonkNativeWindowClientJB.h
widget/gonk/nativewindow/GonkNativeWindowClientKK.h
widget/gonk/nativewindow/IGonkGraphicBufferConsumer.h
copy from config/gcc_hidden.h
copy to config/gcc_hidden_dso_handle.h
--- a/config/gcc_hidden.h
+++ b/config/gcc_hidden_dso_handle.h
@@ -1,6 +1,11 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+#ifdef __cplusplus
+extern "C"
+#endif
+void *__dso_handle;
+
 /* Begin all files as hidden visibility */
 #pragma GCC visibility push(hidden)
--- a/config/system-headers
+++ b/config/system-headers
@@ -402,19 +402,16 @@ dl.h
 docobj.h
 dos/dosextens.h
 dos.h
 Drag.h
 DriverServices.h
 DriverSynchronization.h
 DropInPanel.h
 dvidef.h
-#ifdef ANDROID
-EffectApi.h
-#endif
 elf.h
 endian.h
 Entry.h
 errno.h
 Errors.h
 Events.h
 exdisp.h
 ExDisp.h
@@ -511,16 +508,18 @@ gssapi/gssapi_generic.h
 gssapi/gssapi.h
 gssapi.h
 gtk/gtk.h
 gtk/gtkx.h
 gtk/gtkprinter.h
 gtk/gtkprintjob.h
 gtk/gtkprintunixdialog.h
 #ifdef ANDROID
+gui/BufferQueue.h
+gui/ConsumerBase.h
 gui/GraphicBufferAlloc.h
 gui/IConsumerListener.h
 gui/IGraphicBufferAlloc.h
 gui/IGraphicBufferProducer.h
 gui/ISurfaceComposer.h
 gui/ISurfaceComposerClient.h
 gui/ISurfaceTexture.h
 gui/Surface.h
@@ -537,24 +536,16 @@ hardware_legacy/uevent.h
 hardware_legacy/vibrator.h
 #endif
 HIToolbox/HIToolbox.h
 hlink.h
 #ifdef ANDROID
 HTTPBase.h
 #endif
 ia64/sys/inline.h
-#ifdef ANDROID
-IAudioFlingerClient.h
-IAudioFlinger.h
-IAudioRecord.h
-IAudioTrack.h
-IEffect.h
-IEffectClient.h
-#endif
 Icons.h
 iconv.h
 ieeefp.h
 ifaddrs.h
 image.h
 imagehlp.h
 imm.h
 initguid.h
@@ -906,16 +897,17 @@ rld_interface.h
 rmsdef.h
 Roster.h
 rpc.h
 rpcproxy.h
 rpc/types.h
 sane/sane.h
 sane/sanei.h
 sane/saneopts.h
+sched.h
 Scrap.h
 Screen.h
 Script.h
 ScrollBar.h
 sec.h
 secrng.h
 security.h
 secutil.h
--- a/configure.in
+++ b/configure.in
@@ -2545,27 +2545,29 @@ MOZ_CXX11
 AC_LANG_C
 
 dnl Check for .hidden assembler directive and visibility attribute.
 dnl Borrowed from glibc configure.in
 dnl ===============================================================
 if test "$GNU_CC" -a "$OS_TARGET" != WINNT; then
   AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
   AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
-  if test -n "$gonkdir"; then
-    visibility_target=Gonk
-  else
-    visibility_target=$OS_TARGET
-  fi
-  case "$visibility_target" in
-  Darwin|Gonk)
+  case "$OS_TARGET" in
+  Darwin)
     VISIBILITY_FLAGS='-fvisibility=hidden'
     ;;
   *)
-    VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+    case $GCC_VERSION in
+    4.4*)
+      VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden_dso_handle.h'
+      ;;
+    *)
+      VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+      ;;
+    esac
     WRAP_SYSTEM_INCLUDES=1
     ;;
   esac
 fi         # GNU_CC
 
 # visibility hidden flag for Sun Studio on Solaris
 if test "$SOLARIS_SUNPRO_CC"; then
 VISIBILITY_FLAGS='-xldscope=hidden'
--- a/dom/system/gonk/android_audio/AudioSystem.h
+++ b/dom/system/gonk/android_audio/AudioSystem.h
@@ -12,16 +12,18 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 #ifndef ANDROID_AUDIOSYSTEM_H_
 #define ANDROID_AUDIOSYSTEM_H_
 
+#pragma GCC visibility push(default)
+
 #include <utils/RefBase.h>
 #include <utils/threads.h>
 #include "IAudioFlinger.h"
 
 #ifndef VANILLA_ANDROID
 /* request to open a direct output with get_output() (by opposition to
  * sharing an output with other AudioTracks)
  */
@@ -956,9 +958,11 @@ public:
 
 private:
     String8 mKeyValuePairs;
     KeyedVector <String8, String8> mParameters;
 };
 
 };  // namespace android
 
+#pragma GCC visibility pop
+
 #endif  /*ANDROID_AUDIOSYSTEM_H_*/
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -2078,27 +2078,29 @@ AC_LANG_CPLUSPLUS
 MOZ_CXX11
 
 dnl Check for .hidden assembler directive and visibility attribute.
 dnl Borrowed from glibc configure.in
 dnl ===============================================================
 if test "$GNU_CC" -a "$OS_TARGET" != WINNT; then
   AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
   AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
-  if test -n "$gonkdir"; then
-    visibility_target=Gonk
-  else
-    visibility_target=$OS_TARGET
-  fi
-  case "$visibility_target" in
-  Darwin|Gonk)
+  case "$OS_TARGET" in
+  Darwin)
     VISIBILITY_FLAGS='-fvisibility=hidden'
     ;;
   *)
-    VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+    case $GCC_VERSION in
+    4.4*)
+      VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden_dso_handle.h'
+      ;;
+    *)
+      VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+      ;;
+    esac
     WRAP_SYSTEM_INCLUDES=1
     ;;
   esac
 fi         # GNU_CC
 
 # visibility hidden flag for Sun Studio on Solaris
 if test "$SOLARIS_SUNPRO_CC"; then
 VISIBILITY_FLAGS='-xldscope=hidden'
--- a/widget/gonk/GonkPermission.cpp
+++ b/widget/gonk/GonkPermission.cpp
@@ -9,16 +9,17 @@
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
+#include <utils/Unicode.h>
 #include <binder/IPCThreadState.h>
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>
 #include <binder/IPermissionController.h>
 #include <private/android_filesystem_config.h>
 #include "GonkPermission.h"
 
 #include "mozilla/dom/ContentParent.h"
--- a/widget/gonk/nativewindow/GonkNativeWindowClientJB.h
+++ b/widget/gonk/nativewindow/GonkNativeWindowClientJB.h
@@ -26,19 +26,20 @@
 
 #include <ui/ANativeObjectBase.h>
 #include <ui/Region.h>
 
 #include <utils/RefBase.h>
 #include <utils/threads.h>
 #include <utils/KeyedVector.h>
 
+#include "mozilla/Types.h"
 #include "GonkBufferQueue.h"
 
-struct ANativeWindow_Buffer;
+struct MOZ_EXPORT ANativeWindow_Buffer;
 
 namespace android {
 
 /*
  * An implementation of ANativeWindow that feeds graphics buffers into a
  * BufferQueue.
  *
  * This is typically used by programs that want to render frames through
--- a/widget/gonk/nativewindow/GonkNativeWindowClientKK.h
+++ b/widget/gonk/nativewindow/GonkNativeWindowClientKK.h
@@ -22,19 +22,20 @@
 
 #include <ui/ANativeObjectBase.h>
 #include <ui/Region.h>
 
 #include <utils/RefBase.h>
 #include <utils/threads.h>
 #include <utils/KeyedVector.h>
 
+#include "mozilla/Types.h"
 #include "GonkBufferQueue.h"
 
-struct ANativeWindow_Buffer;
+struct MOZ_EXPORT ANativeWindow_Buffer;
 
 namespace android {
 
 /*
  * An implementation of ANativeWindow that feeds graphics buffers into a
  * BufferQueue.
  *
  * This is typically used by programs that want to render frames through
--- a/widget/gonk/nativewindow/IGonkGraphicBufferConsumer.h
+++ b/widget/gonk/nativewindow/IGonkGraphicBufferConsumer.h
@@ -22,31 +22,32 @@
 
 #include <utils/Errors.h>
 #include <utils/RefBase.h>
 #include <utils/Timers.h>
 
 #include <binder/IInterface.h>
 #include <ui/Rect.h>
 
+#include "mozilla/Types.h"
 #include "mozilla/layers/LayersSurfaces.h"
 
 namespace mozilla {
 
 namespace layers {
 class TextureClient;
 }
 }
 
 namespace android {
 // ----------------------------------------------------------------------------
 
-class IConsumerListener;
-class GraphicBuffer;
-class Fence;
+class MOZ_EXPORT IConsumerListener;
+class MOZ_EXPORT GraphicBuffer;
+class MOZ_EXPORT Fence;
 
 class IGonkGraphicBufferConsumer : public IInterface {
     typedef mozilla::layers::TextureClient TextureClient;
 public:
 
     // public facing structure for BufferSlot
     class BufferItem : public Flattenable<BufferItem> {
         friend class Flattenable<BufferItem>;