From d437c1da04831744e03185edcb4d9648f57e64bd Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Oct 28 2013 17:51:11 +0000 Subject: import mesa-private-llvm-3.3-0.5.20131023.el7.src.rpm --- diff --git a/.mesa-private-llvm.metadata b/.mesa-private-llvm.metadata new file mode 100644 index 0000000..7e1fb22 --- /dev/null +++ b/.mesa-private-llvm.metadata @@ -0,0 +1 @@ +005cfeec9aaae393f707b0f711727637637fe7bb SOURCES/llvm-20131023.tar.xz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/llvm-2.6-timestamp.patch b/SOURCES/llvm-2.6-timestamp.patch new file mode 100644 index 0000000..ab0979e --- /dev/null +++ b/SOURCES/llvm-2.6-timestamp.patch @@ -0,0 +1,11 @@ +--- llvm-2.6/Makefile.rules.timestamp 2009-08-19 18:04:44.000000000 -0400 ++++ llvm-2.6/Makefile.rules 2009-09-09 02:10:38.287389725 -0400 +@@ -672,7 +672,7 @@ + + ProgInstall = $(INSTALL) $(Install.StripFlag) -m 0755 + ScriptInstall = $(INSTALL) -m 0755 +-DataInstall = $(INSTALL) -m 0644 ++DataInstall = $(INSTALL) -p -m 0644 + + # When compiling under Mingw/Cygwin, the tblgen tool expects Windows + # paths. In this case, the SYSPATH function (defined in diff --git a/SOURCES/llvm-Config-config.h b/SOURCES/llvm-Config-config.h new file mode 100644 index 0000000..c369b45 --- /dev/null +++ b/SOURCES/llvm-Config-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "config-32.h" +#elif __WORDSIZE == 64 +#include "config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/SOURCES/llvm-Config-llvm-config.h b/SOURCES/llvm-Config-llvm-config.h new file mode 100644 index 0000000..2fa08c9 --- /dev/null +++ b/SOURCES/llvm-Config-llvm-config.h @@ -0,0 +1,9 @@ +#include + +#if __WORDSIZE == 32 +#include "llvm-config-32.h" +#elif __WORDSIZE == 64 +#include "llvm-config-64.h" +#else +#error "Unknown word size" +#endif diff --git a/SOURCES/llvm-drop-patch-version-number.patch b/SOURCES/llvm-drop-patch-version-number.patch new file mode 100644 index 0000000..4147aef --- /dev/null +++ b/SOURCES/llvm-drop-patch-version-number.patch @@ -0,0 +1,119 @@ +diff -up a/CMakeLists.txt b/CMakeLists.txt +--- a/CMakeLists.txt 2013-10-23 12:54:17.000000000 -0400 ++++ b/CMakeLists.txt 2013-10-23 16:13:12.643785809 -0400 +@@ -12,9 +12,8 @@ set(CMAKE_MODULE_PATH + + set(LLVM_VERSION_MAJOR 3) + set(LLVM_VERSION_MINOR 3) +-set(LLVM_VERSION_PATCH 1) + +-set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}") ++set(PACKAGE_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}") + + option(LLVM_USE_FOLDERS "Enable solution folders in Visual Studio. Disable for Express versions." ON) + if ( LLVM_USE_FOLDERS ) +@@ -488,7 +487,6 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY + set(CPACK_PACKAGE_VENDOR "LLVM") + set(CPACK_PACKAGE_VERSION_MAJOR ${LLVM_VERSION_MAJOR}) + set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_MINOR}) +-set(CPACK_PACKAGE_VERSION_MINOR ${LLVM_VERSION_PATCH}) + add_version_info_from_vcs(CPACK_PACKAGE_VERSION_PATCH) + include(CPack) + +diff -up a/configure b/configure +--- a/configure 2013-10-23 16:08:31.497516101 -0400 ++++ b/configure 2013-10-23 16:15:40.940705106 -0400 +@@ -1,6 +1,6 @@ + #! /bin/sh + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.60 for LLVM 3.3.1. ++# Generated by GNU Autoconf 2.60 for LLVM 3.3. + # + # Report bugs to . + # +@@ -561,8 +561,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} + # Identity of this package. + PACKAGE_NAME='LLVM' + PACKAGE_TARNAME='llvm' +-PACKAGE_VERSION='3.3.1' +-PACKAGE_STRING='LLVM 3.3.1' ++PACKAGE_VERSION='3.3' ++PACKAGE_STRING='LLVM 3.3' + PACKAGE_BUGREPORT='http://llvm.org/bugs/' + + ac_unique_file="lib/IR/Module.cpp" +@@ -1331,7 +1331,7 @@ if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +-\`configure' configures LLVM 3.3.1 to adapt to many kinds of systems. ++\`configure' configures LLVM 3.3 to adapt to many kinds of systems. + + Usage: $0 [OPTION]... [VAR=VALUE]... + +@@ -1397,7 +1397,7 @@ fi + + if test -n "$ac_init_help"; then + case $ac_init_help in +- short | recursive ) echo "Configuration of LLVM 3.3.1:";; ++ short | recursive ) echo "Configuration of LLVM 3.3:";; + esac + cat <<\_ACEOF + +@@ -1559,7 +1559,7 @@ fi + test -n "$ac_init_help" && exit $ac_status + if $ac_init_version; then + cat <<\_ACEOF +-LLVM configure 3.3.1 ++LLVM configure 3.3 + generated by GNU Autoconf 2.60 + + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +@@ -1575,7 +1575,7 @@ cat >config.log <<_ACEOF + This file contains any messages produced by compilers while + running configure, to aid debugging if configure makes a mistake. + +-It was created by LLVM $as_me 3.3.1, which was ++It was created by LLVM $as_me 3.3, which was + generated by GNU Autoconf 2.60. Invocation command line was + + $ $0 $@ +@@ -1939,11 +1939,6 @@ cat >>confdefs.h <<\_ACEOF + _ACEOF + + +-cat >>confdefs.h <<\_ACEOF +-#define LLVM_VERSION_PATCH 1 +-_ACEOF +- +- + LLVM_COPYRIGHT="Copyright (c) 2003-2013 University of Illinois at Urbana-Champaign." + + +@@ -10540,7 +10535,7 @@ else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <&1 + # report actual input values of CONFIG_FILES etc. instead of their + # values after options handling. + ac_log=" +-This file was extended by LLVM $as_me 3.3.1, which was ++This file was extended by LLVM $as_me 3.3, which was + generated by GNU Autoconf 2.60. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES +@@ -23094,7 +23089,7 @@ Report bugs to ." + _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF + ac_cs_version="\\ +-LLVM config.status 3.3.1 ++LLVM config.status 3.3 + configured by $0, generated by GNU Autoconf 2.60, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + diff --git a/SOURCES/make-llvm-snapshot.sh b/SOURCES/make-llvm-snapshot.sh new file mode 100755 index 0000000..40aa6c9 --- /dev/null +++ b/SOURCES/make-llvm-snapshot.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +DIRNAME=llvm-$( date +%Y%m%d ) +URL=http://llvm.org/svn/llvm-project/llvm/branches/release_33/ +#URL=http://llvm.org/svn/llvm-project/llvm/trunk/ + +rm -rf $DIRNAME +svn co $URL $DIRNAME |& tail -1 > revision +mv revision $DIRNAME +rm -rf $DIRNAME/.svn + +tar Jcf $DIRNAME.tar.xz $DIRNAME +rm -rf $DIRNAME diff --git a/SPECS/llvm.spec b/SPECS/llvm.spec new file mode 100644 index 0000000..e093162 --- /dev/null +++ b/SPECS/llvm.spec @@ -0,0 +1,208 @@ +%if 0%{?rhel} == 6 +%define rhel6 1 +%endif + +# llvm works on the 64-bit versions of these, but not the 32 versions. +# consequently we build swrast on them instead of llvmpipe. +ExcludeArch: ppc s390 %{?rhel6:s390x} + +%global svndate 20131023 +#%global prerel rc3 +%global downloadurl http://llvm.org/%{?prerel:pre-}releases/%{version}%{?prerel:/%{prerel}} + +Name: mesa-private-llvm +Version: 3.3 +#Release: 0.4.%{prerel}%{?dist} +Release: 0.5.%{svndate}%{?dist} +Summary: llvm engine for Mesa + +Group: System Environment/Libraries +License: NCSA +URL: http://llvm.org/ +#Source0: %{downloadurl}/llvm-source-%{version}%{?prerel:%{prerel}}.tar.gz +Source0: llvm-%{svndate}.tar.xz +Source1: make-llvm-snapshot.sh +# multilib fixes +Source2: llvm-Config-config.h +Source3: llvm-Config-llvm-config.h + +# Data files should be installed with timestamps preserved +Patch0: llvm-2.6-timestamp.patch +Patch1: llvm-drop-patch-version-number.patch + +BuildRequires: bison +BuildRequires: chrpath +BuildRequires: flex +BuildRequires: gcc-c++ >= 3.4 +BuildRequires: groff +BuildRequires: libtool-ltdl-devel +BuildRequires: zip +# for DejaGNU test suite +BuildRequires: dejagnu tcl-devel python + +%description +This package contains the LLVM-based runtime support for Mesa. It is not a +fully-featured build of LLVM, and use by any package other than Mesa is not +supported. + +%package devel +Summary: Libraries and header files for Mesa's llvm engine +Group: Development/Libraries +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: libstdc++-devel >= 3.4 + +%description devel +This package contains library and header files needed to build the LLVM +support in Mesa. + +%prep +#setup -q -n llvm-%{version}%{?prerel}.src +%setup -q -n llvm-%{svndate} +#setup -q -n llvm.src +rm -r -f tools/clang + +# llvm patches +%patch0 -p1 -b .timestamp +%patch1 -p1 -b .version + +# fix ld search path +sed -i 's|/lib /usr/lib $lt_ld_extra|%{_libdir} $lt_ld_extra|' \ + ./configure + +%build +%configure \ + --prefix=%{_prefix} \ + --libdir=%{_libdir} \ + --includedir=%{_includedir}/mesa-private \ + --with-extra-ld-options=-Wl,-Bsymbolic,--default-symver \ + --enable-targets=host \ +%ifnarch s390x + --enable-experimental-targets=R600 \ +%endif + --enable-bindings=none \ + --enable-debug-runtime \ + --enable-jit \ + --enable-shared \ + --disable-assertions \ + --disable-docs \ + --disable-libffi \ +%ifarch armv7hl armv7l + --with-cpu=cortex-a8 \ + --with-tune=cortex-a8 \ + --with-arch=armv7-a \ + --with-float=hard \ + --with-fpu=vfpv3-d16 \ + --with-abi=aapcs-linux \ +%endif + +# FIXME file this +# configure does not properly specify libdir or includedir +sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}|g' Makefile.config +sed -i 's|(PROJ_prefix)/include|&/mesa-private|g' Makefile.config + +# mangle the library name +sed -i 's|^LLVMVersion.*|&-mesa|' Makefile.config + +# FIXME upstream need to fix this +# llvm-config.cpp hardcodes lib in it +sed -i 's|ActiveLibDir = ActivePrefix + "/lib"|ActiveLibDir = ActivePrefix + "/%{_lib}"|g' tools/llvm-config/llvm-config.cpp +sed -i 's|ActiveIncludeDir = ActivePrefix + "/include|&/mesa-private|g' tools/llvm-config/llvm-config.cpp + +make %{_smp_mflags} VERBOSE=1 OPTIMIZE_OPTION="%{optflags} -fno-strict-aliasing" + +%install +make install DESTDIR=%{buildroot} + +# rename the few binaries we're keeping +mv %{buildroot}%{_bindir}/llvm-config %{buildroot}%{_bindir}/%{name}-config-%{__isa_bits} + +pushd %{buildroot}%{_includedir}/mesa-private/llvm/Config +mv config.h config-%{__isa_bits}.h +cp -p %{SOURCE2} config.h +mv llvm-config.h llvm-config-%{__isa_bits}.h +cp -p %{SOURCE3} llvm-config.h +popd + +file %{buildroot}/%{_bindir}/* %{buildroot}/%{bindir}/*.so | \ + awk -F: '$2~/ELF/{print $1}' | \ + xargs -r chrpath -d + +# FIXME file this bug +sed -i 's,ABS_RUN_DIR/lib",ABS_RUN_DIR/%{_lib}/%{name}",' \ + %{buildroot}%{_bindir}/%{name}-config-%{__isa_bits} + +rm -f %{buildroot}%{_libdir}/*.a + +# remove documentation makefiles: +# they require the build directory to work +find examples -name 'Makefile' | xargs -0r rm -f + +# RHEL: strip out most binaries, most libs, and man pages +ls %{buildroot}%{_bindir}/* | grep -v bin/mesa-private | xargs rm -f +ls %{buildroot}%{_libdir}/* | grep -v libLLVM | xargs rm -f +rm -rf %{buildroot}%{_mandir}/man1 + +# RHEL: Strip out some headers Mesa doesn't need +rm -rf %{buildroot}%{_includedir}/mesa-private/llvm/{Analysis,Assembly} +rm -rf %{buildroot}%{_includedir}/mesa-private/llvm/{DebugInfo,Object,Option} +rm -rf %{buildroot}%{_includedir}/mesa-private/llvm/TableGen + +%check +# the Koji build server does not seem to have enough RAM +# for the default 16 threads + +# LLVM test suite failing on ARM, PPC64 and s390(x) +make check LIT_ARGS="-v -j4" \ +%ifarch %{arm} ppc64 s390x + | tee llvm-testlog-%{_arch}.txt +%else + %{nil} +%endif + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +# also unlike fedora, we don't alternatives around llvm-config +# mesa knows to append -%{__isa_bits} + +%files +%defattr(-,root,root,-) +%doc LICENSE.TXT +%{_libdir}/libLLVM-3.3-mesa.so + +%files devel +%defattr(-,root,root,-) +%{_bindir}/%{name}-config-%{__isa_bits} +%{_includedir}/mesa-private/llvm +%{_includedir}/mesa-private/llvm-c + +%changelog +* Wed Oct 23 2013 Jerome Glisse 3.3-0.5.20131023 +- 3.3.1 snapshot + +* Tue Aug 20 2013 Adam Jackson 3.3-0.4.rc3 +- Build with -fno-strict-aliasing + +* Tue Jun 18 2013 Adam Jackson 3.3-0.3.rc3 +- Port to RHEL6 +- Don't bother building R600 on s390x + +* Tue Jun 11 2013 Adam Jackson 3.3-0.2.rc3 +- 3.3 rc3 +- Drop tblgen +- Strip out some headers + +* Tue May 14 2013 Adam Jackson 3.3-0.1.rc1 +- Update to 3.3 rc1 +- Move library to %%{_libdir} to avoid rpath headaches +- Link with -Bsymbolic and --default-symver +- --disable-libffi +- Misc spec cleanup + +* Wed Dec 05 2012 Adam Jackson 3.1-13 +- Forked spec for RHEL7 Mesa's private use + - no ocaml support + - no doxygen build + - no clang support + - no static archives + - no libraries, binaries, or manpages not needed by Mesa