Skip to content

buildMozillaMach: fix crashes due to statically linked libstdc++#269680

Merged
vcunat merged 1 commit intoNixOS:release-23.05from
mweinelt:firefox-fix-libstdcc++-linking
Nov 24, 2023
Merged

buildMozillaMach: fix crashes due to statically linked libstdc++#269680
vcunat merged 1 commit intoNixOS:release-23.05from
mweinelt:firefox-fix-libstdcc++-linking

Conversation

@mweinelt
Copy link
Member

The cc-wrapper currently only supplies libstdcc++.a in its search paths, which causes bugs described as described in the upstream mozbz issue.

Work around this by passing a search path that includes the dynamically linked version.

Upstream-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1861365

Closes: #269571

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Priorities

Add a 👍 reaction to pull requests you find important.

The cc-wrapper currently only supplies libstdcc++.a in its search paths,
which causes bugs described as described in the upstream mozbz issue.

Work around this by passing a search path that includes the dynamically
linked version.

Upstream-Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1861365
Co-Authored-By: Sergei Trofimovich <slyich@gmail.com>
Closes: NixOS#269571
@mweinelt mweinelt linked an issue Nov 24, 2023 that may be closed by this pull request
LDFLAGS = "-Wl,-rpath,${placeholder "out"}/lib/${binaryName}";
};

# workaround for clang statically linking against libstdc++
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning why this is a problem and needs a workaround, and/or link to the issue

Copy link
Member Author

@mweinelt mweinelt Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will immediately revert this commit in staging-next-23.05, since the proper fix is in #267737.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 24, 2023
@vcunat vcunat merged commit 1216a5b into NixOS:release-23.05 Nov 24, 2023
@vcunat
Copy link
Member

vcunat commented Nov 24, 2023

OK, let's do it the quick way.

@mweinelt mweinelt deleted the firefox-fix-libstdcc++-linking branch November 24, 2023 18:40
vcunat added a commit that referenced this pull request Nov 24, 2023
This reverts commit 1216a5b, reversing
changes made to 3b8ca94.

The issue should've been fixed by cefdf8f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Firefox 120 crashing on WebGL on NixOS 23.05

3 participants