Fix clang-tools-extra build
Also fix the %install step.
This commit is contained in:
parent
d5d64ecc50
commit
5617ce07d5
36
0001-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
Normal file
36
0001-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
Normal file
@ -0,0 +1,36 @@
|
||||
From f5f712dfcac6ee99381c5aca212950276f1743e8 Mon Sep 17 00:00:00 2001
|
||||
From: Eric Fiselier <eric@efcs.ca>
|
||||
Date: Fri, 10 Feb 2017 01:59:20 +0000
|
||||
Subject: [PATCH] [CMake] Fix pthread handling for out-of-tree builds
|
||||
|
||||
LLVM defines `PTHREAD_LIB` which is used by AddLLVM.cmake and various projects
|
||||
to correctly link the threading library when needed. Unfortunately
|
||||
`PTHREAD_LIB` is defined by LLVM's `config-ix.cmake` file which isn't installed
|
||||
and therefore can't be used when configuring out-of-tree builds. This causes
|
||||
such builds to fail since `pthread` isn't being correctly linked.
|
||||
|
||||
This patch attempts to fix that problem by renaming and exporting
|
||||
`LLVM_PTHREAD_LIB` as part of`LLVMConfig.cmake`. I renamed `PTHREAD_LIB`
|
||||
because It seemed likely to cause collisions with downstream users of
|
||||
`LLVMConfig.cmake`.
|
||||
|
||||
|
||||
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@294690 91177308-0d34-0410-b5e6-96231b3b80d8
|
||||
---
|
||||
include-fixer/plugin/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include-fixer/plugin/CMakeLists.txt b/include-fixer/plugin/CMakeLists.txt
|
||||
index 2799fd4..df792ea 100644
|
||||
--- a/include-fixer/plugin/CMakeLists.txt
|
||||
+++ b/include-fixer/plugin/CMakeLists.txt
|
||||
@@ -9,5 +9,5 @@ add_clang_library(clangIncludeFixerPlugin
|
||||
clangParse
|
||||
clangSema
|
||||
clangTooling
|
||||
- ${PTHREAD_LIB}
|
||||
+ ${LLVM_PTHREAD_LIB}
|
||||
)
|
||||
--
|
||||
1.8.3.1
|
||||
|
21
clang.spec
21
clang.spec
@ -1,21 +1,26 @@
|
||||
%global clang_tools_binaries \
|
||||
%{_bindir}/clang-apply-replacements \
|
||||
%{_bindir}/clang-change-namespace \
|
||||
%{_bindir}/clang-include-fixer \
|
||||
%{_bindir}/clang-query \
|
||||
%{_bindir}/clang-reorder-fields \
|
||||
%{_bindir}/clang-rename \
|
||||
%{_bindir}/clang-tidy
|
||||
|
||||
%global clang_binaries \
|
||||
%{_bindir}/clang \
|
||||
%{_bindir}/clang++ \
|
||||
%{_bindir}/clang-3.9 \
|
||||
%{_bindir}/clang-4.0 \
|
||||
%{_bindir}/clang-check \
|
||||
%{_bindir}/clang-cl \
|
||||
%{_bindir}/clang-format
|
||||
%{_bindir}/clang-cpp \
|
||||
%{_bindir}/clang-format \
|
||||
%{_bindir}/clang-import-test \
|
||||
%{_bindir}/clang-offload-bundler
|
||||
|
||||
Name: clang
|
||||
Version: 4.0.0
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: A C language family front-end for LLVM
|
||||
|
||||
License: NCSA
|
||||
@ -25,6 +30,8 @@ Source1: http://llvm.org/releases/%{version}/clang-tools-extra-%{version}.src.ta
|
||||
|
||||
Source100: clang-config.h
|
||||
|
||||
Patch0: 0001-CMake-Fix-pthread-handling-for-out-of-tree-builds.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: llvm-devel = %{version}
|
||||
BuildRequires: libxml2-devel
|
||||
@ -89,6 +96,7 @@ A set of extra tools built using Clang's tooling API.
|
||||
|
||||
%prep
|
||||
%setup -T -q -b 1 -n clang-tools-extra-%{version}.src
|
||||
%patch0 -p1 -b .pthread-fix
|
||||
%setup -q -n cfe-%{version}.src
|
||||
|
||||
mv ../clang-tools-extra-%{version}.src tools/extra
|
||||
@ -138,6 +146,9 @@ rm -vf %{buildroot}%{_datadir}/clang/clang-include-fixer.py
|
||||
rm -vf %{buildroot}%{_datadir}/clang/clang-tidy-diff.py
|
||||
rm -vf %{buildroot}%{_datadir}/clang/run-clang-tidy.py
|
||||
rm -vf %{buildroot}%{_datadir}/clang/run-find-all-symbols.py
|
||||
rm -vf %{buildroot}%{_datadir}/clang/clang-include-fixer.el
|
||||
rm -vf %{buildroot}%{_datadir}/clang/clang-rename.el
|
||||
rm -vf %{buildroot}%{_datadir}/clang/clang-rename.py
|
||||
# remove diff reformatter
|
||||
rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
|
||||
|
||||
@ -177,6 +188,10 @@ rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
|
||||
%{_bindir}/modularize
|
||||
|
||||
%changelog
|
||||
* Fri Mar 24 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-2
|
||||
- Fix clang-tools-extra build
|
||||
- Fix install
|
||||
|
||||
* Thu Mar 23 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
|
||||
- clang 4.0.0 final release
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user