This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Support FreeBSD standalone (boot) environment
ClosedPublic

Authored by jrtc27 on Jan 22 2021, 1:16 PM.

Details

Summary

FreeBSD uses -Ddouble=jagged-little-pill -Dfloat=floaty-mcfloatface to
poison uses of floating point in its standalone environment. It also
deprecates machine/limits.h in favour of sys/limits.h and does not even
provide the former on newer architectures.

This is a cleaner reimplementation of equivalent patches in FreeBSD's
vendored copy of compiler-rt.

Diff Detail

Event Timeline

jrtc27 created this revision.Jan 22 2021, 1:16 PM
jrtc27 requested review of this revision.Jan 22 2021, 1:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 22 2021, 1:16 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
dim accepted this revision.Jan 22 2021, 1:22 PM

LGTM.

compiler-rt/lib/builtins/int_types.h
164

To avoid this repetition, maybe we should conditionally define something like CRT_HAS_FLOATING_POINT at the top of the file (for now under #if !(defined(__FreeBSD__) && defined(_STANDALONE)), and check #if CRT_HAS_FLOATING_POINT here and in the previous instance?

This revision is now accepted and ready to land.Jan 22 2021, 1:22 PM
jrtc27 added inline comments.Jan 22 2021, 1:24 PM
compiler-rt/lib/builtins/int_types.h
164

I thought about it but it was only two uses and didn't want to have to come up with a sensible name. But yes, that's probably nicer, will update.

jrtc27 updated this revision to Diff 318637.Jan 22 2021, 1:26 PM

Introduce CRT_HAS_FLOATING_POINT macro to avoid code duplication

jrtc27 marked an inline comment as done.Jan 22 2021, 1:27 PM
This revision was landed with ongoing or failed builds.Jan 27 2021, 7:30 AM
This revision was automatically updated to reflect the committed changes.