Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[openssl] emscripten toolchain controls thread support #43671

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

dg0yt
Copy link
Contributor

@dg0yt dg0yt commented Feb 7, 2025

Cf. https://emscripten.org/docs/porting/pthreads.html:
For Pthreads support in emscripten, all C and C++ source files must be compiled AND linked with pthread.

Unconditionally enabling thread support in openssl made some downstream builds fail (#43463 (comment)), and even successful builds (as before #43463) would not comply with the documented requirement.

This PR couples openssl threads support for emscripten to the presence of -pthread in the C flags from the triplet/toolchain. Triplet/toolchain ensures that all C and C++ source files ae compiled AND linked with pthread (subject to per-port customization).

This change has been tested with vcpkg-ci-curl[core]:wasm32-emscripten with default settings (i.e. no -pthread) and with CFLAGS=-pthread.

@dg0yt dg0yt changed the title [openssl] wasm toolchain must control -pthread [openssl] emscripten toolchain controls thread support Feb 7, 2025
@LilyWangLL LilyWangLL added the category:port-bug The issue is with a library, which is something the port should already support label Feb 7, 2025
@AenBleidd
Copy link
Contributor

Has been successfully tested here: BOINC/boinc#6061
Except need to provide a PKG_CONFIG_PATH (reasonable change) - everything builds smooth.
Thank you @dg0yt for fixing that!

@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Feb 8, 2025
@BillyONeal BillyONeal merged commit 42452c3 into microsoft:master Feb 11, 2025
17 checks passed
@BillyONeal
Copy link
Member

BillyONeal commented Feb 11, 2025

Thanks for the fix!

@dg0yt dg0yt deleted the openssl-wasm branch February 11, 2025 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants