firefox: simplify NIX_LDFLAGS usage

This was required to solve the XPCOMGlueLoad error when building with
LTO. However, it turns out libxul.so is supposed to have some libraries
that are reported as not found by ldd. Setting the RPATH worked around
the error as it forced dependency resolution but failed to fix the real
issue of broken generation of dependentlibs.list.

The libraries that are reported as not found by ldd are supposed to be
dlopened through the logic found in nsXPCOMGlue.cpp. However since the
generation of dependentlibs.list is broken under LTO this did not
happen. Instead of pulling libwayland-client.so from the GTK libraries
it found the stub library first (libmozwayland.so). The stub library
causes (as it should) wl_display_connect to always return NULL which is
the cause of the segmentation fault and LTO breaking wayland support.

Remove the hardcoded path used for the XPCOMGlueLoad error workaround
in NIX_LDFLAGS. libunwind is still unfortunately needed. Once the issue
of the generation of dependentlibs.list being borked is fixed it should
remedy the wayland crash issue on LTO.
This commit is contained in:
S. Nordin Abouzahra 2020-12-09 21:53:39 -05:00
parent a277fca1c4
commit 40b4eb1c52

View File

@ -173,7 +173,6 @@ buildStdenv.mkDerivation ({
++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed
++ lib.optional gtk3Support gtk3
++ lib.optional gssSupport kerberos
++ lib.optional ltoSupport llvmPackages.libunwind
++ lib.optional waylandSupport libxkbcommon
++ lib.optional pipewireSupport pipewire
++ lib.optional (lib.versionAtLeast ffversion "82") gnum4
@ -182,7 +181,6 @@ buildStdenv.mkDerivation ({
Foundation libobjc AddressBook cups ];
NIX_LDFLAGS = lib.optionalString ltoSupport ''
-rpath ${placeholder "out"}/lib/${binaryName}
-rpath ${llvmPackages.libunwind.out}/lib
'';