wasilibc: add flag for thread support; add extra test case#241739
Open
sternenseemann wants to merge 3 commits intoNixOS:masterfrom
Open
wasilibc: add flag for thread support; add extra test case#241739sternenseemann wants to merge 3 commits intoNixOS:masterfrom
sternenseemann wants to merge 3 commits intoNixOS:masterfrom
Conversation
Member
Author
|
firefox-esr now fails with |
12 tasks
Member
|
Firefox 102 ESR is gone! |
9cc1d4d to
1265e2e
Compare
Member
|
Wasilibc 20 is currently on staging-next |
1265e2e to
890888b
Compare
This is an experimental new feature in wasilibc which also allows enabling threads in libcxx* as a consequence. This is wired up using passthru.hasThreads. It is disabled by default (as it is experimental still), but overlaying wasilibc to turn on the flag should allow using it. See also: - WebAssembly/wasi-sdk#274 - WebAssembly/wasi-sdk#301 - WebAssembly/wasi-sdk#314 Flags for libc++abi are copied from wasi-sdk. The BULK_MEMORY_SOURCES is dropped, as it no longer needs to be set to be empty to compile firefox. With it set, the build of wasilibc would fail if enableThreads is true. Test using (import ./. { overlays = [ (self: super: { wasilibc = super.wasilibc.override { enableThreads = true; }; }) ]; }).wasilibc.tests.simple-c-cxx-binaries
This is a quicker way than building firefox to see if linking works.
890888b to
f2617d2
Compare
Member
Author
|
Remaining changes are an additional test case and optional, off by default support for the new pthread API in wasilibc. |
Member
|
This looks like it is still applicable and just needs a rebase. |
RossComputerGuy
requested changes
Dec 19, 2024
| "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind" | ||
| ] ++ lib.optionals stdenv.hostPlatform.isWasm [ | ||
| "-DLIBCXX_ENABLE_THREADS=OFF" | ||
| "-DLIBCXX_ENABLE_THREADS=${if stdenv.cc.libc.hasThreads then "ON" else "OFF"}" |
Member
There was a problem hiding this comment.
Please use lib.cmakeBool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
GHC's wasm backend needs LLVM 16 (due to new flags), bumping the default version for WASM seems like the simplest solution for this. While we're at it, update
wasilibcwhich uses LLVM 16 in release 20 as well._gitThings done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)