This is an archive of the discontinued LLVM Phabricator instance.

[libc] add basic Intel MacOS configuration
ClosedPublic

Authored by michaelrj on Mar 1 2023, 11:39 AM.

Details

Summary

The config is based on the ARM MacOS config, but with fenv and math
functions disabled.

This should unblock this bug: https://github.com/llvm/llvm-project/issues/60910

Diff Detail

Event Timeline

michaelrj created this revision.Mar 1 2023, 11:39 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMar 1 2023, 11:39 AM
michaelrj requested review of this revision.Mar 1 2023, 11:39 AM
sivachandra added inline comments.Mar 1 2023, 11:45 AM
libc/src/__support/FPUtil/FEnvImpl.h
26

The !defined(__APPLE__) above and this condition here are opposites? Irrespective, can we use a model like the AARCH64 one?

#elif defined(LIBC_TARGET_ARCH_IS_X86)
#if defined(__APPLE__)
#error ...
#else
#include <x86_64/FEnvImpl.h>
#endif
#endif
michaelrj updated this revision to Diff 501674.Mar 1 2023, 2:48 PM

add comment explaining the fenv condition

libc/src/__support/FPUtil/FEnvImpl.h
26

The reason I have it like this for the moment is because I want it to use the dummy functions, and for that to work it needs to pass over both the aarch64 and x86_64 conditions. In future I'd like to have a specific fenv implementation for darwin x86_64, but that's beyond the scope of this patch. I've added a comment to explain.

I can't tell it to error if it detects x86_64 MacOS, since there are some tests that aren't part of any entrypoint but include fenv, specifically the printf_core converter tests.

sivachandra accepted this revision.Mar 1 2023, 3:01 PM
sivachandra added inline comments.
libc/src/__support/FPUtil/FEnvImpl.h
32

This #if is serving no purpose then. Just remove it.

This revision is now accepted and ready to land.Mar 1 2023, 3:01 PM
michaelrj updated this revision to Diff 501682.Mar 1 2023, 3:24 PM
michaelrj marked an inline comment as done.

remove redundant condition before landing

This revision was landed with ongoing or failed builds.Mar 1 2023, 3:33 PM
This revision was automatically updated to reflect the committed changes.