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

All pthread_attr_* support #311

Merged
merged 16 commits into from
Jul 7, 2022
Merged

Conversation

Geertiebear
Copy link
Member

@Geertiebear Geertiebear commented Sep 4, 2021

Fixes #253. Is an ABI break.

@Dennisbonke
Copy link
Member

uhm, 3 commit messages are wrong, I don't know posix_attr_{get,set}stackaddr(), I assume you mean pthread_ there?

@Geertiebear
Copy link
Member Author

Oh, good one, I'll fix those.

@avdgrinten
Copy link
Member

Are there any attributes supported by musl/glibc which would require additional ABI breaks?

@Geertiebear
Copy link
Member Author

Just one, which is pthread_attr_setaffinity_np, which needs a cpu_set_t in the attr struct.

@avdgrinten
Copy link
Member

Shouldn't we add this now to prevent future ABI breaks?

@avdgrinten
Copy link
Member

We could protect against future breaks by including a version number in the structs. Should we do that?

@Geertiebear
Copy link
Member Author

Shouldn't we add this now to prevent future ABI breaks?

Yeah, taking a second look at it it shouldn't be very difficult. So it should be added in this PR.

We could protect against future breaks by including a version number in the structs. Should we do that?

How does that work exactly?

@ArsenArsen
Copy link
Member

Alias the functions to something like _Pthread_getattr_v2 which returns a pointer to __Pthread_attrs_v2, which is aliased to pthread_attr, etc. Since these get dealiased at compile/link time, as long as all the versions work, all programs will.

@avdgrinten
Copy link
Member

Aliasing the functions doesn't necessarily help, it's the size of the struct that needs to be handled.

We could add a version field to the struct (e.g., as first member) and let the initialization macros/functions set it to 1. If we the attributes change in an incompatible way, we can bump the value.

@Geertiebear Geertiebear force-pushed the pthread_attr branch 4 times, most recently from 6c93f22 to 9fc18f0 Compare September 17, 2021 21:42
@Geertiebear
Copy link
Member Author

Is there anything else that needs to be in this PR?

Copy link
Member

@Dennisbonke Dennisbonke left a comment

Choose a reason for hiding this comment

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

Looks good, but merging this as is would break Managarm's aarch64 port.

options/posix/generic/pthread-stubs.cpp Show resolved Hide resolved
mintsuki added a commit to vinix-os/mlibc that referenced this pull request Feb 14, 2022
mintsuki added a commit to vinix-os/mlibc that referenced this pull request Feb 14, 2022
mintsuki added a commit to vinix-os/mlibc that referenced this pull request Feb 17, 2022
mintsuki added a commit to vinix-os/mlibc that referenced this pull request Feb 20, 2022
mintsuki added a commit to vinix-os/mlibc that referenced this pull request Apr 23, 2022
@Geertiebear Geertiebear force-pushed the pthread_attr branch 2 times, most recently from c3aeef5 to a910c14 Compare July 7, 2022 19:02
@Geertiebear Geertiebear merged commit 58ceb66 into managarm:abi-break Jul 7, 2022
no92 pushed a commit to no92/mlibc that referenced this pull request Jul 8, 2022
Backport of mlibc managarm#311 for x86_64 only!
This will enter through abi-breaks on master, do not submit back into upstream!
DO NOT MERGE BACK INTO MASTER!
no92 pushed a commit to no92/mlibc that referenced this pull request Jul 9, 2022
Backport of mlibc managarm#311 for x86_64 only!
This will enter through abi-breaks on master, do not submit back into upstream!
DO NOT MERGE BACK INTO MASTER!
Dennisbonke added a commit to no92/mlibc that referenced this pull request Jul 10, 2022
Backport of mlibc managarm#311 for x86_64 only!
This will enter through abi-breaks on master, do not submit back into upstream!
DO NOT MERGE BACK INTO MASTER!
Dennisbonke added a commit to no92/mlibc that referenced this pull request Jul 21, 2022
Backport of mlibc managarm#311 for x86_64 only!
This will enter through abi-breaks on master, do not submit back into upstream!
DO NOT MERGE BACK INTO MASTER!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants