This is an archive of the discontinued LLVM Phabricator instance.

[libc][darwin] Add OSUtil for darwin arm64 target so that unit tests can be run.
ClosedPublic

Authored by lntue on May 24 2023, 2:28 PM.

Details

Summary

Currently unit tests cannot be run on macOS due to missing OSUtil.

Diff Detail

Event Timeline

lntue created this revision.May 24 2023, 2:28 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 24 2023, 2:28 PM
lntue requested review of this revision.May 24 2023, 2:28 PM
lntue updated this revision to Diff 525595.May 25 2023, 7:23 AM

Fix a conditional inclusion in syscall.h

michaelrj added inline comments.May 25 2023, 3:19 PM
libc/src/__support/OSUtil/darwin/io.h
19

can we use the macro name if we include <sys/syscall.h>?

lntue added inline comments.May 25 2023, 4:04 PM
libc/src/__support/OSUtil/darwin/io.h
19

The syscall in macOS is a bit tricky. Technically they are not public API in macOS, since you are supposed to make syscalls via the system libc syscall wrappers. So the system header sys/syscall.h is not guaranteed to be available. On the other hand, these low numbered syscalls are matched with Unix and barely changed, so it is kind of safe to call these.

This revision is now accepted and ready to land.May 25 2023, 4:04 PM