diff --git a/cmake-add-missing-files.patch b/cmake-add-missing-files.patch new file mode 100644 index 0000000000000000000000000000000000000000..a496e94dc808413f88ee82f731add8afa7a8ec2c --- /dev/null +++ b/cmake-add-missing-files.patch @@ -0,0 +1,93 @@ +From 08fdef57baeea14854aa356ccbccf7461c7e8635 Mon Sep 17 00:00:00 2001 +From: Liu Zixian +Date: Fri, 18 Feb 2022 23:22:57 +0800 +Subject: [PATCH] cmake: add missing files + +We are building llvm, but it uses some cmake file from llvm-project. +These files are: +https://github.com/llvm/llvm-project/blob/main/cmake/Modules/ExtendPath.cmake +https://github.com/llvm/llvm-project/blob/main/cmake/Modules/FindPrefixFromConfig.cmake + +Signed-off-by: Liu Zixian +--- + cmake/modules/ExtendPath.cmake | 19 +++++++++++ + cmake/modules/FindPrefixFromConfig.cmake | 41 ++++++++++++++++++++++++ + 2 files changed, 60 insertions(+) + create mode 100644 cmake/modules/ExtendPath.cmake + create mode 100644 cmake/modules/FindPrefixFromConfig.cmake + +diff --git a/cmake/modules/ExtendPath.cmake b/cmake/modules/ExtendPath.cmake +new file mode 100644 +index 00000000..0dd6a4d3 +--- /dev/null ++++ b/cmake/modules/ExtendPath.cmake +@@ -0,0 +1,19 @@ ++# Extend the path in `base_path` with the path in `current_segment`, returning ++# the result in `joined_path`. If `current_segment` is an absolute path then ++# just return it, in effect overriding `base_path`, and issue a warning. ++# ++# Note that the code returns a relative path (avoiding introducing leading ++# slashes) if `base_path` is empty. ++function(extend_path joined_path base_path current_segment) ++ if("${current_segment}" STREQUAL "") ++ set(temp_path "${base_path}") ++ elseif("${base_path}" STREQUAL "") ++ set(temp_path "${current_segment}") ++ elseif(IS_ABSOLUTE "${current_segment}") ++ message(WARNING "Since \"${current_segment}\" is absolute, it overrides base path: \"${base_path}\".") ++ set(temp_path "${current_segment}") ++ else() ++ set(temp_path "${base_path}/${current_segment}") ++ endif() ++ set(${joined_path} "${temp_path}" PARENT_SCOPE) ++endfunction() +diff --git a/cmake/modules/FindPrefixFromConfig.cmake b/cmake/modules/FindPrefixFromConfig.cmake +new file mode 100644 +index 00000000..aa9fb0d0 +--- /dev/null ++++ b/cmake/modules/FindPrefixFromConfig.cmake +@@ -0,0 +1,41 @@ ++# Find the prefix from the `*Config.cmake` file being generated. ++# ++# When generating an installed `*Config.cmake` file, we often want to be able ++# to refer to the ancestor directory which contains all the installed files. ++# ++# We want to do this without baking in an absolute path when the config file is ++# generated, in order to allow for a "relocatable" binary distribution that ++# doesn't need to know what path it ends up being installed at when it is ++# built. ++# ++# The solution that we know the relative path that the config file will be at ++# within that prefix, like `"${prefix_var}/lib/cmake/${project}"`, so we count ++# the number of components in that path to figure out how many parent dirs we ++# need to traverse from the location of the config file to get to the prefix ++# dir. ++# ++# out_var: ++# variable to set the "return value" of the function, which is the code to ++# include in the config file under construction. ++# ++# prefix_var: ++# Name of the variable to define in the returned code (not directory for the ++# faller!) that will contain the prefix path. ++# ++# path_to_leave: ++# Path from the prefix to the config file, a relative path which we wish to ++# go up and out from to find the prefix directory. ++function(find_prefix_from_config out_var prefix_var path_to_leave) ++ set(config_code ++ "# Compute the installation prefix from this LLVMConfig.cmake file location." ++ "get_filename_component(${prefix_var} \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)") ++ # Construct the proper number of get_filename_component(... PATH) ++ # calls to compute the installation prefix. ++ string(REGEX REPLACE "/" ";" _count "${path_to_leave}") ++ foreach(p ${_count}) ++ list(APPEND config_code ++ "get_filename_component(${prefix_var} \"\${${prefix_var}}\" PATH)") ++ endforeach(p) ++ string(REPLACE ";" "\n" config_code "${config_code}") ++ set("${out_var}" "${config_code}" PARENT_SCOPE) ++endfunction() +-- +2.34.1 + diff --git a/llvm-10.0.1.src.tar.xz b/llvm-14.0.0rc1.src.tar.xz old mode 100644 new mode 100755 similarity index 63% rename from llvm-10.0.1.src.tar.xz rename to llvm-14.0.0rc1.src.tar.xz index 973b4a99fa98aaa4c7637c4be6e6fd04de141392..a2995b91d986c29caa0a2ca701f9cc08c83b4483 Binary files a/llvm-10.0.1.src.tar.xz and b/llvm-14.0.0rc1.src.tar.xz differ diff --git a/llvm.spec b/llvm.spec index c2eab08956bdf3227dcba75bcf9f89fdacc1b5c7..9a2f7de6c2e2506236d76c986e246c572b552882 100644 --- a/llvm.spec +++ b/llvm.spec @@ -1,10 +1,11 @@ Name: llvm -Version: 10.0.1 -Release: 4 +Version: 14.0.0rc1 +Release: 1 Summary: The Low Level Virtual Machine License: NCSA URL: http://llvm.org Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz +Patch0: cmake-add-missing-files.patch BuildRequires: gcc gcc-c++ cmake ninja-build zlib-devel libffi-devel ncurses-devel libstdc++-static BuildRequires: python3-sphinx binutils-devel valgrind-devel libedit-devel python3-devel @@ -196,6 +197,9 @@ fi %{_mandir}/man1/* %changelog +* Fri Feb 18 2022 Liu Zixian - 14.0.0-1 +- Update to 14.0.0-rc1 + * Wed Oct 15 2021 zhangweiguo - 10.0.1-4 - Disabe DLLVM_BUILD_TEST