Merge pull request !2 from syyhao/init
This commit is contained in:
openeuler-ci-bot 2020-01-13 09:23:17 +08:00 committed by Gitee
commit 0ebfd1c5ec
7 changed files with 8 additions and 280 deletions

View File

@ -1,27 +0,0 @@
From 1e0f1c5481a96d760f7840d4dde103353a0131f8 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Thu, 30 Aug 2018 11:38:51 -0700
Subject: [PATCH] CMake: Don't prefer python2.7
---
CMakeLists.txt | 4 ----
1 file changed, 4 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 31df640..2603f1c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -613,10 +613,6 @@ message(STATUS "LLVM default target triple: ${LLVM_DEFAULT_TARGET_TRIPLE}")
include(HandleLLVMOptions)
-# Verify that we can find a Python 2 interpreter. Python 3 is unsupported.
-# FIXME: We should support systems with only Python 3, but that requires work
-# on LLDB.
-set(Python_ADDITIONAL_VERSIONS 2.7)
include(FindPythonInterp)
if( NOT PYTHONINTERP_FOUND )
message(FATAL_ERROR
--
1.8.3.1

View File

@ -1,86 +0,0 @@
From f9e66a883e1fb748e6ac826fde188efaae249361 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Sat, 29 Apr 2017 02:03:23 +0000
Subject: [PATCH] CMake: Split static library exports into their own export
file
Summary:
This is to better support distros which split the static libraries into
their own package.
The current problem is that any project the includes LLVMConfig.cmake
will fail to configure unless the static libraries are installed. This
is because LLVMConfig.cmake includes LLVMExports.cmake, which throws an
error if it can't find files linked to one of the exported targets.
This patch resolves the problem by putting the static library targets
into their own export file, LLVMStaticExports.cmake. This file
is optionally included by LLVMConfig.cmake, so distros can put this
new file in their static library package to make LLVMConfig.cmake
no longer depend on these libraries when they are not installed.
Reviewers: beanz, mgorny, chapuni
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32668
---
cmake/modules/AddLLVM.cmake | 6 +++++-
cmake/modules/CMakeLists.txt | 3 +++
cmake/modules/LLVMConfig.cmake.in | 2 ++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index fd5627e..78f106f 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -635,7 +635,11 @@ macro(add_llvm_library name)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
- set(export_to_llvmexports EXPORT LLVMExports)
+ if (ARG_SHARED)
+ set(export_to_llvmexports EXPORT LLVMExports)
+ else()
+ set(export_to_llvmexports EXPORT LLVMStaticExports)
+ endif()
set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
endif()
diff --git a/cmake/modules/CMakeLists.txt b/cmake/modules/CMakeLists.txt
index 6074e83..e9fcb11 100644
--- a/cmake/modules/CMakeLists.txt
+++ b/cmake/modules/CMakeLists.txt
@@ -91,6 +91,7 @@ set(LLVM_CONFIG_BINARY_DIR "\${LLVM_INSTALL_PREFIX}")
set(LLVM_CONFIG_TOOLS_BINARY_DIR "\${LLVM_INSTALL_PREFIX}/bin")
set(LLVM_CONFIG_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMExports.cmake")
set(LLVM_CONFIG_EXPORTS "${LLVM_EXPORTS}")
+set(LLVM_CONFIG_STATIC_EXPORTS_FILE "\${LLVM_CMAKE_DIR}/LLVMStaticExports.cmake")
configure_file(
LLVMConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/LLVMConfig.cmake
@@ -107,6 +108,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
if(llvm_has_exports)
install(EXPORT LLVMExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
COMPONENT cmake-exports)
+ install(EXPORT LLVMStaticExports DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
+ COMPONENT cmake-exports)
endif()
install(FILES
diff --git a/cmake/modules/LLVMConfig.cmake.in b/cmake/modules/LLVMConfig.cmake.in
index 0772016..f471625 100644
--- a/cmake/modules/LLVMConfig.cmake.in
+++ b/cmake/modules/LLVMConfig.cmake.in
@@ -78,6 +78,8 @@ if(NOT TARGET LLVMSupport)
set(LLVM_EXPORTED_TARGETS "@LLVM_CONFIG_EXPORTS@")
include("@LLVM_CONFIG_EXPORTS_FILE@")
@llvm_config_include_buildtree_only_exports@
+
+ include("@LLVM_CONFIG_STATIC_EXPORTS_FILE@" OPTIONAL)
endif()
# By creating intrinsics_gen here, subprojects that depend on LLVM's
--
1.8.3.1

View File

@ -1,24 +0,0 @@
From e67ace2ecb42c24e124f1738dc67b22055a22500 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Thu, 13 Sep 2018 10:10:08 -0700
Subject: [PATCH] Don't set rpath when installing
---
cmake/modules/AddLLVM.cmake | 1 +
1 file changed, 1 insertion(+)
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index ce2057f..de309b5 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -1621,6 +1621,7 @@ function(llvm_codesign name)
endfunction()
function(llvm_setup_rpath name)
+ return()
if(CMAKE_INSTALL_RPATH)
return()
endif()
--
1.8.3.1

View File

@ -1,28 +0,0 @@
From 5f7fd92155db77c7608e3a07e5dcfad1ec7bd4e4 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 16 Mar 2018 07:52:33 -0700
Subject: [PATCH] Filter out cxxflags not supported by clang
---
tools/llvm-config/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
index a0bd36c..4193b0e 100644
--- a/tools/llvm-config/CMakeLists.txt
+++ b/tools/llvm-config/CMakeLists.txt
@@ -34,7 +34,11 @@ set(LLVM_SRC_ROOT ${LLVM_MAIN_SRC_DIR})
set(LLVM_OBJ_ROOT ${LLVM_BINARY_DIR})
set(LLVM_CPPFLAGS "${CMAKE_CPP_FLAGS} ${CMAKE_CPP_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
set(LLVM_CFLAGS "${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${LLVM_DEFINITIONS}")
+STRING(REGEX REPLACE "-mcet" "" LLVM_CFLAGS ${LLVM_CFLAGS})
+STRING(REGEX REPLACE "-fcf-protection" "" LLVM_CFLAGS ${LLVM_CFLAGS})
set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}} ${COMPILE_FLAGS} ${LLVM_DEFINITIONS}")
+STRING(REGEX REPLACE "-mcet" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
+STRING(REGEX REPLACE "-fcf-protection" "" LLVM_CXXFLAGS ${LLVM_CXXFLAGS})
set(LLVM_BUILD_SYSTEM cmake)
set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI})
set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}")
--
1.8.3.1

View File

@ -1,62 +0,0 @@
From cf1fb43186fd4d97ee2de0b222d44ecc500f82c7 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Mon, 13 Aug 2018 12:22:28 -0700
Subject: [PATCH] unittests: Don't install TestPlugin.so
add_llvm_loadable_module adds an install target by default, but this
module is only used for a unit test, so we don't need to instal it.
This patch adds a NO_INSTALL option to add_llvm_loadable_module that
can be used to disable installation of modules.
---
cmake/modules/AddLLVM.cmake | 13 ++++++++-----
unittests/Passes/CMakeLists.txt | 2 +-
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/cmake/modules/AddLLVM.cmake b/cmake/modules/AddLLVM.cmake
index 24ef5e4..1637ba6 100644
--- a/cmake/modules/AddLLVM.cmake
+++ b/cmake/modules/AddLLVM.cmake
@@ -671,7 +671,8 @@ macro(add_llvm_library name)
endmacro(add_llvm_library name)
macro(add_llvm_loadable_module name)
- llvm_add_library(${name} MODULE ${ARGN})
+ cmake_parse_arguments(ARG "NO_INSTALL" "" "" ${ARGN})
+ llvm_add_library(${name} MODULE ${ARG_UNPARSED_ARGUMENTS})
if(NOT TARGET ${name})
# Add empty "phony" target
add_custom_target(${name})
@@ -693,10 +694,12 @@ macro(add_llvm_loadable_module name)
set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True)
endif()
- install(TARGETS ${name}
- ${export_to_llvmexports}
- LIBRARY DESTINATION ${dlldir}
- ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ if (NOT ARG_NO_INSTALL)
+ install(TARGETS ${name}
+ ${export_to_llvmexports}
+ LIBRARY DESTINATION ${dlldir}
+ ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
+ endif()
endif()
set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name})
endif()
diff --git a/unittests/Passes/CMakeLists.txt b/unittests/Passes/CMakeLists.txt
index d90df20..99390e6 100644
--- a/unittests/Passes/CMakeLists.txt
+++ b/unittests/Passes/CMakeLists.txt
@@ -14,7 +14,7 @@ add_llvm_unittest(PluginsTests
export_executable_symbols(PluginsTests)
set(LLVM_LINK_COMPONENTS)
-add_llvm_loadable_module(TestPlugin
+add_llvm_loadable_module(TestPlugin NO_INSTALL
TestPlugin.cpp
)
--
1.8.3.1

View File

@ -1,20 +1,13 @@
Name: llvm Name: llvm
Version: 7.0.0 Version: 7.0.0
Release: 7 Release: 8
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
URL: http://llvm.org URL: http://llvm.org
Source0: http://releases.llvm.org/7.0.0/%{name}-%{version}.src.tar.xz Source0: http://releases.llvm.org/7.0.0/%{name}-%{version}.src.tar.xz
Source1: run-lit-tests
Patch0: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch1: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
Patch2: 0001-unittests-Don-t-install-TestPlugin.so.patch
Patch3: 0001-CMake-Don-t-prefer-python2.7.patch
Patch4: 0001-Don-t-set-rpath-when-installing.patch
BuildRequires: gcc gcc-c++ cmake ninja-build zlib-devel libffi-devel ncurses-devel libstdc++-static BuildRequires: gcc gcc-c++ cmake ninja-build zlib-devel libffi-devel ncurses-devel libstdc++-static
BuildRequires: python3-sphinx multilib-rpm-config binutils-devel valgrind-devel BuildRequires: python3-sphinx binutils-devel valgrind-devel libedit-devel python3-devel
BuildRequires: libedit-devel python3-devel
%description %description
LLVM is a compiler infrastructure designed for compile-time, link-time, LLVM is a compiler infrastructure designed for compile-time, link-time,
@ -61,7 +54,6 @@ The %{name}-help package contains doc files for %{name}.
%prep %prep
%autosetup -n %{name}-%{version}.src -p1 %autosetup -n %{name}-%{version}.src -p1
pathfix.py -i %{__python3} -pn test/BugPoint/compile-custom.ll.py tools/opt-viewer/*.py pathfix.py -i %{__python3} -pn test/BugPoint/compile-custom.ll.py tools/opt-viewer/*.py
sed -i 's~@TOOLS_DIR@~%{_libdir}/%{name}~' %{SOURCE1}
%build %build
mkdir -p _build mkdir -p _build
@ -123,8 +115,6 @@ ninja -v install
mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}} mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
%multilib_fix_c_header --file %{_includedir}/llvm/Config/llvm-config.h
for f in lli-child-target llvm-isel-fuzzer llvm-opt-fuzzer yaml-bench; do for f in lli-child-target llvm-isel-fuzzer llvm-opt-fuzzer yaml-bench; do
install -m 0755 ./bin/$f %{buildroot}%{_libdir}/%{name} install -m 0755 ./bin/$f %{buildroot}%{_libdir}/%{name}
done done
@ -146,7 +136,6 @@ sed -i -e s~`pwd`/_build~%{_prefix}~g -e s~`pwd`~.~g %{lit_cfg} %{lit_cfg} %{lit
sed -i 's~\(config.llvm_obj_root = \)"[^"]\+"~\1"%{_libdir}/%{name}"~' %{lit_unit_cfg} sed -i 's~\(config.llvm_obj_root = \)"[^"]\+"~\1"%{_libdir}/%{name}"~' %{lit_unit_cfg}
install -d %{buildroot}%{_libexecdir}/tests/llvm install -d %{buildroot}%{_libexecdir}/tests/llvm
install -m 0755 %{SOURCE1} %{buildroot}%{_libexecdir}/tests/llvm
install -d %{buildroot}%{_datadir}/llvm/ install -d %{buildroot}%{_datadir}/llvm/
tar -czf %{install_srcdir}/test.tar.gz test/ tar -czf %{install_srcdir}/test.tar.gz test/
@ -189,7 +178,6 @@ fi
%{_libdir}/libLLVM.so %{_libdir}/libLLVM.so
%{_libdir}/*.a %{_libdir}/*.a
%{_datadir}/llvm/src/utils %{_datadir}/llvm/src/utils
%{_libexecdir}/tests/llvm/
%{_libdir}/%{name}/unittests/ %{_libdir}/%{name}/unittests/
%{_datadir}/llvm/src/test.tar.gz %{_datadir}/llvm/src/test.tar.gz
@ -198,6 +186,12 @@ fi
%{_mandir}/man1/* %{_mandir}/man1/*
%changelog %changelog
* Sat Jan 11 2020 openEuler Buildteam <buildteam@openeuler.org> - 7.0.0-8
- Type: enhancement
- ID: NA
- SUG: NA
- DESC: remove unnecessary files
* Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> -7.0.0-7 * Tue Dec 31 2019 openEuler Buildteam <buildteam@openeuler.org> -7.0.0-7
- Type: enhancement - Type: enhancement
- ID: NA - ID: NA

View File

@ -1,39 +0,0 @@
#!/bin/bash
usage() {
echo "usage: `basename $0` [OPTIONS]"
echo " --threads NUM The number of threads to use for running tests."
}
threads_arg=''
while [ $# -gt 0 ]; do
case $1 in
--threads)
shift
threads_arg="--threads $1"
;;
* )
echo "unknown option: $1"
echo ""
usage
exit 1
;;
esac
shift
done
set -xe
TOOLS_DIR=@TOOLS_DIR@
cd $(mktemp -d)
ln -s /usr/include include
tar -xzf /usr/share/llvm/src/test.tar.gz
PATH=$PATH:$TOOLS_DIR lit -v -s $threads_arg test \
-DFileCheck=$TOOLS_DIR/FileCheck \
-Dcount=$TOOLS_DIR/count \
-Dnot=$TOOLS_DIR/not \
-Dlli-child-target=$TOOLS_DIR/lli-child-target \
-Dllvm-isel-fuzzer=$TOOLS_DIR/llvm-isel-fuzzer \
-Dllvm-opt-fuzzer=$TOOLS_DIR/llvm-opt-fuzzer \
-Dyaml-bench=$TOOLS_DIR/yaml-bench