[PATCH] D135663: [libunwind] Install the headers by default

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 11 08:10:46 PDT 2023


aaron.ballman added a comment.

In D135663#4332576 <https://reviews.llvm.org/D135663#4332576>, @ldionne wrote:

> In D135663#4332558 <https://reviews.llvm.org/D135663#4332558>, @barannikov88 wrote:
>
>> The commit also says that there are no incompatibilities. May be it was true at that time,
>> but the headers currently diverge. Even _Unwind_Exception definitions are different:
>
> Hmm, yeah, I guess that was unavoidable and it's pretty bad.
>
>> IMO clang's unwind.h should be as good as deleted.
>
> FWIW that would also be my immediate reaction -- I'm not sure why it would make much sense for Clang to provide the header associated to another library.
>
>> However, @aaron.ballman suggested on discord that it might be there for use with -ffreestanding. Can that make sense?
>
> I am not sure why a freestanding implementation would require `<unwind.h>`, but if it does, then my reflex would be to say that it should get it from its unwinder library (aka `libunwind` or other). In my mind, freestanding is not the same as "no runtime libraries". If you are in freestanding and you still want exceptions, you'll need some unwind library to support that no matter what.
>
> So naively, I'd be fine with removing the Clang version, but I wouldn't be surprised if there's a bunch of reasons why this can't work. If you want, you could create a review and we can have a discussion and ping the right people on it.

Ah, sorry for introducing confusion. IIRC, I was speaking more generally about why we provide headers and then include_next to the system from them (we do that sometimes so we can provide macros in freestanding but then defer to the system for hosted). I don't know if we have any freestanding needs for `<unwind.h>`. When we discussed freestanding recently, I think we were heading towards consensus that we expect users to provide a freestanding-compatible libc implementation like we already expect them to do for hosted; the compiler headers should only be producing simple macros or calls to intrinsics. So that matches what @ldionne says about freestanding not meaning "no runtime library".


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135663/new/

https://reviews.llvm.org/D135663



More information about the llvm-commits mailing list