mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-06-13 08:52:42 +00:00
Merge branch 'cmake-fixes' into '5.0'
Make Clang cmake files more usable See merge request pkg-llvm-team/llvm-toolchain!2
This commit is contained in:
commit
4945e7924f
15
debian/changelog
vendored
15
debian/changelog
vendored
@ -1,3 +1,18 @@
|
||||
llvm-toolchain-5.0 (1:5.0.2~svn328729-1~exp1) UNRELEASED; urgency=medium
|
||||
|
||||
* Make CMake find_package(Clang) work. Fixes upstream bug
|
||||
https://bugs.llvm.org/show_bug.cgi?id=37128
|
||||
- Move Clang*.cmake back to /usr/lib/llvm-X.Y/lib/cmake/clang and install a
|
||||
symlink in /usr/lib/cmake/clang-X.Y.
|
||||
- Ensure that the LLVM installation prefix is correctly discovered despire
|
||||
symlinks (replaces fix-cmake-config-prefix.diff).
|
||||
- Create /usr/lib/llvm-X.Y/bin/clang-X.Y symlink as required by
|
||||
ClangTargets-relwithdebinfo.cmake.
|
||||
- Remove useless LLVM_CMAKE_DIR sed command that did not match anything.
|
||||
- Ignore missing binaries in ClangTargets-relwithdebinfo.cmake.
|
||||
|
||||
-- Peter Wu <peter@lekensteyn.nl> Sun, 06 May 2018 17:42:16 +0200
|
||||
|
||||
llvm-toolchain-5.0 (1:5.0.2-1) unstable; urgency=medium
|
||||
|
||||
* New stable release (Spectre Mitigation)
|
||||
|
2
debian/clang-X.Y.install.in
vendored
2
debian/clang-X.Y.install.in
vendored
@ -3,7 +3,7 @@ usr/lib/llvm-@LLVM_VERSION@/bin/clang++
|
||||
usr/lib/llvm-@LLVM_VERSION@/bin/clang-cpp
|
||||
|
||||
#usr/share/man/man1/clang.1 usr/share/man/man1/
|
||||
usr/lib/llvm-@LLVM_VERSION@/lib/cmake/clang/*.cmake usr/share/llvm-@LLVM_VERSION@/cmake/
|
||||
usr/lib/llvm-@LLVM_VERSION@/lib/cmake/clang/*.cmake
|
||||
usr/lib/llvm-@LLVM_VERSION@/share/clang/bash-autocomplete.sh
|
||||
|
||||
usr/bin/clang-@LLVM_VERSION@
|
||||
|
2
debian/clang-X.Y.links.in
vendored
Normal file
2
debian/clang-X.Y.links.in
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
usr/lib/llvm-@LLVM_VERSION@/bin/clang usr/lib/llvm-@LLVM_VERSION@/bin/clang-@LLVM_VERSION@
|
||||
usr/lib/llvm-@LLVM_VERSION@/lib/cmake/clang usr/lib/cmake/clang-@LLVM_VERSION@
|
34
debian/patches/0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch
vendored
Normal file
34
debian/patches/0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
From d0d969074f6e0f975ad53d21e7ce6c7b40cf2957 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Wu <peter@lekensteyn.nl>
|
||||
Date: Fri, 4 May 2018 15:43:06 +0200
|
||||
Subject: [PATCH] [llvm] cmake: resolve symlinks in LLVMConfig.cmake
|
||||
|
||||
Ensure that symlinks such as /usr/lib/llvm-X.Y/cmake (pointing to
|
||||
lib/cmake/llvm) are resolved. This ensures that LLVM_INSTALL_PREFIX
|
||||
becomes /usr/lib/llvm-X.Y instead of /usr.
|
||||
|
||||
Partially addresses PR37128
|
||||
---
|
||||
cmake/modules/CMakeLists.txt | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
|
||||
index 6074e835859..1cf4569b884 100644
|
||||
--- a/cmake/modules/CMakeLists.txt
|
||||
+++ b/cmake/modules/CMakeLists.txt
|
||||
@@ -76,10 +76,10 @@ file(COPY .
|
||||
# Generate LLVMConfig.cmake for the install tree.
|
||||
set(LLVM_CONFIG_CODE "
|
||||
# Compute the installation prefix from this LLVMConfig.cmake file location.
|
||||
-get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
|
||||
+get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
|
||||
# Construct the proper number of get_filename_component(... PATH)
|
||||
# calls to compute the installation prefix.
|
||||
-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
|
||||
+string(REGEX REPLACE "/" ";" _count "prefix/${LLVM_INSTALL_PACKAGE_DIR}")
|
||||
foreach(p ${_count})
|
||||
set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
|
||||
get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
|
||||
--
|
||||
2.17.0
|
||||
|
34
debian/patches/0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
vendored
Normal file
34
debian/patches/0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
vendored
Normal file
@ -0,0 +1,34 @@
|
||||
From c830d84bc802ca1e9219415a5784c4ad97a34819 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Wu <peter@lekensteyn.nl>
|
||||
Date: Fri, 4 May 2018 15:55:26 +0200
|
||||
Subject: [PATCH] [clang] cmake: resolve symlinks in ClangConfig.cmake
|
||||
|
||||
Ensure that symlinks such as /usr/lib/cmake/clang-X.Y (pointing to
|
||||
/usr/lib/llvm-X.Y/lib/cmake/llvm) are resolved. This ensures that
|
||||
CLANG_INSTALL_PREFIX ends up to be /usr/lib/llvm-X.Y instead of /usr.
|
||||
|
||||
Partially addresses PR37128
|
||||
---
|
||||
cmake/modules/CMakeLists.txt | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
|
||||
index be6d1d7257..bcb61f6cc8 100644
|
||||
--- a/clang/cmake/modules/CMakeLists.txt
|
||||
+++ b/clang/cmake/modules/CMakeLists.txt
|
||||
@@ -30,10 +30,10 @@ set(CLANG_CONFIG_EXPORTS_FILE)
|
||||
# Generate ClangConfig.cmake for the install tree.
|
||||
set(CLANG_CONFIG_CODE "
|
||||
# Compute the installation prefix from this LLVMConfig.cmake file location.
|
||||
-get_filename_component(CLANG_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
|
||||
+get_filename_component(CLANG_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" REALPATH)")
|
||||
# Construct the proper number of get_filename_component(... PATH)
|
||||
# calls to compute the installation prefix.
|
||||
-string(REGEX REPLACE "/" ";" _count "${CLANG_INSTALL_PACKAGE_DIR}")
|
||||
+string(REGEX REPLACE "/" ";" _count "prefix/${CLANG_INSTALL_PACKAGE_DIR}")
|
||||
foreach(p ${_count})
|
||||
set(CLANG_CONFIG_CODE "${CLANG_CONFIG_CODE}
|
||||
get_filename_component(CLANG_INSTALL_PREFIX \"\${CLANG_INSTALL_PREFIX}\" PATH)")
|
||||
--
|
||||
2.17.0
|
||||
|
27
debian/patches/fix-cmake-config-prefix.diff
vendored
27
debian/patches/fix-cmake-config-prefix.diff
vendored
@ -1,27 +0,0 @@
|
||||
## Description: add some description
|
||||
## Origin/Author: add some origin or author
|
||||
## Bug: bug URL
|
||||
---
|
||||
# cmake/modules/CMakeLists.txt | 11 +----------
|
||||
# 1 file changed, 1 insertion(+), 10 deletions(-)
|
||||
#
|
||||
--- a/cmake/modules/CMakeLists.txt
|
||||
+++ b/cmake/modules/CMakeLists.txt
|
||||
@@ -74,16 +74,7 @@ file(COPY .
|
||||
)
|
||||
|
||||
# Generate LLVMConfig.cmake for the install tree.
|
||||
-set(LLVM_CONFIG_CODE "
|
||||
-# Compute the installation prefix from this LLVMConfig.cmake file location.
|
||||
-get_filename_component(LLVM_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
|
||||
-# Construct the proper number of get_filename_component(... PATH)
|
||||
-# calls to compute the installation prefix.
|
||||
-string(REGEX REPLACE "/" ";" _count "${LLVM_INSTALL_PACKAGE_DIR}")
|
||||
-foreach(p ${_count})
|
||||
- set(LLVM_CONFIG_CODE "${LLVM_CONFIG_CODE}
|
||||
-get_filename_component(LLVM_INSTALL_PREFIX \"\${LLVM_INSTALL_PREFIX}\" PATH)")
|
||||
-endforeach(p)
|
||||
+set(LLVM_CONFIG_CODE "set(LLVM_INSTALL_PREFIX \"${CMAKE_INSTALL_PREFIX}\")")
|
||||
set(LLVM_CONFIG_INCLUDE_DIRS "\${LLVM_INSTALL_PREFIX}/include")
|
||||
set(LLVM_CONFIG_LIBRARY_DIRS "\${LLVM_INSTALL_PREFIX}/lib\${LLVM_LIBDIR_SUFFIX}")
|
||||
set(LLVM_CONFIG_CMAKE_DIR "\${LLVM_INSTALL_PREFIX}/${LLVM_INSTALL_PACKAGE_DIR}")
|
3
debian/patches/series
vendored
3
debian/patches/series
vendored
@ -28,7 +28,8 @@ clang-analyzer-force-version.diff
|
||||
install-scan-build-py.diff
|
||||
scan-view-fix-path.diff
|
||||
mips-fpxx-enable.diff
|
||||
fix-cmake-config-prefix.diff
|
||||
0001-llvm-cmake-resolve-symlinks-in-LLVMConfig.cmake.patch
|
||||
0001-tools-clang-cmake-resolve-symlinks-in-ClangConfig.cmake.patch
|
||||
lldb-link-atomic-cmake.patch
|
||||
disable-source-interleave.diff
|
||||
silent-gold-utils.diff
|
||||
|
24
debian/qualify-clang.sh
vendored
24
debian/qualify-clang.sh
vendored
@ -246,5 +246,29 @@ done
|
||||
echo "#include <objc/objc.h>" > foo.m
|
||||
clang-$VERSION -c foo.m
|
||||
|
||||
if test ! -f /usr/lib/llvm-$VERSION/lib/libclangBasic.a; then
|
||||
echo "Install libclang-$VERSION-dev"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf cmaketest && mkdir cmaketest
|
||||
cat > cmaketest/CMakeLists.txt <<EOF
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
project(SanityCheck)
|
||||
find_package(LLVM $VERSION REQUIRED CONFIG)
|
||||
message(STATUS "LLVM_CMAKE_DIR: \${LLVM_CMAKE_DIR}")
|
||||
if(NOT EXISTS "\${LLVM_TOOLS_BINARY_DIR}/clang")
|
||||
message(FATAL_ERROR "Invalid LLVM_TOOLS_BINARY_DIR: \${LLVM_TOOLS_BINARY_DIR}")
|
||||
endif()
|
||||
# TODO add version to ClangConfig.cmake and use $VERSION below
|
||||
find_package(Clang REQUIRED CONFIG)
|
||||
find_file(H clang/AST/ASTConsumer.h PATHS \${CLANG_INCLUDE_DIRS} NO_DEFAULT_PATH)
|
||||
message(STATUS "CLANG_INCLUDE_DIRS: \${CLANG_INCLUDE_DIRS}")
|
||||
if(NOT H)
|
||||
message(FATAL_ERROR "Invalid Clang header path: \${CLANG_INCLUDE_DIRS}")
|
||||
endif()
|
||||
EOF
|
||||
(cd cmaketest && cmake .)
|
||||
|
||||
echo "Completed"
|
||||
|
||||
|
6
debian/rules
vendored
6
debian/rules
vendored
@ -442,12 +442,12 @@ endif
|
||||
# Remove some license files
|
||||
rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/include/llvm/Support/LICENSE.TXT
|
||||
|
||||
# Change CMake module dir
|
||||
sed -i 's|LLVM_CMAKE_DIR "/usr/lib/llvm-$(LLVM_VERSION)/share/llvm/cmake"|LLVM_CMAKE_DIR "/usr/share/llvm-$(LLVM_VERSION)/cmake"|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMConfig.cmake
|
||||
|
||||
# Disable CMake's package validation checks for target files that we may remove.
|
||||
sed -i '/_IMPORT_CHECK_TARGETS \(Polly\|sancov\)/ {s|^|#|}' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/llvm/LLVMExports-*.cmake
|
||||
|
||||
# Disable CMake's package validation checks for binaries that may not be installed
|
||||
sed -i 's|.*_IMPORT_CHECK_FILES_FOR_.*/bin/.*)|#&|' $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/cmake/clang/ClangTargets-*.cmake
|
||||
|
||||
# Managed in python-lldb-X.Y.links.in
|
||||
rm -f $(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/python*/site-packages/lldb/_lldb.so
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user