%define _disable_ld_no_undefined 0 %define git 0 %if %{git} # http://cgit.freedesktop.org/~tstellar/llvm/ # (browse to the commit and click the download link) # ("dirname" macro does not work with rpm 4.11) %define dirrname cd43f1d930aa20425777fa99b29b1df85d3b37c6 %else %define dirrname %{version}.src %endif # clang header paths are hard-coded at compile time # and need adjustment whenever there's a new GCC version %define gcc_version %(gcc -dumpversion) # Beware, API docs are ~1G unzipped (as of 3.2) %bcond_with apidox %bcond_without clang %define major 3.5 %define libname %mklibname %name %major %define libname_devel %mklibname -d %name %if %{with clang} %define clang_major %version %define clang_libname %mklibname clang %clang_major %define clang_libname_devel %mklibname -d clang %endif Name: llvm Version: 3.5.2 Release: %mkrel 1 Summary: Low Level Virtual Machine (LLVM) License: NCSA Group: Development/Other URL: http://llvm.org Source0: http://llvm.org/releases/%{version}/llvm-%{dirrname}.tar.xz Source1: http://llvm.org/releases/%{version}/cfe-%{dirrname}.tar.xz Source2: http://llvm.org/releases/%{version}/compiler-rt-%{dirrname}.tar.xz # Versionize libclang.so (Anssi 08/2012): Patch0: clang-soname.patch Patch1: cfe-3.5.0-detect-Mageia.patch Patch2: llvm-3.5.0-buildfix.patch Obsoletes: llvm-ocaml Requires: libstdc++-devel BuildRequires: gcc >= 4.9.2 BuildRequires: bison BuildRequires: groff BuildRequires: chrpath BuildRequires: ocaml BuildRequires: tcl %if %{with apidox} BuildRequires: doxygen %endif BuildRequires: flex BuildRequires: sed BuildRequires: graphviz BuildRequires: libstdc++-devel BuildRequires: libtool BuildRequires: zip BuildRequires: libffi-devel BuildRequires: chrpath BuildRequires: python-sphinx %description LLVM is a robust system, particularly well suited for developing new mid-level language-independent analyses and optimizations of all sorts, including those that require extensive interprocedural analysis. LLVM is also a great target for front-end development for conventional or research programming languages, including those which require compile-time, link-time, or run-time optimization for effective implementation, proper tail calls or garbage collection. %package -n %libname Summary: LLVM shared libraries Group: System/Libraries Conflicts: llvm < 3.0-4 %description -n %libname Shared libraries for the LLVM compiler infrastructure. This is needed by programs that are dynamically linked against libLLVM. %package -n %{libname_devel} Summary: Development files for LLVM Group: Development/Other Provides: llvm-devel = %version-%release Requires: %libname = %version-%release Requires: %name = %version-%release Conflicts: llvm < 3.0-7 Conflicts: %{_lib}llvm3.0 < 3.0-9 %description -n %{libname_devel} This package contains the development files for LLVM; %package doc Summary: Documentation for LLVM Group: Documentation Requires: %{name} = %{version} BuildArch: noarch Obsoletes: llvm-doc-devel %description doc Documentation for the LLVM compiler infrastructure. %if %{with apidox} %package apidoc Summary: API Documentation for LLVM Group: Documentation Requires: %{name} = %{version} BuildArch: noarch %description apidoc Documentation for the LLVM compiler infrastructure. %endif %if %{with clang} # TODO: %{_bindir}/clang is linked against static libclang.a, could it be # linked against libclang.so instead, like llvm-* are against livLLVM.so? %package -n clang Summary: A C language family front-end for LLVM License: NCSA Group: Development/Other # TODO: is this requires:llvm needed, or just legacy from fedora pkg layout? Requires: llvm%{?_isa} = %{version}-%{release} # clang requires gcc, clang++ requires libstdc++-devel Requires: gcc Requires: libstdc++-devel = %{gcc_version} %description -n clang clang: noun 1. A loud, resonant, metallic sound. 2. The strident call of a crane or goose. 3. C-language family front-end toolkit. The goal of the Clang project is to create a new C, C++, Objective C and Objective C++ front-end for the LLVM compiler. Its tools are built as libraries and designed to be loosely-coupled and extensible. %package -n %clang_libname Summary: Shared library for clang Group: System/Libraries %description -n %clang_libname Shared libraries for the clang compiler. This is needed by programs that are dynamically linked against libclang. %package -n %{clang_libname_devel} Summary: Development files for clang Group: Development/Other Requires: %clang_libname = %version-%release Provides: clang-devel = %version-%release Conflicts: llvm-devel < 3.1 Obsoletes: clang-devel < 3.1 %description -n %{clang_libname_devel} This package contains header files and libraries needed for using libclang. %package -n clang-analyzer Summary: A source code analysis framework License: NCSA Group: Development/Other Requires: clang%{?_isa} = %{version}-%{release} # not picked up automatically since files are currently not instaled # in standard Python hierarchies yet Requires: python %description -n clang-analyzer The Clang Static Analyzer consists of both a source code analysis framework and a standalone tool that finds bugs in C and Objective-C programs. The standalone tool is invoked from the command-line, and is intended to run in tandem with a build of a project or code base. %package -n clang-doc Summary: Documentation for Clang Group: Documentation BuildArch: noarch Requires: %{name} = %{version}-%{release} %description -n clang-doc Documentation for the Clang compiler front-end. %endif %prep %setup -qn %{name}-%{version}.src %{?with_clang:-a1 -a2} %patch2 -p1 rm -rf tools/clang %if %{with clang} mv cfe-%{version}.src%{?prerel} tools/clang cd tools/clang %patch0 -p1 %patch1 -p1 cd - mv compiler-rt-%{version}.src projects/compiler-rt %endif %build # Build with gcc/g++, not clang if it happens to be installed # (blino) clang < 3.1 does not handle system headers from gcc 4.7 # http://llvm.org/bugs/show_bug.cgi?id=11916 export CC=gcc export CXX=g++ cd autoconf aclocal --force -I m4 autoconf --force -o ../configure configure.ac cd .. autoheader -I autoconf -I autoconf/m4 autoconf/configure.ac %configure2_5x \ --libdir=%{_libdir}/%{name} \ --datadir=%{_datadir}/%{name} \ --enable-shared \ --enable-jit \ --enable-libffi \ --enable-optimized \ %ifarch %ix86 x86-64 --enable-targets="x86,x86_64" \ %else --enable-targets=host-only \ %endif --disable-expensive-checks \ --enable-debug-runtime \ --disable-assertions \ --enable-threads \ --enable-experimental-targets=R600 \ %if %{with apidox} --enable-doxygen %endif # FIXME file this # configure does not properly specify libdir sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config # FIXME upstream need to fix this # llvm-config.cpp hardcodes lib in it sed -i 's|ActiveLibDir = ActivePrefix + "/lib"|ActiveLibDir = ActivePrefix + "/%{_lib}/%{name}"|g' tools/llvm-config/llvm-config.cpp %make # Make docs pushd docs # As of 3.2, LLVM doesn't build man pages by itself. Aargh! make -f Makefile.sphinx man # Make doxygen docs %if %{with apidox} doxygen doxygen.cfg %endif popd %install cp bindings/ocaml/llvm/META.llvm bindings/ocaml/llvm/Release/ %makeinstall_std \ KEEP_SYMBOLS=1 \ PROJ_docsdir=%{_docdir}/%{name} \ PROJ_etcdir=%{_sysconfdir}/%{name} \ PROJ_libdir=%{_libdir}/%{name} # Invalid dir rm -rf %buildroot%_bindir/.dir # wrong rpath entries (Anssi 11/2011) file %{buildroot}/%{_bindir}/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d file %{buildroot}/%{_libdir}/llvm/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d # move shared library to standard library path and add devel symlink (Anssi 11/2011) mv %{buildroot}%{_libdir}/llvm/libLLVM-%major.so %{buildroot}%{_libdir} ln -s libLLVM-%major.so %{buildroot}%{_libdir}/libLLVM.so # Also, create shared library symlinks corresponding to all the static library # names, so that using e.g. "-lLLVMBitReader" will cause the binary to be linked # against the shared library instead of static library by default. (Anssi 08/2012) for staticlib in %{buildroot}%{_libdir}/llvm/libLLVM*.a; do sharedlib="${staticlib%.a}.so" [ -e "$sharedlib" ] && exit 1 ln -s ../libLLVM.so "$sharedlib" done # Install man pages cp docs/_build/man/*.1 %{buildroot}%{_mandir}/man1 %if %with clang # Versionize libclang.so (patch0 makes the same change to soname) and move it to standard path. mv %{buildroot}%{_libdir}/llvm/libclang.so %{buildroot}%{_libdir}/libclang-%version.so ln -s libclang-%clang_major.so %{buildroot}%{_libdir}/libclang.so ln -s ../libclang.so %{buildroot}%{_libdir}/llvm/libclang.so # NOTE: We don't create devel symlinks for the libclang.so for libclang*.a libraries # like for libLLVM above, because libclang.so actually exports much less symbols # - some are not linked in (tools/libclang/Makefile) and others are restricted # by tools/libclang/libclang.exports. - Anssi 09/2012 %endif # Since the static libraries are very huge, strip them of debug symbols as well # (Anssi 08/2012) strip --strip-debug %{buildroot}%{_libdir}/llvm/*.a %if %{with clang} # Static analyzer not installed by default: # http://clang-analyzer.llvm.org/installation#OtherPlatforms mkdir -p %{buildroot}%{_libdir}/clang-analyzer # create launchers for f in scan-{build,view}; do ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f done (cd tools/clang/tools && cp -pr scan-{build,view} \ %{buildroot}%{_libdir}/clang-analyzer/) # scan-build tries to find clang relatively to its real path ln -s %{_bindir}/clang %{buildroot}%{_libdir}/clang-analyzer/scan-build/ # And prepare Clang documentation # rm -rf clang-docs mkdir clang-docs for f in LICENSE.TXT NOTES.txt README.txt; do # TODO.txt; do ln tools/clang/$f clang-docs/ done rm -rf clang-docs-full cp -al tools/clang/docs clang-docs-full rm -rf clang-docs-full/{doxygen*,Makefile*,*.graffle,tools} %endif # Get rid of erroneously installed example files. rm %{buildroot}%{_libdir}/%{name}/LLVMHello.so %files %doc LICENSE.TXT %{_bindir}/FileCheck %{_bindir}/count %{_bindir}/llvm-profdata %{_bindir}/not %{_bindir}/bugpoint %{_bindir}/llc %{_bindir}/lli %{_bindir}/lli-child-target %{_bindir}/opt %{_bindir}/llvm-ar %{_bindir}/llvm-as %{_bindir}/llvm-bcanalyzer %{_bindir}/llvm-diff %{_bindir}/llvm-cov %{_bindir}/llvm-dis %{_bindir}/llvm-dwarfdump %{_bindir}/llvm-extract %{_bindir}/llvm-link %{_bindir}/llvm-mc %{_bindir}/llvm-mcmarkup %{_bindir}/llvm-nm %{_bindir}/llvm-objdump %{_bindir}/llvm-ranlib %{_bindir}/llvm-readobj %{_bindir}/llvm-rtdyld %{_bindir}/llvm-size %{_bindir}/llvm-stress %{_bindir}/llvm-symbolizer %{_bindir}/llvm-tblgen %{_bindir}/macho-dump %{_mandir}/man1/bugpoint.1* %{_mandir}/man1/l* %{_mandir}/man1/opt.1* %{_mandir}/man1/tblgen.1* %{_mandir}/man1/FileCheck.1* %{_libdir}/ocaml/* %files -n %libname %{_libdir}/libLLVM-%major.so %files -n %{libname_devel} %{_bindir}/%{name}-config %{_libdir}/libLLVM.so %{_includedir}/%{name} %{_includedir}/%{name}-c %dir %{_libdir}/%{name} %{_libdir}/%{name}/BugpointPasses.so %{_libdir}/%{name}/libLLVM*.a %{_libdir}/%{name}/libLLVM*.so %{_libdir}/%{name}/libLTO.a %{_libdir}/%{name}/libLTO.so %{_libdir}/%{name}/libllvm*.a %dir %{_datadir}/llvm %{_datadir}/llvm/cmake/AddLLVM.cmake %{_datadir}/llvm/cmake/AddLLVMDefinitions.cmake %{_datadir}/llvm/cmake/AddSphinxTarget.cmake %{_datadir}/llvm/cmake/ChooseMSVCCRT.cmake %{_datadir}/llvm/cmake/FindSphinx.cmake %{_datadir}/llvm/cmake/GetSVN.cmake %{_datadir}/llvm/cmake/HandleLLVMOptions.cmake %{_datadir}/llvm/cmake/HandleLLVMStdlib.cmake %{_datadir}/llvm/cmake/LLVM-Config.cmake %{_datadir}/llvm/cmake/LLVMConfig.cmake %{_datadir}/llvm/cmake/LLVMConfigVersion.cmake %{_datadir}/llvm/cmake/LLVMExports.cmake %{_datadir}/llvm/cmake/LLVMParseArguments.cmake %{_datadir}/llvm/cmake/LLVMProcessSources.cmake %{_datadir}/llvm/cmake/TableGen.cmake %doc CREDITS.TXT LICENSE.TXT README.txt %doc docs/*.css %doc docs/*.html %doc docs/_static %doc docs/tutorial %doc docs/ocamldoc %doc docs/CommandGuide %doc examples %if %{with apidoc} %files apidoc %doc docs/doxygen/html/* %endif %if %{with clang} %files -n clang %doc clang-docs/* %{_bindir}/clang* %{_bindir}/c-index-test %{_prefix}/lib/clang %doc %{_mandir}/man1/clang.1.* %files -n %clang_libname %{_libdir}/libclang-%clang_major.so %files -n %{clang_libname_devel} %{_includedir}/clang %{_includedir}/clang-c %{_libdir}/libclang.so %dir %{_libdir}/%{name} %{_libdir}/%{name}/libclang*.a %{_libdir}/%{name}/libclang*.so %files -n clang-analyzer %{_bindir}/scan-build %{_bindir}/scan-view %{_libdir}/clang-analyzer %files -n clang-doc %doc clang-docs-full/* %endif %changelog * Fri Jun 12 2015 tmb <tmb> 3.5.2-1.mga5 + Revision: 823009 - 3.5.2 * Wed Oct 15 2014 umeabot <umeabot> 3.5.0-3.mga5 + Revision: 740652 - Second Mageia 5 Mass Rebuild * Tue Sep 16 2014 umeabot <umeabot> 3.5.0-2.mga5 + Revision: 681969 - Mageia 5 Mass Rebuild * Fri Sep 05 2014 tmb <tmb> 3.5.0-1.mga5 + Revision: 672222 - update filelists - fix build with gcc-4.9 - update to 3.5.0 * Thu Jul 31 2014 tmb <tmb> 3.4.2-2.mga5 + Revision: 658764 - rebuild for new gcc * Mon Jun 16 2014 tmb <tmb> 3.4.2-1.mga5 + Revision: 637632 - add compiler-rt (mga#13141) - llvm major is 3.4, not full version - drop merged patches - update to 3.4.2 * Thu May 22 2014 tmb <tmb> 3.4.1-5.mga5 + Revision: 624841 - disable P102 and P104 tu unbreak BS, will be fixed properly for 3.4.2 - fix libclang versioning - adjust to upstream soname breakage * Wed May 21 2014 tmb <tmb> 3.4.1-4.mga5 + Revision: 624783 - Teach Clang to provide ::max_align_t in C11 and C++11 modes - Headers: Provide an ABI compatible max_align_t when _MSC_VER is defined - Add front-end infrastructure now address space casts are in LLVM IR - R600/SI: allow 5 more input SGPRs to a shader - autoconf: Fix soname for libLLVM-Major.Minor.so * Tue May 13 2014 tmb <tmb> 3.4.1-3.mga5 + Revision: 622539 - push to release * Sun May 11 2014 tmb <tmb> 3.4.1-2.mga5 + Revision: 621933 - properly detect Mageia (mga#11805) * Thu May 08 2014 tmb <tmb> 3.4.1-1.mga5 + Revision: 621249 - update to 3.4.1 * Sun Feb 09 2014 tv <tv> 3.4-1.mga5 + Revision: 586922 - adjust file list - adjust file list - rediff patch - new release * Sat Oct 19 2013 umeabot <umeabot> 3.3-2.mga4 + Revision: 532640 - Mageia 4 Mass Rebuild * Wed Aug 21 2013 tv <tv> 3.3-1.mga4 + Revision: 469106 - adjust file list - new release * Sun Aug 11 2013 tmb <tmb> 3.2-8.mga4 + Revision: 465398 - rebuild with new gcc * Sat Aug 03 2013 tmb <tmb> 3.2-7.mga4 + Revision: 463049 - test gcc-4.8.2 build * Fri Aug 02 2013 shlomif <shlomif> 3.2-6.mga4 + Revision: 462758 - Rebuild for new gcc and libstdc++. * Thu Feb 28 2013 blino <blino> 3.2-5.mga3 + Revision: 400669 - add a clang symlink in scan-build directory since scan-build tries to find clang relatively to its real path * Wed Jan 16 2013 cjw <cjw> 3.2-4.mga3 + Revision: 388816 - new snapshot from r600 branch (20130109) o llvm 3.2 final o AMDGPU target renamed to R600 * Sat Jan 12 2013 umeabot <umeabot> 3.2-3.mga3 + Revision: 358912 - Mass Rebuild - https://wiki.mageia.org/en/Feature:Mageia3MassRebuild * Sat Dec 29 2012 cjw <cjw> 3.2-2.mga3 + Revision: 336162 - 3.2 r600 branch (pre-3.2 release) for mesa 9.1pre - patch1: from 3.2 release svn: fix build with clang 3.2 - enable both x86 and x86-64 targets on x86 and x86-64 hosts * Mon Dec 24 2012 mitya <mitya> 3.2-1.mga3 + Revision: 334668 - Fix build - Cleanup, split apidocs to separate package + kamil <kamil> - get rid of %%clean - remove P1, merged upstream - update Version and Release tago to 3.2 and 1 - new version 3.2 * Sun Oct 14 2012 ennael <ennael> 3.1-8.mga3 + Revision: 305457 - Documentation group * Mon Sep 24 2012 mitya <mitya> 3.1-7.mga3 + Revision: 296968 - Rebuild for GCC 4.7.2 * Thu Sep 06 2012 anssi <anssi> 3.1-6.mga3 + Revision: 288912 - do not create shared library development symlinks for libclang*.a at all since libclang.so only exports a limited set of symbols * Thu Sep 06 2012 anssi <anssi> 3.1-5.mga3 + Revision: 288885 - clang-devel: do not create shared library symlinks for those static libraries that are actually not included in libclang.so, to fix undefined symbol errors when compiling against those (reported by Joseph Wang) - include libclangTooling.a in libclang.so (shared-tooling.patch from upstream) * Thu Aug 30 2012 fwang <fwang> 3.1-4.mga3 + Revision: 285683 - promote correct libdir * Mon Aug 06 2012 luigiwalser <luigiwalser> 3.1-3.mga3 + Revision: 278987 - rebuild for libffi * Fri Aug 03 2012 blino <blino> 3.1-2.mga3 + Revision: 278253 - require llvm in devel package (for tools like llvm-tblgen) * Thu Aug 02 2012 anssi <anssi> 3.1-1.mga3 + Revision: 277999 - new version 3.1 - drop llvm-soname.patch, fixed upstream - re-enable clang - replace the use of %%exclude with explicit file lists * Thu Aug 02 2012 anssi <anssi> 3.0-9.mga3 + Revision: 277981 - fix libification of libllvm3.0 by moving unversioned libraries to the devel package - libify libclang and versionize the shared library - drop llvm-config patch for dynamic linking, and instead provide .so symlinks that match the .a names so that shared linking will be enabled with the regular "llvm-config --libs" output - move clang development libraries to libified clang-devel package - force build with g++ and gcc instead of buildconflicts - strip debug symbols from static libraries to make the llvm-devel package approx. 30 times smaller - in preparation of 3.1 release which will be immediately released after this package release (the main purpose of this intermediate release is to provide a properly libified libllvm3.0): o drop gold LTO link patch, fixed upstream in 3.1 o temporarily disable clang + blino <blino> - buildconflict with clang < 3.1 since it would fail to build with gcc 4.7 headers * Wed Jun 27 2012 fwang <fwang> 3.0-8.mga3 + Revision: 264273 - rebuild for new gcc * Thu Apr 12 2012 blino <blino> 3.0-7.mga2 + Revision: 230547 - move libLLVM.so in devel package * Thu Apr 12 2012 blino <blino> 3.0-6.mga2 + Revision: 230524 - llvm-devel should require the library package * Thu Apr 12 2012 fwang <fwang> 3.0-5.mga2 + Revision: 230344 - add conflicts so that it upgrades correctly * Thu Apr 12 2012 blino <blino> 3.0-4.mga2 + Revision: 230340 - split out static libs, headers and config binary in a devel package - do not package LLVMHello.so (taken from Fedora) - move sub-libs in library package (but exclude big clang) * Wed Apr 11 2012 blino <blino> 3.0-3.mga2 + Revision: 230271 - add clang and enable it by default (most spec bits are copied from Fedora) + fwang <fwang> - add upstream patch to fix gold link * Mon Dec 05 2011 fwang <fwang> 3.0-1.mga2 + Revision: 176830 - update file list - update file list - Copy missing file into the expected location - new version 3.0 * Wed Nov 09 2011 anssi <anssi> 2.9-2.mga2 + Revision: 165987 - split libLLVM shared library to a library package, allowing e.g. DRI drivers to link to it instead of using static linking - make "llvm-config --libs" print the shared library instead of static libraries (config-shared.patch) - add soname to libLLVM (soname.patch) - versionize obsoletes - move the libLLVM shared library to a standard path - build with libffi support - build with PIC enabled on all platforms - drop wrong rpaths from binaries - add development symlink for the libLLVM shared library - fix typo in obsoletes * Wed Jun 22 2011 fwang <fwang> 2.9-1.mga2 + Revision: 111941 - new version 2.9 * Fri Feb 11 2011 ahmad <ahmad> 2.8-4.mga1 + Revision: 50381 - imported package llvm