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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
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.

3 participants