Fix the path for system C header includes to match the libdir suffix

Jan Kundrát jkt at flaska.net
Fri Dec 13 01:58:31 PST 2013


Hi,
on 64bit RHEL6, it is customary to put the stuff into /usr/lib64. The 
clang, however, uses hardcoded path when it looks for includes in 
$path_to_the_binary/../lib/clang/$version/, effectively making the 
-DLLVM_LIBDIR_SUFFIX break the produced compiler.

This patch makes sure that the LLVM_LIBDIR_SUFFIX build option is followed 
in this context. Without it, clang++ wasn't able to find e.g. <stddef.h> on 
my system.

The patch was made and tested against clang 3.3. However, I have checked 
the code in the latest trunk, and it is exactly the same, i.e. the "lib" is 
hardcoded in the resource dir autodetection. Therefore I believe that the 
patch applies to the trunk as well.

I've also noticed that some people apply even heavier patches, see e.g. 
[1]. However, such a modification was not needed on my system.

Could you please apply this patch? I would appreciate a Cc on responses as 
I'm not subscribed to the list.

With kind regards,
Jan

P.S.: Before j`ey on IRC pointed me on the right direction, I've created 
[2] on Phabricator as well.

[1] 
https://build.opensuse.org/package/view_file/home:rudi_m/llvm/llvm-config-lib64.patch?expand=1
[2] http://llvm-reviews.chandlerc.com/D2400

-- 
Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cfe-patch-libdir-suffix-includes.patch
Type: text/x-patch
Size: 1251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131213/fcae65fc/attachment.bin>


More information about the cfe-commits mailing list