⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 274166 in webkit


Ignore:
Timestamp:
Mar 9, 2021, 12:11:42 PM (6 years ago)
Author:
commit-queue@webkit.org
Message:

.:
[GTK] Reenable -fvisibility=hidden
https://bugs.webkit.org/show_bug.cgi?id=181916

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-03-09
Reviewed by Don Olmstead.

In non-DEVELOPER_MODE builds, we rely on a linker version script to hide symbols that we
don't want to export. Building with hidden visibility might seem redundant with this, but
actually building with hidden visibility has advantages anyway. See
https://gcc.gnu.org/wiki/Visibility.

Note that I'm not confident GTK port can safely use -fvisibility-inlines-hidden, since it's
split between two shared objects. Also, because GTK is split into two shared objects, GTK
needs to build bmalloc and WTF as CMake OBJECT libraries, which is effectively the same as
using -Wl,--whole-archive to prevent symbols from being prematurely stripped away.

P.S. Major credit to Don Olmstead, who did most of the work to make this possible, which has
already landed in previous patches.

  • Source/cmake/OptionsGTK.cmake:

Source/WebCore:
[WPE][GTK] Reenable -fvisibility=hidden (and -fvisibility-inlines-hidden for WPE)
https://bugs.webkit.org/show_bug.cgi?id=181916

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-03-09
Reviewed by Don Olmstead.

We need to export the destructor of EventTarget.

  • PlatformGTK.cmake:
  • dom/EventTarget.cpp:
  • dom/EventTarget.h:

Tools:
[GTK] Reenable -fvisibility=hidden
https://bugs.webkit.org/show_bug.cgi?id=181916

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-03-09
Reviewed by Don Olmstead.

  • TestWebKitAPI/PlatformGTK.cmake:
  • TestWebKitAPI/glib/TestExpectations.json:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r274010 r274166  
     12021-03-09  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        [GTK] Reenable -fvisibility=hidden
     4        https://bugs.webkit.org/show_bug.cgi?id=181916
     5
     6        Reviewed by Don Olmstead.
     7
     8        In non-DEVELOPER_MODE builds, we rely on a linker version script to hide symbols that we
     9        don't want to export. Building with hidden visibility might seem redundant with this, but
     10        actually building with hidden visibility has advantages anyway. See
     11        https://gcc.gnu.org/wiki/Visibility.
     12
     13        Note that I'm not confident GTK port can safely use -fvisibility-inlines-hidden, since it's
     14        split between two shared objects. Also, because GTK is split into two shared objects, GTK
     15        needs to build bmalloc and WTF as CMake OBJECT libraries, which is effectively the same as
     16        using -Wl,--whole-archive to prevent symbols from being prematurely stripped away.
     17
     18        P.S. Major credit to Don Olmstead, who did most of the work to make this possible, which has
     19        already landed in previous patches.
     20
     21        * Source/cmake/OptionsGTK.cmake:
     22
    1232021-03-05  Michael Catanzaro  <mcatanzaro@gnome.org>
    224
  • trunk/Source/WebCore/ChangeLog

    r274165 r274166  
     12021-03-09  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        [WPE][GTK] Reenable -fvisibility=hidden (and -fvisibility-inlines-hidden for WPE)
     4        https://bugs.webkit.org/show_bug.cgi?id=181916
     5
     6        Reviewed by Don Olmstead.
     7
     8        We need to export the destructor of EventTarget.
     9
     10        * PlatformGTK.cmake:
     11        * dom/EventTarget.cpp:
     12        * dom/EventTarget.h:
     13
    1142021-03-09  Antoine Quint  <graouts@webkit.org>
    215
  • trunk/Source/WebCore/PlatformGTK.cmake

    r273970 r274166  
    88
    99set(WebCore_OUTPUT_NAME WebCoreGTK)
    10 
    11 # FIXME: https://bugs.webkit.org/show_bug.cgi?id=181916
    12 # Remove these lines when turning on hidden visibility
    13 list(APPEND WebCore_PRIVATE_LIBRARIES WebKit::WTF)
    14 if (NOT USE_SYSTEM_MALLOC)
    15     list(APPEND WebCore_PRIVATE_LIBRARIES WebKit::bmalloc)
    16 endif ()
    1710
    1811list(APPEND WebCore_UNIFIED_SOURCE_LIST_FILES
  • trunk/Source/WebCore/dom/EventTarget.cpp

    r273138 r274166  
    6767}
    6868
     69EventTarget::~EventTarget() = default;
     70
    6971bool EventTarget::isNode() const
    7072{
  • trunk/Source/WebCore/dom/EventTarget.h

    r273138 r274166  
    104104
    105105protected:
    106     virtual ~EventTarget() = default;
     106    WEBCORE_EXPORT virtual ~EventTarget();
    107107   
    108108    virtual EventTargetData* eventTargetData() = 0;
  • trunk/Source/cmake/OptionsGTK.cmake

    r274010 r274166  
    1818
    1919CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE(JAVASCRIPTCORE 37 0 19)
     20
     21set(CMAKE_C_VISIBILITY_PRESET hidden)
     22set(CMAKE_CXX_VISIBILITY_PRESET hidden)
     23set(bmalloc_LIBRARY_TYPE OBJECT)
     24set(WTF_LIBRARY_TYPE OBJECT)
    2025
    2126# These are shared variables, but we special case their definition so that we can use the
  • trunk/Tools/ChangeLog

    r274159 r274166  
     12021-03-09  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        [GTK] Reenable -fvisibility=hidden
     4        https://bugs.webkit.org/show_bug.cgi?id=181916
     5
     6        Reviewed by Don Olmstead.
     7
     8        * TestWebKitAPI/PlatformGTK.cmake:
     9        * TestWebKitAPI/glib/TestExpectations.json:
     10
    1112021-03-09  Mark Lam  <mark.lam@apple.com>
    212
  • trunk/Tools/TestWebKitAPI/PlatformGTK.cmake

    r274010 r274166  
    2828    GTK::GTK
    2929)
    30 
    31 # FIXME: Remove when turning on hidden visibility https://bugs.webkit.org/show_bug.cgi?id=181916
    32 list(APPEND TestJavaScriptCore_LIBRARIES WTF)
    3330
    3431# TestWebCore
  • trunk/Tools/TestWebKitAPI/glib/TestExpectations.json

    r273735 r274166  
    295295            "/jsc/vm": {
    296296                "expected": {"all": {"slow": true}}
     297            },
     298            "/jsc/weak-value": {
     299                "expected": {"all": {"status": ["FAIL", "PASS"], "bug": "webkit.org/b/222972"}}
    297300            }
    298301        }
Note: See TracChangeset for help on using the changeset viewer.