This is an archive of the discontinued LLVM Phabricator instance.

[libc++][math.h] Remove __sun__ workarounds
AbandonedPublic

Authored by philnik on Dec 14 2022, 6:13 AM.

Details

Reviewers
ldionne
Group Reviewers
Restricted Project
Summary

These workarounds make it impractical to granularize math.h and we don't support Solaris anyways.

Diff Detail

Event Timeline

philnik created this revision.Dec 14 2022, 6:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 6:13 AM
philnik requested review of this revision.Dec 14 2022, 6:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 14 2022, 6:13 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Dec 14 2022, 6:17 AM

This is https://reviews.llvm.org/D138680 -- let's not duplicate this.

This revision now requires changes to proceed.Dec 14 2022, 6:17 AM

@jperkin Looking at https://github.com/illumos/illumos-gate/blob/master/usr/src/head/iso/math_iso.h (I hope that's the correct code) it seems trivial to remove the float/long double overloads when included through libc++, or add a macro like _ILLUMOS_NO_CPP_MATH_OVERLOADS to disable them. This would also make it a lot easier to implement P0533R9 on your platform, since you wouldn't have to do anything (at least with libc++) and make it a lot simpler for libc++ to move the code around without having to add workarounds. I didn't look at what you do with libstdc++, but I'd be surprised if it wasn't easier to let them provide the overloads as well.

This is https://reviews.llvm.org/D138680 -- let's not duplicate this.

I wouldn't consider this a duplicate. It's a subset of what you try to do in D138680. Here I only remove workarounds that are problematic to changes I want to make to libc++ while D138680 removes all support code for Solaris (and derivatives). For the workarounds I want to remove I also propose a proper fix on the Illumos side of things (I assume other Solaris versions can be fixed in a similar way), see my previous comment.

Please see my latest comment in D138680. I don't want us to go halfway since that's just pushing the pain further down the road. We either support Solaris or we don't, and if we don't, I see no reason to remove some but not all the workarounds for that platform.

And if we do, then this patch can't ship as-is because it'll break Solaris, which we would then support.

philnik abandoned this revision.Dec 14 2022, 12:30 PM