Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 592694 - sys-libs/llvm-libunwind does not install headers
Summary: sys-libs/llvm-libunwind does not install headers
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-01 20:56 UTC by Michał Górny
Modified: 2016-10-27 09:31 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-09-01 20:56:44 UTC
./
./usr/
./usr/lib64/
./usr/lib64/libunwind.a
./usr/lib64/libunwind.so.1.0
./usr/lib64/libunwind.so
./usr/lib64/libunwind.so.1
>>> Done.


It is really wrong to install the library with no headers...

@zzlei, could you figure out which headers should be installed, make a patch to add appropriate install() and upstream it?
Comment 1 zhanglei.april 2016-09-02 03:07:17 UTC
(In reply to Michał Górny from comment #0)
> ./
> ./usr/
> ./usr/lib64/
> ./usr/lib64/libunwind.a
> ./usr/lib64/libunwind.so.1.0
> ./usr/lib64/libunwind.so
> ./usr/lib64/libunwind.so.1
> >>> Done.
> 
> 
> It is really wrong to install the library with no headers...
> 
> @zzlei, could you figure out which headers should be installed, make a patch
> to add appropriate install() and upstream it?
Oh I see. It didn't bite me yet because libc++abi/libcxxrt managed to find the required headers from gcc.

BTW, it turns libc++abi/libcxxrt don't install their headers either; it's manually handled with `instinto` in the ebuilds.
Comment 2 zhanglei.april 2016-09-02 03:33:17 UTC
Actually libc++abi only uses one header from libunwind: unwind.h.

And it turns out that gcc and clang both have their own version of unwind.h. So even if libunwind's headers aren't properly installed, libc++abi/libcxxrt manage to build anyway. And it's possible that clang/gcc's unwind.h is used prior to libunwind's, rendering the latter pointless.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-09-02 04:48:41 UTC
If llvm-libunwind's going to be a replacement for GNU libunwind, it needs to install headers. clang is not the only package using it. Extra points for testing if other packages work with it.

https://qa-reports.gentoo.org/output/genrdeps/rindex/sys-libs/libunwind
Comment 4 zhanglei.april 2016-09-02 05:48:39 UTC
(In reply to Michał Górny from comment #3)
> If llvm-libunwind's going to be a replacement for GNU libunwind, it needs to
> install headers. clang is not the only package using it. Extra points for
> testing if other packages work with it.
> 
> https://qa-reports.gentoo.org/output/genrdeps/rindex/sys-libs/libunwind

Correction: libunwind is not part of GNU. It's stated on the front page: https://savannah.nongnu.org/projects/libunwind/

I'm not sure if other packages also use unwind.h or they simply use the library, but it seems wrong to install unwind.h in /usr/include. It would simply be overridden by clang/gcc's counterpart because /usr/include is the lowest priority in the search order.

The headers should be installed to /usr/include/libunwind and, when used, explicitly prepended to the search list.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-09-02 13:04:00 UTC
(In reply to Lei Zhang from comment #4)
> (In reply to Michał Górny from comment #3)
> > If llvm-libunwind's going to be a replacement for GNU libunwind, it needs to
> > install headers. clang is not the only package using it. Extra points for
> > testing if other packages work with it.
> > 
> > https://qa-reports.gentoo.org/output/genrdeps/rindex/sys-libs/libunwind
> 
> Correction: libunwind is not part of GNU. It's stated on the front page:
> https://savannah.nongnu.org/projects/libunwind/
> 
> I'm not sure if other packages also use unwind.h or they simply use the
> library, but it seems wrong to install unwind.h in /usr/include. It would
> simply be overridden by clang/gcc's counterpart because /usr/include is the
> lowest priority in the search order.
> 
> The headers should be installed to /usr/include/libunwind and, when used,
> explicitly prepended to the search list.

Don't go further than necessary. I've looked at the LLVM announcement for libunwind, and I know a little more now. So it seems that libunwind from Apple (LLVM) is backwards-compatible with the one from HP (non-GNU) but implemented an additional, new API. They are not binary-compatible.

This means that:

1. The two packages should block each other (if they don't do that already).

2. The two packages should install headers alike (i.e. directly to /usr/include). The patch for this should go upstream.

3. The deps on the packages must not be in || () since they are not binary-compatible. Instead, you must use USE flags in packages to switch between the two, or a virtual preferring one of the implementations.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-10-27 09:31:58 UTC
commit a499a225bb7e5ddd8c2478fbe804e6cbfac212c5
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: Thu Oct 6 14:40:11 2016
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: Thu Oct 6 15:28:53 2016

    sys-libs/llvm-libunwind: Install headers, req for #596340