Reviewers: plesner, Description: linux: Don't force-export V8 symbols unless v8 is built as a shared library.
That allows clients (chrome, o3d) to not have the symbols exported if v8 is built with -fvisibility=hidden, so that when the 2 are put together bad don't happen. See also http://code.google.com/p/chromium/issues/detail?id=17557 Please review this at http://codereview.chromium.org/160556 SVN Base: http://v8.googlecode.com/svn/branches/1.2/ Affected files: M SConstruct M include/v8-debug.h M include/v8.h Index: include/v8.h =================================================================== --- include/v8.h (revision 2507) +++ include/v8.h (working copy) @@ -86,10 +86,9 @@ #include <stdint.h> // Setup for Linux shared library export. There is no need to destinguish -// neither between building or using the V8 shared library nor between using -// the shared or static V8 library as there is on Windows. Therefore there is -// no checking of BUILDING_V8_SHARED and USING_V8_SHARED. -#if defined(__GNUC__) && (__GNUC__ >= 4) +// between building or using the V8 shared library, but we should not +// export symbols when we are building a static library. +#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED) #define V8EXPORT __attribute__ ((visibility("default"))) #define V8EXPORT_INLINE __attribute__ ((visibility("default"))) #else // defined(__GNUC__) && (__GNUC__ >= 4) Index: include/v8-debug.h =================================================================== --- include/v8-debug.h (revision 2507) +++ include/v8-debug.h (working copy) @@ -55,7 +55,7 @@ // Setup for Linux shared library export. See v8.h in this directory for // information on how to build/use V8 as shared library. -#if defined(__GNUC__) && (__GNUC__ >= 4) +#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(V8_SHARED) #define EXPORT __attribute__ ((visibility("default"))) #else // defined(__GNUC__) && (__GNUC__ >= 4) #define EXPORT Index: SConstruct =================================================================== --- SConstruct (revision 2507) +++ SConstruct (working copy) @@ -126,6 +126,7 @@ 'os:linux': { 'CCFLAGS': ['-ansi'] + GCC_EXTRA_CCFLAGS, 'library:shared': { + 'CPPDEFINES': ['V8_SHARED'], 'LIBS': ['pthread'] } }, --~--~---------~--~----~------------~-------~--~----~ v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev -~----------~----~----~----~------~----~------~--~---
