From 40b4eb1c52f2a87f8f99ac193782c1c8b665fb7b Mon Sep 17 00:00:00 2001 From: "S. Nordin Abouzahra" Date: Wed, 9 Dec 2020 21:53:39 -0500 Subject: [PATCH] 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. --- pkgs/applications/networking/browsers/firefox/common.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 0378d0dc8595..4a356995cde5 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -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 '';