Skip to content

Switch from -sUSE_PTHREAD to the standard -pthread. NFC #18917

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

Merged
merged 1 commit into from
Mar 8, 2023
Merged

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Mar 7, 2023

We already supported this flag, but this change mostly updates all or tests and documentation to refer exclusively to that latter.

@sbc100 sbc100 requested review from dschuff and kripken March 7, 2023 22:54
Copy link
Member

@dschuff dschuff left a comment

Choose a reason for hiding this comment

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

🎉 this is great
(it is -pthread and not -pthreads that we recommend, right? I can never remember which of those is the "correct" one)

@sbc100
Copy link
Collaborator Author

sbc100 commented Mar 7, 2023

tada this is great (it is -pthread and not -pthreads that we recommend, right? I can never remember which of those is the "correct" one)

There is no s on the end.. -pthreads with an s is just an error.

Or at least I thought it was.. looks like it is for gcc..

$ gcc -pthreads ~/test/hello.c
gcc: error: unrecognized command-line option ‘-pthreads’; did you mean ‘-pthread’?

But maybe not for clang.. thats annoying,.

$ clang -pthreads ~/test/hello.c

We already supported this flag, but this change mostly updates all
or tests and documentation to refer exclusively to that latter.
@sbc100
Copy link
Collaborator Author

sbc100 commented Mar 7, 2023

I guess we could followup to start accepting -pthreads (plural) like clang does?

@dschuff
Copy link
Member

dschuff commented Mar 7, 2023

Honestly I could take or leave supporting -pthreads (unless -pthreads is more common/popular). I think CMake checks for both.

@sbc100
Copy link
Collaborator Author

sbc100 commented Mar 7, 2023

Honestly I could take or leave supporting -pthreads (unless -pthreads is more common/popular). I think CMake checks for both.

I did a bunch of history spelunking to try to find out why clang differs from gcc here.. but I didn't find out yet.

Got as far back as 2010: llvm/llvm-project@34d77dc

@sbc100
Copy link
Collaborator Author

sbc100 commented Mar 7, 2023

Found the initial commit that added pthreads.. claims it was adding "gcc options" so I guess it was an accident of history?

llvm/llvm-project@c800391

@sbc100 sbc100 enabled auto-merge (squash) March 8, 2023 00:04
@sbc100 sbc100 merged commit 3907ae1 into main Mar 8, 2023
@sbc100 sbc100 deleted the pthread_flag branch March 8, 2023 00:54
kripken added a commit that referenced this pull request Mar 8, 2023
kripken added a commit that referenced this pull request Mar 8, 2023
impact-maker pushed a commit to impact-maker/emscripten that referenced this pull request Mar 17, 2023
…en-core#18917)

We already supported this flag, but this change mostly updates all
or tests and documentation to refer exclusively to that latter.
impact-maker pushed a commit to impact-maker/emscripten that referenced this pull request Mar 17, 2023
impact-maker pushed a commit to impact-maker/emscripten that referenced this pull request Mar 17, 2023
…en-core#18917)

We already supported this flag, but this change mostly updates all
or tests and documentation to refer exclusively to that latter.
impact-maker pushed a commit to impact-maker/emscripten that referenced this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants