Skip to content

base/nss.bst: Ship development tools for the freebl lib

Mat Booth requested to merge mbooth/nss-freebl into 18.08

I have a problem with OpenJDK 11 that can be fixed by building against the system version of NSS provided by org.freedesktop.Sdk, instead of the version bundled with OpenJDK:

https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk11/issues/2

Here is my patch to build the JDK against the system version of NSS:

https://github.com/flathub/org.freedesktop.Sdk.Extension.openjdk11/commit/7b24b36

However, the patch requires that OpenJDK be linked against the libfreebl library provided by NSS but there are some missing devel files that I need to add to the freedesktop sdk runtime in order to do this. This change adds the necessary missing headers and .a file to the sdk runtime and this allows OpenJDK to build against the system NSS.

I tested locally with this change applied and I was now able to build OpenJDK against the NSS provided by the freedesktop sdk runtime and I was able to confirm that the static lib did not sneak into the freedesktop platform runtime. Doing a make check-dev-files yielded no results and I checked manually to make sure:

Here is present in the sdk:

[mbooth@thinkpad-p50 openjdk-flatpak]$ grep \"runtime\" com.example.TestJava/com.example.TestJava.json
    "runtime": "org.freedesktop.Sdk",
[mbooth@thinkpad-p50 openjdk-flatpak]$ flatpak run --command=bash com.example.TestJava
bash-4.4$ ls -l /usr/lib/x86_64-linux-gnu/*freebl*
-rwxr-xr-x 5 nfsnobody nfsnobody  14496 Jan  1  1970 /usr/lib/x86_64-linux-gnu/libfreebl3.so
-rw-r--r-- 2 nfsnobody nfsnobody 189012 Jan  1  1970 /usr/lib/x86_64-linux-gnu/libfreebl.a
-rwxr-xr-x 5 nfsnobody nfsnobody 880088 Jan  1  1970 /usr/lib/x86_64-linux-gnu/libfreeblpriv3.so

And not present in the platform:

[mbooth@thinkpad-p50 openjdk-flatpak]$ grep \"runtime\" com.example.TestJava/com.example.TestJava.json 
    "runtime": "org.freedesktop.Platform",
[mbooth@thinkpad-p50 openjdk-flatpak]$ flatpak run --command=bash com.example.TestJava 
bash-4.4$ ls -l /usr/lib/x86_64-linux-gnu/*freebl*
-rwxr-xr-x 5 nfsnobody nfsnobody  14496 Jan  1  1970 /usr/lib/x86_64-linux-gnu/libfreebl3.so
-rwxr-xr-x 5 nfsnobody nfsnobody 880088 Jan  1  1970 /usr/lib/x86_64-linux-gnu/libfreeblpriv3.so
bash-4.4$ 

FWIW, the same change was made to the version of NSS shipped by Fedora:

Please consider merging this change which does the same to org.freedesktop.Sdk

Thanks

Merge request reports