--- /dev/null
+diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
+index fa7780f..e3a6c8f 100644
+--- a/tools/clang/lib/Driver/Driver.cpp
++++ b/tools/clang/lib/Driver/Driver.cpp
+@@ -66,8 +66,7 @@ Driver::Driver(StringRef ClangExecutable, StringRef DefaultTargetTriple,
+ if (ClangResourceDir != "") {
+ llvm::sys::path::append(P, ClangResourceDir);
+ } else {
+- StringRef ClangLibdirSuffix(CLANG_LIBDIR_SUFFIX);
+- llvm::sys::path::append(P, "..", Twine("lib") + ClangLibdirSuffix, "clang",
++ llvm::sys::path::append(P, "..", "lib", "clang",
+ CLANG_VERSION_STRING);
+ }
+ ResourceDir = P.str();
+diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
+index f078b37..0c514fc 100644
+--- a/tools/clang/lib/Frontend/CompilerInvocation.cpp
++++ b/tools/clang/lib/Frontend/CompilerInvocation.cpp
+@@ -1097,7 +1097,7 @@ std::string CompilerInvocation::GetResourcesPath(const char *Argv0,
+ if (ClangResourceDir != "")
+ llvm::sys::path::append(P, ClangResourceDir);
+ else
+- llvm::sys::path::append(P, "..", Twine("lib") + CLANG_LIBDIR_SUFFIX,
++ llvm::sys::path::append(P, "..", "lib", "clang",
+ "clang", CLANG_VERSION_STRING);
+
+ return P.str();
+diff --git a/lib/Headers/CMakeLists.txt b/lib/Headers/CMakeLists.txt
+index 7de5fbe..49f439b 100644
+--- a/tools/clang/lib/Headers/CMakeLists.txt
++++ b/tools/clang/lib/Headers/CMakeLists.txt
+@@ -98,4 +98,4 @@ set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
+ install(
+ FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
+ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+- DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
++ DESTINATION lib/clang/${CLANG_VERSION}/include)
--- /dev/null
+--- a/CMakeLists.txt 2015-08-12 20:04:55.397881480 +0200
++++ b/CMakeLists.txt 2015-08-12 20:05:06.625741113 +0200
+@@ -152,11 +152,6 @@
+
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+
+-if (CMAKE_BUILD_TYPE AND
+- NOT uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)$")
+- message(FATAL_ERROR "Invalid value for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
+-endif()
+-
+ set(LLVM_LIBDIR_SUFFIX "" CACHE STRING "Define suffix of library directory name (32/64)" )
+
+ # They are used as destination of target generators.
# https://llvm.org/bugs/show_bug.cgi?id=18341
epatch "${FILESDIR}"/cmake/0004-cmake-Do-not-install-libgtest.patch
+ # Allow custom cmake build types (like 'Gentoo')
+ epatch "${FILESDIR}"/cmake/${PN}-3.8-allow_custom_cmake_build_types.patch
+
if use clang; then
# Automatically select active system GCC's libraries, bugs #406163 and #417913
epatch "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
# Install clang runtime into /usr/lib/clang
# https://llvm.org/bugs/show_bug.cgi?id=23792
- epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix.patch
+ epatch "${FILESDIR}"/cmake/clang-0001-Install-clang-runtime-into-usr-lib-without-suffix-3.8.patch
epatch "${FILESDIR}"/cmake/compiler-rt-0001-cmake-Install-compiler-rt-into-usr-lib-without-suffi.patch
# Make it possible to override CLANG_LIBDIR_SUFFIX
# (that is used only to find LLVMgold.so)
# https://llvm.org/bugs/show_bug.cgi?id=23793
epatch "${FILESDIR}"/cmake/clang-0002-cmake-Make-CLANG_LIBDIR_SUFFIX-overridable.patch
+
+ # Workaround bug #553416 until upstream fixes it
+ epatch "${FILESDIR}"/clang-3.7-strip_doc_refs.patch
fi
if use lldb; then