Replace overly-broad dependency on gcc-c++ with gcc and libstdc++-devel

- Pin clang's dependency on libstdc++-devel to the version used for building
- Standardize on bcond for conditional build options
- Remove /lib from search path, everything is now in /usr/lib*
- Remove obsoleted patches
This commit is contained in:
Michel Alexandre Salim 2012-03-30 16:58:41 +07:00
parent 9dca0ca4bc
commit de5c3ae498
3 changed files with 37 additions and 116 deletions

View File

@ -1,12 +0,0 @@
--- clang-2.9/lib/Driver/ToolChains.cpp.add_gcc_vers 2011-03-21 22:29:27.000000000 +0100
+++ clang-2.9/lib/Driver/ToolChains.cpp 2011-08-01 18:20:29.504194241 +0200
@@ -1449,7 +1449,8 @@
GccTriple = "i586-suse-linux";
}
- const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
+ const char* GccVersions[] = {"4.6.1", "4.6.0",
+ "4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
"4.4.3", "4.4", "4.3.4", "4.3.3", "4.3.2",
"4.3", "4.2.4", "4.2.3", "4.2.2", "4.2.1",
"4.2"};

View File

@ -1,74 +0,0 @@
From 6a61834d1c41971f80669a0484f1a0d2d8a1c286 Mon Sep 17 00:00:00 2001
From: Eli Friedman <eli.friedman@gmail.com>
Date: Sun, 8 May 2011 01:59:22 +0000
Subject: [PATCH] PR9869: Add explicit destructor declarations to Operator
subclasses, to allow compiling Operator.h with gcc 4.6 in
C++0x mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131062 91177308-0d34-0410-b5e6-96231b3b80d8
---
include/llvm/Operator.h | 34 ++++++++++++++++++++++++++--------
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/include/llvm/Operator.h b/include/llvm/Operator.h
index ff2a0ad..e9aa499 100644
--- a/include/llvm/Operator.h
+++ b/include/llvm/Operator.h
@@ -186,28 +186,46 @@ public:
};
class AddOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Add> {
+ ~AddOperator(); // DO NOT IMPLEMENT
+};
class SubOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Sub> {
+ ~SubOperator(); // DO NOT IMPLEMENT
+};
class MulOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Mul> {
+ ~MulOperator(); // DO NOT IMPLEMENT
+};
class ShlOperator
- : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {};
+ : public ConcreteOperator<OverflowingBinaryOperator, Instruction::Shl> {
+ ~ShlOperator(); // DO NOT IMPLEMENT
+};
class SDivOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::SDiv> {
+ ~SDivOperator(); // DO NOT IMPLEMENT
+};
class UDivOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::UDiv> {
+ ~UDivOperator(); // DO NOT IMPLEMENT
+};
class AShrOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::AShr> {
+ ~AShrOperator(); // DO NOT IMPLEMENT
+};
class LShrOperator
- : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {};
+ : public ConcreteOperator<PossiblyExactOperator, Instruction::LShr> {
+ ~LShrOperator(); // DO NOT IMPLEMENT
+};
class GEPOperator
: public ConcreteOperator<Operator, Instruction::GetElementPtr> {
+ ~GEPOperator(); // DO NOT IMPLEMENT
+
enum {
IsInBounds = (1 << 0)
};
--
1.7.6.4

View File

@ -2,6 +2,11 @@
# #
# --with doxygen # --with doxygen
# The doxygen docs are HUGE, so they are not built by default. # The doxygen docs are HUGE, so they are not built by default.
%bcond_with doxygen
# clang header paths are hard-coded at compile time
# and need adjustment whenever there's a new GCC version
%global gcc_version %(gcc -dumpversion)
%ifarch s390 s390x sparc64 %ifarch s390 s390x sparc64
# No ocaml on these arches # No ocaml on these arches
@ -11,10 +16,10 @@
%endif %endif
%if 0%{?rhel} >= 7 %if 0%{?rhel} >= 7
%global with_clang 0 %bcond_with clang
ExcludeArch: s390 s390x ppc ppc64 ExcludeArch: s390 s390x ppc ppc64
%else %else
%global with_clang 1 %bcond_without clang
%endif %endif
#global prerel rcX #global prerel rcX
@ -31,7 +36,7 @@ ExcludeArch: s390 s390x ppc ppc64
Name: llvm Name: llvm
Version: 3.0 Version: 3.0
Release: 10%{?dist} Release: 11%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
Group: Development/Languages Group: Development/Languages
@ -46,14 +51,11 @@ Source3: llvm-Config-llvm-config.h
# Data files should be installed with timestamps preserved # Data files should be installed with timestamps preserved
Patch0: llvm-2.6-timestamp.patch Patch0: llvm-2.6-timestamp.patch
# clang link failure if system GCC version is unknown
# http://llvm.org/bugs/show_bug.cgi?id=8897
Patch1: clang-2.9-add_gcc_vers.patch
# LLVMgold should link against LTO as a normal library # LLVMgold should link against LTO as a normal library
# http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-November/045433.html # http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-November/045433.html
# patch is applied upstream, but has to be rewritten due to post-3.0 # patch is applied upstream, but has to be rewritten due to post-3.0
# Makefile clean-ups # Makefile clean-ups
Patch2: llvm-3.0-link_llvmgold_to_lto.patch Patch1: llvm-3.0-link_llvmgold_to_lto.patch
BuildRequires: bison BuildRequires: bison
BuildRequires: chrpath BuildRequires: chrpath
@ -72,7 +74,7 @@ BuildRequires: zip
# for DejaGNU test suite # for DejaGNU test suite
BuildRequires: dejagnu tcl-devel python BuildRequires: dejagnu tcl-devel python
# for doxygen documentation # for doxygen documentation
%if 0%{?_with_doxygen} %if %{with doxygen}
BuildRequires: doxygen graphviz BuildRequires: doxygen graphviz
%endif %endif
Requires: llvm-libs%{?_isa} = %{version}-%{release} Requires: llvm-libs%{?_isa} = %{version}-%{release}
@ -122,14 +124,15 @@ Group: System Environment/Libraries
Shared libraries for the LLVM compiler infrastructure. Shared libraries for the LLVM compiler infrastructure.
%if %{with_clang} %if %{with clang}
%package -n clang %package -n clang
Summary: A C language family front-end for LLVM Summary: A C language family front-end for LLVM
License: NCSA License: NCSA
Group: Development/Languages Group: Development/Languages
Requires: llvm%{?_isa} = %{version}-%{release} Requires: llvm%{?_isa} = %{version}-%{release}
# clang requires gcc; clang++ gcc-c++ # clang requires gcc, clang++ requires libstdc++-devel
Requires: gcc-c++ Requires: gcc
Requires: libstdc++-devel = %{gcc_version}
%description -n clang %description -n clang
clang: noun clang: noun
@ -178,7 +181,7 @@ Documentation for the Clang compiler front-end.
%endif %endif
%if 0%{?_with_doxygen} %if %{with doxygen}
%package apidoc %package apidoc
Summary: API documentation for LLVM Summary: API documentation for LLVM
Group: Development/Languages Group: Development/Languages
@ -190,7 +193,7 @@ Requires: %{name}-doc = %{version}-%{release}
API documentation for the LLVM compiler infrastructure. API documentation for the LLVM compiler infrastructure.
%if %{with_clang} %if %{with clang}
%package -n clang-apidoc %package -n clang-apidoc
Summary: API documentation for Clang Summary: API documentation for Clang
Group: Development/Languages Group: Development/Languages
@ -239,24 +242,22 @@ HTML documentation for LLVM's OCaml binding.
%prep %prep
%setup -q -n llvm-%{version}%{?prerel}.src %{?with_clang:-a1} %{?_with_gcc:-a2} %setup -q -n llvm-%{version}%{?prerel}.src %{?with_clang:-a1}
rm -r -f tools/clang rm -r -f tools/clang
%if %{with_clang} %if %{with clang}
mv clang-%{version}%{?prerel}.src tools/clang mv clang-%{version}%{?prerel}.src tools/clang
%endif %endif
# llvm patches # llvm patches
%patch0 -p1 -b .timestamp %patch0 -p1 -b .timestamp
%patch2 -p1 -b .link_llvmgold_to_lto %patch1 -p1 -b .link_llvmgold_to_lto
# clang patches # clang patches
#pushd tools/clang #pushd tools/clang
#patch1 -p1 -b .add_gcc_ver
#popd #popd
# fix ld search path # fix ld search path
# TODO: remove /%{_lib} after usrmove migration is final sed -i 's|/lib /usr/lib $lt_ld_extra|%{_libdir} $lt_ld_extra|' \
sed -i 's|/lib /usr/lib $lt_ld_extra|/%{_lib} %{_libdir} $lt_ld_extra|' \
./configure ./configure
@ -269,7 +270,7 @@ sed -i 's|/lib /usr/lib $lt_ld_extra|/%{_lib} %{_libdir} $lt_ld_extra|' \
%configure \ %configure \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
--libdir=%{_libdir}/%{name} \ --libdir=%{_libdir}/%{name} \
%if 0%{?_with_doxygen} %if %{with doxygen}
--enable-doxygen \ --enable-doxygen \
%endif %endif
%if %{with gold} %if %{with gold}
@ -322,7 +323,7 @@ cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
%{_libdir}/llvm %{_libdir}/llvm
EOF EOF
%if %{with_clang} %if %{with clang}
# Static analyzer not installed by default: # Static analyzer not installed by default:
# http://clang-analyzer.llvm.org/installation#OtherPlatforms # http://clang-analyzer.llvm.org/installation#OtherPlatforms
mkdir -p %{buildroot}%{_libdir}/clang-analyzer mkdir -p %{buildroot}%{_libdir}/clang-analyzer
@ -342,14 +343,14 @@ rm -f moredocs/*.tar.gz
rm -f moredocs/ocamldoc/html/*.tar.gz rm -f moredocs/ocamldoc/html/*.tar.gz
# and separate the apidoc # and separate the apidoc
%if 0%{?_with_doxygen} %if %{with doxygen}
mv moredocs/html/doxygen apidoc mv moredocs/html/doxygen apidoc
mv tools/clang/docs/doxygen/html clang-apidoc mv tools/clang/docs/doxygen/html clang-apidoc
%endif %endif
# And prepare Clang documentation # And prepare Clang documentation
# #
%if %{with_clang} %if %{with clang}
mkdir clang-docs mkdir clang-docs
for f in LICENSE.TXT NOTES.txt README.txt; do # TODO.txt; do for f in LICENSE.TXT NOTES.txt README.txt; do # TODO.txt; do
ln tools/clang/$f clang-docs/ ln tools/clang/$f clang-docs/
@ -389,7 +390,7 @@ make check LIT_ARGS="-v -j4" \
%{nil} %{nil}
%endif %endif
%if %{with_clang} %if %{with clang}
# clang test suite failing on PPC and s390(x) # clang test suite failing on PPC and s390(x)
# FIXME: # FIXME:
# unexpected failures on all platforms with GCC 4.7.0. # unexpected failures on all platforms with GCC 4.7.0.
@ -407,7 +408,7 @@ make -C tools/clang/test TESTARGS="-v -j4" \
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig
%if %{with_clang} %if %{with clang}
%post -n clang -p /sbin/ldconfig %post -n clang -p /sbin/ldconfig
%postun -n clang -p /sbin/ldconfig %postun -n clang -p /sbin/ldconfig
%endif %endif
@ -445,7 +446,7 @@ exit 0
%{_bindir}/llvm* %{_bindir}/llvm*
%{_bindir}/macho-dump %{_bindir}/macho-dump
%{_bindir}/opt %{_bindir}/opt
%if %{with_clang} %if %{with clang}
%exclude %{_mandir}/man1/clang.1.* %exclude %{_mandir}/man1/clang.1.*
%endif %endif
%doc %{_mandir}/man1/*.1.* %doc %{_mandir}/man1/*.1.*
@ -461,12 +462,12 @@ exit 0
%defattr(-,root,root,-) %defattr(-,root,root,-)
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
%dir %{_libdir}/%{name} %dir %{_libdir}/%{name}
%if %{with_clang} %if %{with clang}
%exclude %{_libdir}/%{name}/libclang.so %exclude %{_libdir}/%{name}/libclang.so
%endif %endif
%{_libdir}/%{name}/*.so %{_libdir}/%{name}/*.so
%if %{with_clang} %if %{with clang}
%files -n clang %files -n clang
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc clang-docs/* clang-testlog-%{_arch}.txt %doc clang-docs/* clang-testlog-%{_arch}.txt
@ -514,12 +515,12 @@ exit 0
%doc moredocs/ocamldoc/html/* %doc moredocs/ocamldoc/html/*
%endif %endif
%if 0%{?_with_doxygen} %if %{with doxygen}
%files apidoc %files apidoc
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc apidoc/* %doc apidoc/*
%if %{with_clang} %if %{with clang}
%files -n clang-apidoc %files -n clang-apidoc
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc clang-apidoc/* %doc clang-apidoc/*
@ -527,6 +528,12 @@ exit 0
%endif %endif
%changelog %changelog
* Fri Mar 30 2012 Michel Alexandre Salim <michel@hermione.localdomain> - 3.0-11
- Replace overly-broad dependency on gcc-c++ with gcc and libstdc++-devel
- Pin clang's dependency on libstdc++-devel to the version used for building
- Standardize on bcond for conditional build options
- Remove /lib from search path, everything is now in /usr/lib*
* Mon Mar 26 2012 Kalev Lember <kalevlember@gmail.com> - 3.0-10 * Mon Mar 26 2012 Kalev Lember <kalevlember@gmail.com> - 3.0-10
- Build without -ftree-pre as a workaround for clang segfaulting - Build without -ftree-pre as a workaround for clang segfaulting
on x86_64 (#791365) on x86_64 (#791365)