Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 614872 - dev-qt/qt-creator does not pick clang headers dirs correctly
Summary: dev-qt/qt-creator does not pick clang headers dirs correctly
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor
Assignee: Davide Pesavento (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-06 18:28 UTC by pa.lacaze
Modified: 2017-04-29 19:48 UTC (History)
3 users (show)

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


Attachments
Fix incorrectly assumed clang resource path (gentoo-clang-nonstandard-path.diff,509 bytes, patch)
2017-04-06 18:28 UTC, pa.lacaze
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pa.lacaze 2017-04-06 18:28:24 UTC
Created attachment 469352 [details, diff]
Fix incorrectly assumed clang resource path

From at least clang 4.0, gentoo installs clang resources in a non default path, i.e. in /usr/lib/clang instead of /usr/lib/llvm/4/lib/clang. Qt Creator assumes the default path for its clang code model.

The attached patch fixes the problem.

The real fix would be to query clang install path, but there does not seem to be a clang equivalent to llvm-config.
Comment 1 pa.lacaze 2017-04-06 18:32:08 UTC
Also maybe clang'e ebuild could add something like
ln -s /usr/lib/clang /usr/lib/llvm/4/lib64/clang
to ensure that packages assuming the default installation path work correctly somehow.
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-04-08 08:00:54 UTC
/usr/lib/clang is actually the default path. A number of things hardcodes that.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-04-08 08:01:35 UTC
There's 'clang -print-resource-dir' upstream can use to get the correct dir.
Comment 4 pa.lacaze 2017-04-08 11:38:12 UTC
Oh I see what happens, Qt Creator expects llvm and clang to share the same install prefix. I was mislead by my own tests at compiling clang and llvm by hand, because I used the exact same convention.
Comment 5 Davide Pesavento (RETIRED) gentoo-dev 2017-04-08 15:24:36 UTC
(In reply to Michał Górny from comment #3)
> There's 'clang -print-resource-dir' upstream can use to get the correct dir.

$ clang -print-resource-dir
clang-4.0: error: unknown argument: '-print-resource-dir'
clang-4.0: error: no input files

Can we simply use /usr/lib instead of $LLVM_LIBDIR?
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-04-08 16:02:58 UTC
Yes, that's reliable for Gentoo.
Comment 7 Davide Pesavento (RETIRED) gentoo-dev 2017-04-28 14:34:28 UTC
@llvm, in addition to the above, I guess I should use get_llvm_prefix from llvm.eclass instead of a plain `llvm-config --prefix`, right?
Comment 8 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-04-28 14:54:49 UTC
(In reply to Davide Pesavento from comment #7)
> @llvm, in addition to the above, I guess I should use get_llvm_prefix from
> llvm.eclass instead of a plain `llvm-config --prefix`, right?

Yes, that would be preferable. It is acceptable not to use the eclass if you always support the newest slot (which gives the same result then).