Changeset 226266 in webkit
- Timestamp:
- Dec 22, 2017 9:18:43 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 18 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/CMakeLists.txt
r225168 r226266 122 122 # Default library types 123 123 # ----------------------------------------------------------------------------- 124 option(SHARED_CORE "build WebCore as a shared library") 125 126 if (SHARED_CORE) 127 set(WebCore_LIBRARY_TYPE SHARED) 128 else () 129 set(WebCore_LIBRARY_TYPE STATIC) 130 endif () 131 124 # By default, only the highest-level libraries, WebKitLegacy and WebKit, are 125 # shared, because properly building shared libraries that depend on each other 126 # can be tricky. Override these in Options*.cmake for your port as needed. 132 127 set(WTF_LIBRARY_TYPE STATIC) 133 set(JavaScriptCore_LIBRARY_TYPE S HARED)128 set(JavaScriptCore_LIBRARY_TYPE STATIC) 134 129 set(PAL_LIBRARY_TYPE STATIC) 130 set(WebCore_LIBRARY_TYPE STATIC) 135 131 set(WebKitLegacy_LIBRARY_TYPE SHARED) 136 132 set(WebKit_LIBRARY_TYPE SHARED) -
trunk/ChangeLog
r226212 r226266 1 2017-12-22 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds 4 https://bugs.webkit.org/show_bug.cgi?id=179914 5 6 Reviewed by Carlos Garcia Campos. 7 8 * CMakeLists.txt: 9 * Source/cmake/OptionsGTK.cmake: 10 * Source/cmake/OptionsJSCOnly.cmake: 11 * Source/cmake/OptionsMac.cmake: 12 * Source/cmake/OptionsWPE.cmake: 13 * Source/cmake/OptionsWin.cmake: 14 * Source/cmake/WebKitCompilerFlags.cmake: 15 * Source/cmake/wpesymbols.filter: Removed. 16 17 2017-12-22 Michael Catanzaro <mcatanzaro@igalia.com> 18 19 [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds 20 https://bugs.webkit.org/show_bug.cgi?id=179914 21 22 Reviewed by Carlos Garcia Campos. 23 24 Let's build JSC as a static library, and link that static lib to *both* our shared 25 libjavascriptcoregtk and libwebkit2gtk. Then we can fix this and also filter out all the 26 private symbols that we're currently exposing in libjavascriptcoregtk, which wouldn't be 27 possible otherwise. The cost of this is disk space. I think this trade-off is reasonable, 28 because it's the best way I could think of that accomplishes all our goals: (a) install two 29 shared libs, (b) export only public API symbols, (c) does not require any linker hacks. 30 31 Additionally, build with -fvisibility=hidden so that the compiler knows that many symbols 32 will be stripped out. This should improve code generation. It's actually how WPE was 33 previously compiled, but I removed this when I added the version script for WPE, because I 34 thought it was redundant with the version script. It is not, and we should use both, 35 according to Ulrich Drepper's "How to Write Shared Libraries." We will use 36 -fvisibility=hidden on all ports; this should be fine, as long as export macros are used 37 where needed. This is actually a totally separate change, but it makes sense to do it now if 38 we consider this bug a catch-all "fix how we link WebKit" issue. 39 40 * CMakeLists.txt: Rejigger the default library types, and remove the SHARED_CORE option, 41 which is not likely to work properly in ports that are not expecting it. These changes are 42 only mildly-related and certainly not required, but it makes sense to clean them up now. 43 * Source/cmake/OptionsGTK.cmake: Don't set the version script here. 44 * Source/cmake/OptionsJSCOnly.cmake: Adjust to changes in default library types. 45 * Source/cmake/OptionsMac.cmake: Adjust to changes in default library types. Override the 46 library type variables only when required. 47 * Source/cmake/OptionsWPE.cmake: Overriding the library type variables is no longer 48 required. Also, don't set the version script here. 49 * Source/cmake/OptionsWin.cmake: Adjust to changes in default library types. Override the 50 library type variables only when required. 51 * Source/cmake/WebKitCompilerFlags.cmake: Build with -fvisibility=hidden, 52 -fvisibility-inlines-hidden, and -Wno-attributes. 53 * Source/cmake/wpesymbols.filter: Removed. 54 1 55 2017-12-20 Don Olmstead <don.olmstead@sony.com> 2 56 -
trunk/Source/JavaScriptCore/ChangeLog
r226261 r226266 1 2017-12-22 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds 4 https://bugs.webkit.org/show_bug.cgi?id=179914 5 6 Reviewed by Carlos Garcia Campos. 7 8 Add a new JavaScriptCoreGTK build target, to build JSC as a shared library. Link the 9 original JavaScriptCore build target, which is now a static library, to it. Use 10 --whole-archive to prevent all the JavaScriptCore symbols from being dropped, since none are 11 used directly by JavaScriptCoreGTK. 12 13 The installed libjavascriptcoregtk-4.0 now corresponds to the JavaScriptCoreGTK target, 14 instead of the JavaScriptCore target. There is almost no difference on the installed system, 15 except that we now use a version script when linking, to hide private symbols, since they're 16 no longer needed by libwebkit2gtk-4.0.so. 17 18 Also, move the symbols map here. 19 20 * PlatformGTK.cmake: 21 * javascriptcoregtk-symbols.map: Added. 22 1 23 2017-12-22 Yusuke Suzuki <utatane.tea@gmail.com> 2 24 -
trunk/Source/JavaScriptCore/PlatformGTK.cmake
r223621 r226266 1 set(JavaScriptCore_OUTPUT_NAME javascriptcoregtk-${WEBKITGTK_API_VERSION})2 3 1 list(APPEND JavaScriptCore_UNIFIED_SOURCE_LIST_FILES 4 2 "SourcesGTK.txt" … … 53 51 ${GLIB_INCLUDE_DIRS} 54 52 ) 53 54 # Linking WebKit properly is extremely tricky. We need to build both a static library 55 # and a shared library for JSC. See https://bugs.webkit.org/show_bug.cgi?id=179914. 56 set(JavaScriptCoreGTK_LIBRARIES 57 JavaScriptCore${DEBUG_SUFFIX} 58 ) 59 ADD_WHOLE_ARCHIVE_TO_LIBRARIES(JavaScriptCoreGTK_LIBRARIES) 60 61 add_library(JavaScriptCoreGTK SHARED "${CMAKE_BINARY_DIR}/cmakeconfig.h") 62 target_link_libraries(JavaScriptCoreGTK ${JavaScriptCoreGTK_LIBRARIES}) 63 set_target_properties(JavaScriptCoreGTK PROPERTIES OUTPUT_NAME javascriptcoregtk-${WEBKITGTK_API_VERSION}) 64 65 WEBKIT_POPULATE_LIBRARY_VERSION(JAVASCRIPTCORE) 66 set_target_properties(JavaScriptCoreGTK PROPERTIES VERSION ${JAVASCRIPTCORE_VERSION} SOVERSION ${JAVASCRIPTCORE_VERSION_MAJOR}) 67 68 if (DEVELOPER_MODE) 69 WEBKIT_ADD_TARGET_PROPERTIES(JavaScriptCoreGTK LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/javascriptcoregtk-symbols.map") 70 endif () 71 72 install(TARGETS JavaScriptCoreGTK DESTINATION "${LIB_INSTALL_DIR}") -
trunk/Source/WebCore/CMakeLists.txt
r226245 r226266 1994 1994 target_link_libraries(WebCore ${WebCore_LIBRARIES}) 1995 1995 1996 if ( SHARED_CORE)1996 if (${WebCore_LIBRARY_TYPE} MATCHES "SHARED") 1997 1997 set_target_properties(WebCore PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) 1998 1998 install(TARGETS WebCore DESTINATION "${LIB_INSTALL_DIR}") -
trunk/Source/WebCore/ChangeLog
r226265 r226266 1 2017-12-22 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds 4 https://bugs.webkit.org/show_bug.cgi?id=179914 5 6 Reviewed by Carlos Garcia Campos. 7 8 * CMakeLists.txt: Test for WebCore_LIBRARY_TYPE rather than SHARED_CORE. 9 1 10 2017-12-22 Zalan Bujtas <zalan@apple.com> 2 11 -
trunk/Source/WebKit/CMakeLists.txt
r225977 r226266 939 939 endif () 940 940 941 if (WebKit_VERSION_SCRIPT)942 WEBKIT_ADD_TARGET_PROPERTIES(WebKit LINK_FLAGS "${WebKit_VERSION_SCRIPT}")943 endif ()944 945 941 add_executable(WebProcess ${WebProcess_SOURCES}) 946 942 ADD_WEBKIT_PREFIX_HEADER(WebProcess) -
trunk/Source/WebKit/ChangeLog
r226264 r226266 1 2017-12-22 Michael Catanzaro <mcatanzaro@igalia.com> 2 3 [GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds 4 https://bugs.webkit.org/show_bug.cgi?id=179914 5 6 Reviewed by Carlos Garcia Campos. 7 8 Mark a few InjectedBundle symbols with default visibility, so they don't get hidden by 9 -fvisibility=hidden. Also, remove Windows conditionals, since Windows is not supported by 10 any GLib ports. 11 12 Also, move the symbols map to here, and share it between WPE and GTK. 13 14 * CMakeLists.txt: 15 * PlatformGTK.cmake: 16 * PlatformWPE.cmake: 17 * WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h: 18 * WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp: 19 * webkitglib-symbols.map: Renamed from Source/cmake/gtksymbols.filter. 20 1 21 2017-12-21 Michael Catanzaro <mcatanzaro@igalia.com> 2 22 -
trunk/Source/WebKit/PlatformGTK.cmake
r225773 r226266 24 24 add_definitions(-DLIBDIR="${LIB_INSTALL_DIR}") 25 25 add_definitions(-DDATADIR="${CMAKE_INSTALL_FULL_DATADIR}") 26 27 if (DEVELOPER_MODE AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") 28 WEBKIT_ADD_TARGET_PROPERTIES(WebKit LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/webkitglib-symbols.map") 29 endif () 26 30 27 31 # Temporary workaround to allow the build to succeed. -
trunk/Source/WebKit/PlatformWPE.cmake
r225773 r226266 16 16 add_definitions(-DLIBEXECDIR="${LIBEXEC_INSTALL_DIR}") 17 17 add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_FULL_LOCALEDIR}") 18 19 if (DEVELOPER_MODE AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") 20 WEBKIT_ADD_TARGET_PROPERTIES(WebKit LINK_FLAGS "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/webkitglib-symbols.map") 21 endif () 18 22 19 23 # Temporary workaround to allow the build to succeed. -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitExtensionManager.h
r218628 r226266 39 39 WTF_MAKE_NONCOPYABLE(WebKitExtensionManager); 40 40 public: 41 static WebKitExtensionManager& singleton();41 __attribute__((visibility("default"))) static WebKitExtensionManager& singleton(); 42 42 43 void initialize(InjectedBundle*, API::Object*);43 __attribute__((visibility("default"))) void initialize(InjectedBundle*, API::Object*); 44 44 45 45 private: -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/glib/WebKitInjectedBundleMain.cpp
r218628 r226266 27 27 using namespace WebKit; 28 28 29 #if defined(WIN32) || defined(_WIN32) 30 extern "C" __declspec(dllexport) 31 #else 32 extern "C" 33 #endif 29 extern "C" __attribute__((visibility("default"))) 34 30 void WKBundleInitialize(WKBundleRef bundle, WKTypeRef userData) 35 31 { -
trunk/Source/WebKit/webkitglib-symbols.map
r226265 r226266 6 6 PluginProcessMainUnix; 7 7 StorageProcessMainUnix; 8 _ZN6WebKit22WebKitExtensionManager10initializeEPNS_14InjectedBundleEPN3API6ObjectE; 9 _ZN6WebKit22WebKitExtensionManager9singletonEv; 8 extern "C++" { 9 "WebKit::WebKitExtensionManager::singleton()"; 10 "WebKit::WebKitExtensionManager::initialize(WebKit::InjectedBundle*, API::Object*)"; 11 }; 10 12 local: 11 13 webkit_media_player_debug; -
trunk/Source/cmake/OptionsGTK.cmake
r225841 r226266 107 107 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MINIBROWSER PUBLIC OFF) 108 108 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_API_TESTS PRIVATE OFF) 109 if (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")110 set(WebKit_VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/gtksymbols.filter")111 endif ()112 109 endif () 113 110 -
trunk/Source/cmake/OptionsJSCOnly.cmake
r225105 r226266 49 49 # FIXME: JSCOnly on WIN32 seems to only work with fully static build 50 50 # https://bugs.webkit.org/show_bug.cgi?id=172862 51 if ( ENABLE_STATIC_JSC ORWIN32)52 set(JavaScriptCore_LIBRARY_TYPE S TATIC)51 if (NOT ENABLE_STATIC_JSC AND NOT WIN32) 52 set(JavaScriptCore_LIBRARY_TYPE SHARED) 53 53 endif () 54 54 -
trunk/Source/cmake/OptionsMac.cmake
r226189 r226266 58 58 set(ENABLE_WEBKIT ON) 59 59 60 set(JavaScriptCore_LIBRARY_TYPE SHARED) 60 61 set(WebCore_LIBRARY_TYPE SHARED) 61 62 set(WebCoreTestSupport_LIBRARY_TYPE SHARED) 62 set(WebKit_LIBRARY_TYPE SHARED)63 63 64 64 add_definitions(-DU_DISABLE_RENAMING=1 -DU_SHOW_CPLUSPLUS_API=0) -
trunk/Source/cmake/OptionsWPE.cmake
r225888 r226266 50 50 51 51 WEBKIT_OPTION_END() 52 53 set(JavaScriptCore_LIBRARY_TYPE STATIC)54 set(WebCore_LIBRARY_TYPE STATIC)55 52 56 53 find_package(Cairo 1.10.2 REQUIRED) … … 114 111 set(DERIVED_SOURCES_WPE_API_DIR ${DERIVED_SOURCES_WEBKIT_DIR}/wpe) 115 112 116 if (NOT DEVELOPER_MODE)117 set(WebKit_VERSION_SCRIPT "-Wl,--version-script,${CMAKE_MODULE_PATH}/wpesymbols.filter")118 endif ()119 120 113 include(GStreamerChecks) -
trunk/Source/cmake/OptionsWin.cmake
r226212 r226266 142 142 set(JavaScriptCore_LIBRARY_TYPE SHARED) 143 143 set(WTF_LIBRARY_TYPE SHARED) 144 set(PAL_LIBRARY_TYPE STATIC)145 set(WebKit_LIBRARY_TYPE SHARED)146 set(WebKitLegacy_LIBRARY_TYPE SHARED)147 144 148 145 find_package(ICU REQUIRED) -
trunk/Source/cmake/WebKitCompilerFlags.cmake
r222494 r226266 106 106 -fno-rtti) 107 107 108 if (UNIX AND NOT DEVELOPER_MODE) 109 # These are used even for ports that use symbol maps so that the 110 # compiler can take visibility into account for code optimization. 111 WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-fvisibility=hidden) 112 WEBKIT_APPEND_GLOBAL_CXX_FLAGS(-fvisibility-inlines-hidden) 113 endif () 114 108 115 if (WIN32) 109 116 WEBKIT_APPEND_GLOBAL_COMPILER_FLAGS(-mno-ms-bitfields) … … 129 136 -Wno-noexcept-type 130 137 -Wno-parentheses-equality) 138 139 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947 140 if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "8.0" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") 141 WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-attributes) 142 endif () 131 143 endif () 132 144
Note: See TracChangeset
for help on using the changeset viewer.