<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - ICU static linking patch and SOVERSION option to help building distributable binaries for Linux &amp; Android"
   href="https://bugs.webkit.org/show_bug.cgi?id=156823">156823</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>ICU static linking patch and SOVERSION option to help building distributable binaries for Linux &amp; Android
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ewmailing&#64;gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hi, this is my first formal patch submission. I probably could use help.
This was discussed in the mailing list thread: [webkit-dev] Thought about Nix JavaScriptCore port

The intent of these patches are to allow building JavaScriptCore for binary distribution on both GNU/Linux and Android.

This first patch adds a configurable option to enable/disable SOVERSION. Using SOVERSION generally breaks Android because its Java LoadLibrary can't handle symlinks and the SOVERSION conventions.

<a href="https://github.com/ewmailing/webkit/commit/ea68782c98cce97c56b44a86008c1a34bc323f6b">https://github.com/ewmailing/webkit/commit/ea68782c98cce97c56b44a86008c1a34bc323f6b</a>


This next set is to allow building against ICU when it is a static library. ICU is problematic because it is not guaranteed to be shipped as a component and the version that is in use is not guaranteed either. For example, on Steam Linus/SteamOS, ICU is not a standard/public component. Since Steam is designed around shipping binaries to arbitrary Linux machines, there is a dependency hell problem, so being able to statically link ICU is useful. Additionally, end users may need ICU in their own products, so shipping an ICU as a dynamic library is problematic with JSCore because it could potentially conflict with the version the user needs to use for other parts of their project.

Android is the same problem but much more dire. ICU is not a public component. However, device manufacturers are allowed to use it internally. If this happens (happened to me on a Nexus 7 running 5.0.2), LoadLibrary will quietly fail to load your own copy of ICU because the OS already has one loaded. If the manufacturer is using a different version, your symbols will fail to resolve if you are lucky. If you are unlucky, you will get totally broken behavior and won't understand why. Static linking avoids this problem.

The approach to this patch is simple and doesn't add any switches to control static vs. dynamic linking. Instead, it just assumes the builder has specified only static libraries in the (CMake) build process and that is its only choice. The fix though is that with static libraries, you must link all dependencies explicitly and previously, the ICU Data library was an implicit dependency. So the build process now needs to explicitly find the ICU Data library and link to it.

This should have no significant impact for the dynamic linking case. The library is always a dependency regardless. Even when built as a data archive, ICU creates a stub library for ICU data you are still expected to link with.


(Initial patch)
<a href="https://github.com/ewmailing/webkit/commit/a6493be74f38b129b7019be9a6c01e9419f7cf74">https://github.com/ewmailing/webkit/commit/a6493be74f38b129b7019be9a6c01e9419f7cf74</a>
(Fixed indentation)
<a href="https://github.com/ewmailing/webkit/commit/e2c94e8b126143402b4e17cc514c4df412de5ace">https://github.com/ewmailing/webkit/commit/e2c94e8b126143402b4e17cc514c4df412de5ace</a>


I probably need help to commit this in. I only build JSCore, and not all of WebKit. (The build process and dependency chain is a real problem/challenge for me, so I don't think I can get through the standard automated process by myself.)</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>