Skip to content

[tools] Fix not utility to work on iOS #73

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 3 commits into from
Jan 11, 2024

Conversation

tarunprabhu
Copy link
Contributor

This addresses issue #77137 (std::system is not available on iOS). The implementation uses posix_spawn on iOS but std::system elsewhere.

This has only been tested on Linux on X86 and an older AArch64.

@jroelofs, could you try this on an iOS and let me know if it works there?

This addresses issue #77137. The implementation uses posix_spawn on iOS but
std::system elsewhere.
Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

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

Changes look sensible to me, assuming that posix_spawn and waitpid on iOS are standards compliant. However, I have no experience writing software for iOS. Please wait for approval by somebody who can test on iOS.

@tblah
Copy link
Contributor

tblah commented Jan 9, 2024

As posix_spawn is part of POSIX, it is probably reasonably well available on other platforms (although I don't know about Windows). Perhaps we could get away without the #ifdef here. I don't feel strongly about this.

Copy link
Contributor

@yiwu0b11 yiwu0b11 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! I am not very familiar with iOS process calls.

Copy link
Contributor

@yiwu0b11 yiwu0b11 left a comment

Choose a reason for hiding this comment

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

LGTM, but please wait for someone to verify it on iOS.

Copy link
Contributor

@jroelofs jroelofs left a comment

Choose a reason for hiding this comment

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

LGTM with an include path fix.

tools/not.cpp Outdated
int main(int argc, const char **argv) {
#ifdef __APPLE__
#include <spawn.h>
#include <wait.h>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
#include <wait.h>
#include <sys/wait.h>

@tarunprabhu tarunprabhu merged commit d6b5c68 into llvm:main Jan 11, 2024
@tarunprabhu tarunprabhu deleted the fix-not-on-ios branch January 11, 2024 18:27
@jroelofs
Copy link
Contributor

thank you!

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.

4 participants