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/
--- ./cfe-3.3.src/include/clang/Config/config.h.in.orig	2013-12-13 00:15:37.483349816 +0100
+++ ./cfe-3.3.src/include/clang/Config/config.h.in	2013-12-13 00:16:12.122978674 +0100
@@ -21,4 +21,7 @@
 /* Directory where gcc is installed. */
 #undef GCC_INSTALL_PREFIX
 
+/* Suffix of the libdir (typically "64" on a 64bit system) */
+#undef LLVM_LIBDIR_SUFFIX
+
 #endif
--- ./cfe-3.3.src/include/clang/Config/config.h.cmake.orig	2013-12-12 23:52:58.241919889 +0100
+++ ./cfe-3.3.src/include/clang/Config/config.h.cmake	2013-12-12 23:54:06.665185486 +0100
@@ -12,3 +12,6 @@
 
 /* Directory where gcc is installed. */
 #define GCC_INSTALL_PREFIX "${GCC_INSTALL_PREFIX}"
+
+/* Suffix of the libdir (typically "64" on a 64bit system) */
+#define LLVM_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
--- ./cfe-3.3.src/lib/Driver/Driver.cpp.orig	2013-12-12 23:54:29.407941341 +0100
+++ ./cfe-3.3.src/lib/Driver/Driver.cpp	2013-12-13 00:14:32.727043343 +0100
@@ -66,7 +66,7 @@
   if (ClangResourceDir != "")
     llvm::sys::path::append(P, ClangResourceDir);
   else
-    llvm::sys::path::append(P, "..", "lib", "clang", CLANG_VERSION_STRING);
+    llvm::sys::path::append(P, "..", "lib" LLVM_LIBDIR_SUFFIX, "clang", CLANG_VERSION_STRING);
   ResourceDir = P.str();
 }
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to