dev-util/include-what-you-use: worjaround <stddef.h> lookup failure, bug #625972
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 29 Jul 2017 17:34:08 +0000 (18:34 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 29 Jul 2017 17:34:41 +0000 (18:34 +0100)
commitc3759ec007c6cda0a7c1100247d455f33a2a1314
tree5dbba3a6361006f556da77a7e0ee489e0ed48cc9
parent5389e75aeb9820df1b51852d3868a83f0c727bd0
dev-util/include-what-you-use: worjaround <stddef.h> lookup failure, bug #625972

libclangDriver treats path to include files as stable relative
to clang binary: when we run /usr/lib64/llvm/4/bin/clang it resolves
<stddef.h> the following way:
    "/usr/lib64/llvm/4/bin/" + "../../../../lib/clang/4.0.1/include/stddef.h"

Unfortunately when someone reuses clang driver to build a new tool
heared lookup breaks if final tool resides in "/usr/bin":
    "/usr/bin/" + "../../../../lib/clang/4.0.1/include/stddef.h"
causing file open failures in case of include-what-you-use:
    /usr/include/wchar.h:39:11: fatal error: 'stdarg.h' file not found
    # include <stdarg.h>
              ^~~~~~~~~~

The workaround is to install executable to the same directory as clang itself.

Reported-by: MichaƂ Bartoszkiewicz
Bug: https://bugs.gentoo.org/625972
Package-Manager: Portage-2.3.6, Repoman-2.3.3
dev-util/include-what-you-use/include-what-you-use-4.0-r1.ebuild [new file with mode: 0644]