summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 21:40:26 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 21:40:26 +0000
commit7cd2afd1788641996735e7742aff93029bb112b9 (patch)
tree486e12c3c5bf635f97859c66675a58f17f576c1c
parentf8999644c114f91d4ea0eeea1d3edf8428a762c1 (diff)
downloadchromium_src-7cd2afd1788641996735e7742aff93029bb112b9.zip
chromium_src-7cd2afd1788641996735e7742aff93029bb112b9.tar.gz
chromium_src-7cd2afd1788641996735e7742aff93029bb112b9.tar.bz2
linux: add -fvisibility=hidden to build flags
We use this on OS X, so it shouldn't be harmful and it will fix a visibility issue that came up in http://groups.google.com/group/chromium-dev/browse_thread/thread/800bda968bdc8f29 BUG=17943 Review URL: http://codereview.chromium.org/332035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30253 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/common.gypi6
-rw-r--r--webkit/tools/npapi_layout_test_plugin/main.cpp26
2 files changed, 22 insertions, 10 deletions
diff --git a/build/common.gypi b/build/common.gypi
index b5e2279..da571a9 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -493,6 +493,7 @@
'<(werror)', # See note above about the werror variable.
'-pthread',
'-fno-exceptions',
+ '-fvisibility=hidden',
'-Wall',
'-D_FILE_OFFSET_BITS=64',
],
@@ -694,6 +695,11 @@
'cflags': [ '-gstabs' ],
'defines': ['USE_LINUX_BREAKPAD'],
}],
+ ['library=="shared_library"', {
+ # When building with shared libraries, remove the visiblity-hiding
+ # flag.
+ 'cflags!': [ '-fvisibility=hidden' ],
+ }],
],
},
}],
diff --git a/webkit/tools/npapi_layout_test_plugin/main.cpp b/webkit/tools/npapi_layout_test_plugin/main.cpp
index e24e203..032985f 100644
--- a/webkit/tools/npapi_layout_test_plugin/main.cpp
+++ b/webkit/tools/npapi_layout_test_plugin/main.cpp
@@ -43,6 +43,12 @@
#define NPAPI
#endif
+#if defined(__GNUC__) && __GNUC__ >= 4
+#define EXPORT __attribute__((visibility ("default")))
+#else
+#define EXPORT
+#endif
+
#if defined(OS_LINUX)
#include <X11/Xlib.h>
#endif
@@ -89,22 +95,22 @@ static void log(NPP instance, const char* format, ...)
// Plugin entry points
extern "C" {
- NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
+ EXPORT NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
#if defined(OS_LINUX)
, NPPluginFuncs *pluginFuncs
#endif
);
- NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
- void NPAPI NP_Shutdown(void);
+ EXPORT NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs);
+ EXPORT void NPAPI NP_Shutdown(void);
#if defined(OS_LINUX)
- NPError NP_GetValue(NPP instance, NPPVariable variable, void *value);
- const char* NP_GetMIMEDescription(void);
+ EXPORT NPError NPAPI NP_GetValue(NPP instance, NPPVariable variable, void *value);
+ EXPORT const char* NPAPI NP_GetMIMEDescription(void);
#endif
}
// Plugin entry points
-NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
+EXPORT NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
#if defined(OS_LINUX)
, NPPluginFuncs *pluginFuncs
#endif
@@ -118,7 +124,7 @@ NPError NPAPI NP_Initialize(NPNetscapeFuncs *browserFuncs
#endif
}
-NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
+EXPORT NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
{
pluginFuncs->version = 11;
pluginFuncs->size = sizeof(pluginFuncs);
@@ -139,7 +145,7 @@ NPError NPAPI NP_GetEntryPoints(NPPluginFuncs *pluginFuncs)
return NPERR_NO_ERROR;
}
-void NPAPI NP_Shutdown(void)
+EXPORT void NPAPI NP_Shutdown(void)
{
}
@@ -498,12 +504,12 @@ NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value)
}
#if defined(OS_LINUX)
-NPError NP_GetValue(NPP instance, NPPVariable variable, void *value)
+EXPORT NPError NPAPI NP_GetValue(NPP instance, NPPVariable variable, void *value)
{
return NPP_GetValue(instance, variable, value);
}
-const char* NP_GetMIMEDescription(void) {
+EXPORT const char* NPAPI NP_GetMIMEDescription(void) {
// The layout test LayoutTests/fast/js/navigator-mimeTypes-length.html
// asserts that the number of mimetypes handled by plugins should be
// greater than the number of plugins. This isn't true if we're