From de5c3ae498545299f4428f9881a9f62bcbed8972 Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Fri, 30 Mar 2012 16:58:41 +0700 Subject: [PATCH] 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 --- clang-2.9-add_gcc_vers.patch | 12 ---- llvm-2.9-PR9869_operator_destructor.patch | 74 ----------------------- llvm.spec | 67 +++++++++++--------- 3 files changed, 37 insertions(+), 116 deletions(-) delete mode 100644 clang-2.9-add_gcc_vers.patch delete mode 100644 llvm-2.9-PR9869_operator_destructor.patch diff --git a/clang-2.9-add_gcc_vers.patch b/clang-2.9-add_gcc_vers.patch deleted file mode 100644 index 03afe49..0000000 --- a/clang-2.9-add_gcc_vers.patch +++ /dev/null @@ -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"}; diff --git a/llvm-2.9-PR9869_operator_destructor.patch b/llvm-2.9-PR9869_operator_destructor.patch deleted file mode 100644 index 982d0ea..0000000 --- a/llvm-2.9-PR9869_operator_destructor.patch +++ /dev/null @@ -1,74 +0,0 @@ -From 6a61834d1c41971f80669a0484f1a0d2d8a1c286 Mon Sep 17 00:00:00 2001 -From: Eli Friedman -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 {}; -+ : public ConcreteOperator { -+ ~AddOperator(); // DO NOT IMPLEMENT -+}; - class SubOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~SubOperator(); // DO NOT IMPLEMENT -+}; - class MulOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~MulOperator(); // DO NOT IMPLEMENT -+}; - class ShlOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~ShlOperator(); // DO NOT IMPLEMENT -+}; - - - class SDivOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~SDivOperator(); // DO NOT IMPLEMENT -+}; - class UDivOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~UDivOperator(); // DO NOT IMPLEMENT -+}; - class AShrOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~AShrOperator(); // DO NOT IMPLEMENT -+}; - class LShrOperator -- : public ConcreteOperator {}; -+ : public ConcreteOperator { -+ ~LShrOperator(); // DO NOT IMPLEMENT -+}; - - - - class GEPOperator - : public ConcreteOperator { -+ ~GEPOperator(); // DO NOT IMPLEMENT -+ - enum { - IsInBounds = (1 << 0) - }; --- -1.7.6.4 - diff --git a/llvm.spec b/llvm.spec index e858e01..90a4de6 100644 --- a/llvm.spec +++ b/llvm.spec @@ -2,6 +2,11 @@ # # --with doxygen # 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 # No ocaml on these arches @@ -11,10 +16,10 @@ %endif %if 0%{?rhel} >= 7 -%global with_clang 0 +%bcond_with clang ExcludeArch: s390 s390x ppc ppc64 %else -%global with_clang 1 +%bcond_without clang %endif #global prerel rcX @@ -31,7 +36,7 @@ ExcludeArch: s390 s390x ppc ppc64 Name: llvm Version: 3.0 -Release: 10%{?dist} +Release: 11%{?dist} Summary: The Low Level Virtual Machine Group: Development/Languages @@ -46,14 +51,11 @@ Source3: llvm-Config-llvm-config.h # Data files should be installed with timestamps preserved 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 # 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 # Makefile clean-ups -Patch2: llvm-3.0-link_llvmgold_to_lto.patch +Patch1: llvm-3.0-link_llvmgold_to_lto.patch BuildRequires: bison BuildRequires: chrpath @@ -72,7 +74,7 @@ BuildRequires: zip # for DejaGNU test suite BuildRequires: dejagnu tcl-devel python # for doxygen documentation -%if 0%{?_with_doxygen} +%if %{with doxygen} BuildRequires: doxygen graphviz %endif Requires: llvm-libs%{?_isa} = %{version}-%{release} @@ -122,14 +124,15 @@ Group: System Environment/Libraries Shared libraries for the LLVM compiler infrastructure. -%if %{with_clang} +%if %{with clang} %package -n clang Summary: A C language family front-end for LLVM License: NCSA Group: Development/Languages Requires: llvm%{?_isa} = %{version}-%{release} -# clang requires gcc; clang++ gcc-c++ -Requires: gcc-c++ +# clang requires gcc, clang++ requires libstdc++-devel +Requires: gcc +Requires: libstdc++-devel = %{gcc_version} %description -n clang clang: noun @@ -178,7 +181,7 @@ Documentation for the Clang compiler front-end. %endif -%if 0%{?_with_doxygen} +%if %{with doxygen} %package apidoc Summary: API documentation for LLVM Group: Development/Languages @@ -190,7 +193,7 @@ Requires: %{name}-doc = %{version}-%{release} API documentation for the LLVM compiler infrastructure. -%if %{with_clang} +%if %{with clang} %package -n clang-apidoc Summary: API documentation for Clang Group: Development/Languages @@ -239,24 +242,22 @@ HTML documentation for LLVM's OCaml binding. %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 -%if %{with_clang} +%if %{with clang} mv clang-%{version}%{?prerel}.src tools/clang %endif # llvm patches %patch0 -p1 -b .timestamp -%patch2 -p1 -b .link_llvmgold_to_lto +%patch1 -p1 -b .link_llvmgold_to_lto # clang patches #pushd tools/clang -#patch1 -p1 -b .add_gcc_ver #popd # fix ld search path -# TODO: remove /%{_lib} after usrmove migration is final -sed -i 's|/lib /usr/lib $lt_ld_extra|/%{_lib} %{_libdir} $lt_ld_extra|' \ +sed -i 's|/lib /usr/lib $lt_ld_extra|%{_libdir} $lt_ld_extra|' \ ./configure @@ -269,7 +270,7 @@ sed -i 's|/lib /usr/lib $lt_ld_extra|/%{_lib} %{_libdir} $lt_ld_extra|' \ %configure \ --prefix=%{_prefix} \ --libdir=%{_libdir}/%{name} \ -%if 0%{?_with_doxygen} +%if %{with doxygen} --enable-doxygen \ %endif %if %{with gold} @@ -322,7 +323,7 @@ cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF %{_libdir}/llvm EOF -%if %{with_clang} +%if %{with clang} # Static analyzer not installed by default: # http://clang-analyzer.llvm.org/installation#OtherPlatforms mkdir -p %{buildroot}%{_libdir}/clang-analyzer @@ -342,14 +343,14 @@ rm -f moredocs/*.tar.gz rm -f moredocs/ocamldoc/html/*.tar.gz # and separate the apidoc -%if 0%{?_with_doxygen} +%if %{with doxygen} mv moredocs/html/doxygen apidoc mv tools/clang/docs/doxygen/html clang-apidoc %endif # And prepare Clang documentation # -%if %{with_clang} +%if %{with clang} mkdir clang-docs for f in LICENSE.TXT NOTES.txt README.txt; do # TODO.txt; do ln tools/clang/$f clang-docs/ @@ -389,7 +390,7 @@ make check LIT_ARGS="-v -j4" \ %{nil} %endif -%if %{with_clang} +%if %{with clang} # clang test suite failing on PPC and s390(x) # FIXME: # 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 %postun libs -p /sbin/ldconfig -%if %{with_clang} +%if %{with clang} %post -n clang -p /sbin/ldconfig %postun -n clang -p /sbin/ldconfig %endif @@ -445,7 +446,7 @@ exit 0 %{_bindir}/llvm* %{_bindir}/macho-dump %{_bindir}/opt -%if %{with_clang} +%if %{with clang} %exclude %{_mandir}/man1/clang.1.* %endif %doc %{_mandir}/man1/*.1.* @@ -461,12 +462,12 @@ exit 0 %defattr(-,root,root,-) %config(noreplace) %{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf %dir %{_libdir}/%{name} -%if %{with_clang} +%if %{with clang} %exclude %{_libdir}/%{name}/libclang.so %endif %{_libdir}/%{name}/*.so -%if %{with_clang} +%if %{with clang} %files -n clang %defattr(-,root,root,-) %doc clang-docs/* clang-testlog-%{_arch}.txt @@ -514,12 +515,12 @@ exit 0 %doc moredocs/ocamldoc/html/* %endif -%if 0%{?_with_doxygen} +%if %{with doxygen} %files apidoc %defattr(-,root,root,-) %doc apidoc/* -%if %{with_clang} +%if %{with clang} %files -n clang-apidoc %defattr(-,root,root,-) %doc clang-apidoc/* @@ -527,6 +528,12 @@ exit 0 %endif %changelog +* Fri Mar 30 2012 Michel Alexandre Salim - 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 - 3.0-10 - Build without -ftree-pre as a workaround for clang segfaulting on x86_64 (#791365)