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

Build process.c with _GNU_SOURCE #363

Merged
merged 1 commit into from
Nov 7, 2022
Merged

Conversation

fweimer-rh
Copy link
Contributor

Otherwise the build will fail on glibc 2.29 and later because posix_spawn_file_actions_addchdir_np is not declared.

A glibc change has been submitted as well, but it will not become available until glibc 2.37:

[PATCH] posix: Make posix_spawn extensions available by default https://sourceware.org/pipermail/libc-alpha/2022-November/143197.html

@MaxDesiatov
Copy link
Contributor

@swift-ci please test

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

This runs the risk of causing warnings such as macro redefined. You should add a check around this or better yet, sink this into the build system.

@fweimer-rh
Copy link
Contributor Author

The warning doesn't happen if the redefinition is identical. I think the risk is very small. I can add an #undef or an #ifdef.

I don't want to change the build system because it may have unintended consequences. See the existing comment regarding strerror_r.

@compnerd
Copy link
Member

compnerd commented Nov 4, 2022

IIRC it does if it is from the command line vs builtin vs in the source. At least with CMake we can control it on a per source file level, which keeps the risk profile the same. However, a #ifndef wrapper seems fine too.

@fweimer-rh
Copy link
Contributor Author

Okay, I'll try the #ifndef. Do you prefer another commit or a rebase? Thanks.

@compnerd
Copy link
Member

compnerd commented Nov 4, 2022

I think that we do have squashes on this repo, so either is fine - it can be squashed before merging.

Otherwise the build will fail on glibc 2.29 and later because
posix_spawn_file_actions_addchdir_np is not declared.

Starting with glibc 2.37, posix_spawn_file_actions_addchdir_np
will be available with the default feature flags; see glibc
commit 2ff48a4025515e93d722947a9eabb114f4a65b22 ("posix: Make
posix_spawn extensions available by default").
@MaxDesiatov

This comment was marked as outdated.

@MaxDesiatov
Copy link
Contributor

@swift-ci please test

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.

None yet

4 participants