Skip to content

[Linux] Define _GNU_SOURCE when building TSCclibc #326

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
Jun 7, 2022

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Jun 7, 2022

Fixes missing declaration for posix_spawn_file_actions_addchdir_np on
Linux.

Fixes missing declaration for `posix_spawn_file_actions_addchdir_np` on
Linux.
@bnbarham
Copy link
Contributor Author

bnbarham commented Jun 7, 2022

@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 matches what I had experienced but failed to upstream; thank you for taking care of it.

@tomerd
Copy link
Contributor

tomerd commented Jun 7, 2022

thanks @bnbarham can you provide context to the fix? is there a test that is missing that could have prevented the omission?

@bnbarham
Copy link
Contributor Author

bnbarham commented Jun 7, 2022

thanks @bnbarham can you provide context to the fix? is there a test that is missing that could have prevented the omission?

It's currently failing on rebranch (corresponding to LLVM stable/20220421) - https://ci.swift.org/view/Swift%20rebranch/job/oss-swift-rebranch-pr-test-ubuntu-20_04/315. I didn't look too hard into what changed there, any ideas @compnerd?

An alternative to this change would be to update the definition of SPM_posix_spawn_file_actions_addchdir_np itself. It is already checking for GLIBC and minimum 2.29, so I assume if it doesn't exist any more that there might be a portable (ie. minus _np) now?

@tomerd
Copy link
Contributor

tomerd commented Jun 7, 2022

@swift-ci smoke test

@compnerd
Copy link
Member

compnerd commented Jun 7, 2022

I don't remember what exposed this :(. This is the correct thing though - there's no guarantee that the interfaces are available - they are inherently non-portable and require opt-in. I think that it might be that the importer doesn't define it now to correct other interactions?

@tomerd tomerd merged commit a45bf60 into swiftlang:main Jun 7, 2022
@bnbarham bnbarham deleted the fix-linux-compilation branch June 7, 2022 16:25
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