<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>181433</bug_id>
          
          <creation_ts>2018-01-09 05:19:26 -0800</creation_ts>
          <short_desc>[GTK] Missing symbols exported in 2.19.4</short_desc>
          <delta_ts>2018-01-09 07:53:49 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Garcia Campos">cgarcia</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>berto</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>ews-watchlist</cc>
    
    <cc>gustavo</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1387209</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 05:19:26 -0800</bug_when>
    <thetext>Berto has just reported that some symbols are no longer exported in 2.19.4, see:

- webkit_authentication_dialog_get_type@Base 2.5.3
+#MISSING: 2.19.4-1# webkit_authentication_dialog_get_type@Base 2.5.3

- webkit_dom_dom_window_webkit_message_handlers_post_message@Base 2.8.1
+#MISSING: 2.19.4-1# webkit_dom_dom_window_webkit_message_handlers_post_message@Base 2.8.1

- webkit_inspector_window_get_type@Base 2.17.3
+#MISSING: 2.19.4-1# webkit_inspector_window_get_type@Base 2.17.3

- webkit_web_view_base_accessible_get_type@Base 2.5.3
+#MISSING: 2.19.4-1# webkit_web_view_base_accessible_get_type@Base 2.5.3

These are symbols were we forgot to add WEBKIT_API macros, but were always exported before by the filter script (webkit_*)

There are others affected by this, but because we never wanted to expose them:

- webkit_media_src_get_type@Base 2.19.3-2~
+#MISSING: 2.19.4-1# webkit_media_src_get_type@Base 2.19.3-2~

- webkit_mse_debug@Base 2.19.3-2~
+#MISSING: 2.19.4-1# webkit_mse_debug@Base 2.19.3-2~

- (optional)webkit_soup_request_generic_get_type@Base 2.5.3
- (optional)webkit_soup_request_input_stream_get_type@Base 2.5.3
+#MISSING: 2.19.4-1# (optional)webkit_soup_request_generic_get_type@Base 2.5.3
+#MISSING: 2.19.4-1# (optional)webkit_soup_request_input_stream_get_type@Base 2.5.3

- webkit_web_src_get_type@Base 2.5.3
+#MISSING: 2.19.4-1# webkit_web_view_base_accessible_get_type@Base 2.5.3

So, we should make the filter script work again, add the missing WEBKIT_API and stop exposing private symbols even when using the filter script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387210</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 05:21:20 -0800</bug_when>
    <thetext>Michael, could it be that when using hidden visibility the filter is script is not used?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387217</commentid>
    <comment_count>2</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 05:49:17 -0800</bug_when>
    <thetext>I&apos;ve checked that using hidden visiblity takes precedence. This is actually a good thing, because it means that only webkit_ symbols will be exported thanks to the filter script, but also that webkit_ symbols not marked as public will not be exported either. So, we only need to add the missing WEBKIT_API macros.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387219</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 05:56:57 -0800</bug_when>
    <thetext>Just in case you are curious, this is my experiment:

test.c

int __attribute__((visibility(&quot;default&quot;))) p_foo() { return 1; }
int bar() { return 2; }
int __attribute__((visibility(&quot;default&quot;))) exported() { return 3; }
int __attribute__((visibility(&quot;default&quot;))) p_bar() { return 4; }
int p_baz() { return 5; }

filter

{
  global: p_*;
  local: *;
};

$ gcc test.c -Wl,--version-script=filter -fPIC -shared -o libtest.so

0000000000000555 l     F .text	000000000000000b              bar
0000000000000560 l     F .text	000000000000000b              exported
000000000000054a g     F .text	000000000000000b              p_foo
000000000000056b g     F .text	000000000000000b              p_bar
0000000000000576 g     F .text	000000000000000b              p_baz

Only p_ symbols are exported, as set in the version script, no matter what mark they have in the code.

$ gcc test.c -fvisibility=hidden -fPIC -shared -o libtest.so

0000000000000615 l     F .text	000000000000000b              bar
0000000000000636 l     F .text	000000000000000b              p_baz
000000000000060a g     F .text	000000000000000b              p_foo
0000000000000620 g     F .text	000000000000000b              exported
000000000000062b g     F .text	000000000000000b              p_bar

Only symbols marked as public in the code are exported.

$ gcc test.c -Wl,--version-script=filter -fvisibility=hidden -fPIC -shared -o libtest.so

