Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

opencl-c.h lookup fails, CLANG_RESOURCES_DIR determined at compile time #747

Open
StefanBruens opened this issue Jul 28, 2019 · 1 comment

Comments

@StefanBruens
Copy link

@StefanBruens StefanBruens commented Jul 28, 2019

The resources dir, containing opnecl-c.h is fixed at compile time:

ClangResourceDir = CLANG_RESOURCE_DIR;

If libclang gets a minor version upgrade later (e.g. from 8.0.0 to 8.0.1), the header is still searched for in the old location (e.g. /usr/lib64/clang/8.0.0/include/opencl-c.h). As the SOVERSION is unchanged, is is typically not picked up by the regular dependency mechanisms.

Related Debian bug report:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903822

With LLVM master (> 8.0), the Resources patch can be queried with llvm::driver::Driver::GetResourcesPath(binarydir)
llvm-mirror/clang@8b23535

StefanBruens added a commit to StefanBruens/pocl that referenced this issue Jul 29, 2019
When the resources dir is determined at compile time, it also includes
the full version (e.g. /usr/lib64/clang/8.0.0/include/opencl-c.h). If
clang gets a minor version update later (e.g. from 8.0.0 to 8.0.1), pocl
will still add the obsolete path for the header lookup.

Determine the path at runtime instead. LLVM 9.0 adds a static method
llvm::driver::Driver::GetResourcesPath(...) which can be used, LLVM 8.0
and older have to use a dummy Driver instance.

Fixes pocl#747.
franz pushed a commit to franz/pocl that referenced this issue Aug 1, 2019
@franz

This comment has been minimized.

Copy link
Contributor

@franz franz commented Aug 1, 2019

Thanks, i've forward-ported this to master branch.

franz pushed a commit to franz/pocl that referenced this issue Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.