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

fix(build): ensure -pthread is passed #623

Merged
1 commit merged into from
Sep 26, 2024
Merged

Conversation

ghost
Copy link

@ghost ghost commented Sep 26, 2024

Linking against pthread and adding the compiler/linker/preprocessor option for
pthreads are different things when using a modern libc. Without the
compiler/preprocessor options, various builtin #defines are not set. Notably,
this should change the behavior around errno in a multithreaded context within
glibc; _REENTRANT will now be defined and errno is now thread-local.

See 4e45dd8 for an example of a bug that this would have prevented.

See also:

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license.

@ghost ghost requested a review from bwbarrett as a code owner September 26, 2024 03:05
Linking against pthread and adding the compiler/linker/preprocessor
option for pthread are different things.

Without the compiler/preprocessor options, various builtin '#define's
may not be set. Notably, this should change the behavior around errno in
a multithreaded context within glibc; _REENTRANT will now be defined and
errno is now thread-local.

See 4e45dd8 for an example of a bug that this would have prevented.

Signed-off-by: Nicholas Sielicki <nslick@amazon.com>
@ghost ghost force-pushed the pthread-fixes branch from bd61ce3 to 8158c7b Compare September 26, 2024 03:39
@ghost ghost dismissed bwbarrett’s stale review September 26, 2024 04:18

aligned, changes made

@ghost ghost merged commit 498b0b5 into aws:master Sep 26, 2024
31 checks passed
@ghost ghost deleted the pthread-fixes branch September 26, 2024 20:47
aws-ofiwg-bot pushed a commit to aws-ofiwg-bot/aws-ofi-nccl that referenced this pull request Oct 4, 2024
Linking against pthread and adding the compiler/linker/preprocessor
option for pthread are different things.

Without the compiler/preprocessor options, various builtin '#define's
may not be set. Notably, this should change the behavior around errno in
a multithreaded context within glibc; _REENTRANT will now be defined and
errno is now thread-local.

See 4e45dd8 for an example of a bug that this would have prevented.

Signed-off-by: Nicholas Sielicki <nslick@amazon.com>
This pull request was closed.
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.

2 participants