0000000000000535 l     F .text	000000000000000b              bar
0000000000000540 l     F .text	000000000000000b              exported
0000000000000556 l     F .text	000000000000000b              p_baz
000000000000052a g     F .text	000000000000000b              p_foo
000000000000054b g     F .text	000000000000000b              p_bar

Only symbols with p_ prefix and marked as public in the code are exported. Which is exactly what we want in WebKit :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387226</commentid>
    <comment_count>4</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 06:01:27 -0800</bug_when>
    <thetext>Only webkit_dom_dom_window_webkit_message_handlers_post_message() is meant to be public and is missing the WEBKIT_API, not exposing all others now is actually and improvement, not a bug. It shouldn&apos;t break any application, and it&apos;s not an ABI break because those have always been private even exported.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387227</commentid>
    <comment_count>5</comment_count>
      <attachid>330816</attachid>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 06:04:43 -0800</bug_when>
    <thetext>Created attachment 330816
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387228</commentid>
    <comment_count>6</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 06:05:12 -0800</bug_when>
    <thetext>webkit_dom_dom_window_webkit_message_handlers_post_message(9 is used by ephy, so I&apos;ll have to make another release when this patch lands.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387229</commentid>
    <comment_count>7</comment_count>
    <who name="EWS Watchlist">ews-watchlist</who>
    <bug_when>2018-01-09 06:07:37 -0800</bug_when>
    <thetext>Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387236</commentid>
    <comment_count>8</comment_count>
      <attachid>330816</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-01-09 06:44:30 -0800</bug_when>
    <thetext>Comment on attachment 330816
Patch

Yes, this is caused by -fvisibility=hidden.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387239</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-01-09 06:46:24 -0800</bug_when>
    <thetext>Carlos, in the linker version script, Source/WebKit/webkitglib-symbols.map, please remove line 13:

  webkit_media_player_debug;

There&apos;s no point in having it anymore since it is not marked with WEBKIT_API. I didn&apos;t consider that when modifying the script.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1387256</commentid>
    <comment_count>10</comment_count>
    <who name="Carlos Garcia Campos">cgarcia</who>
    <bug_when>2018-01-09 07:53:49 -0800</bug_when>
    <thetext>Committed r226633: &lt;https://trac.webkit.org/changeset/226633&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>330816</attachid>
            <date>2018-01-09 06:04:43 -0800</date>
            <delta_ts>2018-01-09 06:44:30 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>wk-missing-symbols.diff</filename>
            <type>text/plain</type>
            <size>1466</size>
            <attacher name="Carlos Garcia Campos">cgarcia</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nIGIvU291cmNlL1dlYktpdC9DaGFu
Z2VMb2cKaW5kZXggOTVkOGI4YWRhNmEuLjIyYzRhNTNjNzQ0IDEwMDY0NAotLS0gYS9Tb3VyY2Uv
V2ViS2l0L0NoYW5nZUxvZworKysgYi9Tb3VyY2UvV2ViS2l0L0NoYW5nZUxvZwpAQCAtMSwzICsx
LDE0IEBACisyMDE4LTAxLTA5ICBDYXJsb3MgR2FyY2lhIENhbXBvcyAgPGNnYXJjaWFAaWdhbGlh
LmNvbT4KKworICAgICAgICBbR1RLXSBNaXNzaW5nIHN5bWJvbHMgZXhwb3J0ZWQgaW4gMi4xOS40
CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xODE0MzMK
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBBZGQgbWlz
c2luZyBXRUJLSVRfQVBJIHRvIHdlYmtpdF9kb21fZG9tX3dpbmRvd193ZWJraXRfbWVzc2FnZV9o
YW5kbGVyc19wb3N0X21lc3NhZ2UoKS4KKworICAgICAgICAqIFdlYlByb2Nlc3MvSW5qZWN0ZWRC
dW5kbGUvQVBJL2d0ay9ET00vV2ViS2l0RE9NRE9NV2luZG93Lmg6CisKIDIwMTgtMDEtMDkgIENh
cmxvcyBHYXJjaWEgQ2FtcG9zICA8Y2dhcmNpYUBpZ2FsaWEu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cqIHdpbmRvdywgY29uc3QgZ2NoYXIqIGhhbmRsZXIs
IGNvbnN0IGdjaGFyKiBtZXNzYWdlKTsKIAogR19FTkRfREVDTFMKIAo=
</data>
<flag name="review"
          id="349833"
          type_id="1"
          status="+"
          setter="mcatanzaro"
    />
          </attachment>
      

    </bug>

</bugzilla>