Репозиторий Sisyphus
Последнее обновление: 1 июня 2020 | Пакетов: 17568 | Посещений: 18677451
en ru br
Репозитории ALT

Группа :: Разработка/C
Пакет: llvm7.0

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

%global v_major 7.0
%global llvm_svnrel %nil
%global clang_svnrel %nil
%global rel alt7
%global llvm_name llvm%v_major
%global clang_name clang%v_major
%global lld_name lld%v_major

# Decrease debuginfo verbosity to reduce memory consumption during final library linking

%define optflags_debug -g1

%def_disable tests
%def_with clang

Name: %llvm_name
Version: 7.0.1
Release: %rel.rel
Summary: The Low Level Virtual Machine

Group: Development/C
License: NCSA
Url: http://llvm.org
Source0: http://llvm.org/releases/%version/llvm-%version.tar
Source1: http://llvm.org/releases/%version/clang-%version.tar
Source2: http://llvm.org/releases/%version/lld-%version.tar
Source3: http://llvm.org/releases/%version/compiler-rt-%version.tar
Patch:  clang-alt-i586-fallback.patch
Patch1: clang-alt-triple.patch
Patch2: llvm-alt-cmake-path.patch
Patch3: llvm-alt-fix-linking.patch
Patch4: llvm-alt-triple.patch
Patch5: compiler-rt-alt-i586-arch.patch
Patch6: RH-0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch7: clang-alt-aarch64-dynamic-linker-path.patch
Patch8: 0001-unittests-Don-t-install-TestPlugin.so.patch
Patch9: 0001-Don-t-set-rpath-when-installing.patch
Patch10: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
Patch11: 0001-AMDGPU-test-for-uniformity-of-branch-instruction-not.patch
Patch12: 0001-llvm-objdump-Implement-z-disassemble-zeroes.patch
Patch13: 0001-llvm-nm-Add-portability-as-alias-for-format-posix.patch
Patch14: lld-7-alt-mipsel-permit-textrels-by-default.patch
Patch15: lld-rL342604-PPC64-Handle-ppc64le-triple-in-getBitcodeMa.patch
Patch16: lld-rLLD344747-PPC64-Fix-offset-checks-on-rel24-call-rel.patch
Patch17: llvm-7-alt-python2.patch

# ThinLTO requires /proc/cpuinfo to exists so the same does llvm

BuildPreReq: /proc

BuildRequires(pre): cmake >= 3.4.3
# Due to %%_libsuff
BuildRequires: rpm-build >= 4.0.4-alt112
BuildRequires: chrpath libstdc++-devel libffi-devel perl-Pod-Parser perl-devel
BuildRequires: python-modules-compiler python-modules-unittest python-modules-xml
BuildRequires: python-modules-json zip zlib-devel
BuildRequires: python-module-sphinx-devel binutils-devel
BuildRequires: ninja-build
%if_with clang
BuildRequires: %clang_name %llvm_name-devel %lld_name
# this should be fixed in rpm macros
%remove_optflags -frecord-gcc-switches

BuildRequires: gcc-c++
%endif #with clang

Provides: llvm = %EVR
Obsoletes: llvm <= 6.0.0

LLVM is a compiler infrastructure designed for compile-time, link-time,
runtime, and idle-time optimization of programs from arbitrary
programming languages. The compiler infrastructure includes mirror sets
of programming tools as well as libraries with equivalent functionality.

%package devel
Group: Development/C
Summary: Libraries and header files for LLVM
Provides: llvm-devel = %EVR
Obsoletes: llvm-devel <= 6.0.0
Requires: %name = %EVR

%description devel
This package contains library and header files needed to develop new
native programs that use the LLVM infrastructure.

%package devel-static
Summary: Static libraries for LLVM
Group: Development/C
Provides: llvm-devel-static = %EVR
Obsoletes: llvm-devel-static <= 6.0.0
Requires: %name-devel = %EVR

%description devel-static
This package contains static libraries needed to develop new
native programs that use the LLVM infrastructure.

%package libs
Group: Development/C
Summary: LLVM shared libraries

%description libs
Shared libraries for the LLVM compiler infrastructure.

%package doc
Summary: Documentation for LLVM
Group: Documentation
BuildArch: noarch
Provides: llvm-doc = %EVR
Obsoletes: llvm-doc <= 6.0.0

%description doc
Documentation for the LLVM compiler infrastructure.

%package -n %clang_name
Summary: A C language family frontend for LLVM
License: NCSA
Group: Development/C
Requires: gcc
Provides: clang = %EVR
Obsoletes: clang <= 6.0.0

%description -n %clang_name
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 extendable.

%package -n %clang_name-libs
Group: Development/C
Summary: clang shared libraries

%description -n %clang_name-libs
Shared libraries for the clang compiler.

%package -n %clang_name-devel
Summary: Header files for clang
Group: Development/C
Provides: clang-devel = %EVR
Obsoletes: clang-devel <= 6.0.0
Requires: %clang_name = %EVR

%description -n %clang_name-devel
This package contains header files for the Clang compiler.

%package -n %clang_name-devel-static
Summary: Static libraries for clang
Group: Development/C
Provides: clang-devel-static = %EVR
Obsoletes: clang-devel-static <= 6.0.0
Requires: %clang_name-devel = %EVR

%description -n %clang_name-devel-static
This package contains static libraries for the Clang compiler.

%package -n %clang_name-analyzer
Summary: A source code analysis framework
License: NCSA
Group: Development/C
BuildArch: noarch
Provides: clang-analyzer = %EVR
Obsoletes: clang-analyzer <= 6.0.0
Requires: %clang_name = %EVR

%description -n %clang_name-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_name-doc
Summary: Documentation for Clang
Group: Documentation
BuildArch: noarch
Provides: clang-doc = %EVR
Obsoletes: clang-doc <= 6.0.0

%description -n %clang_name-doc
Documentation for the Clang compiler front-end.

%package -n %lld_name
Summary: LLD - The LLVM Linker
License: NCSA
Group: Development/C
Provides: lld = %EVR
Obsoletes: lld < %EVR

%description -n %lld_name
LLD is a linker from the LLVM project. That is a drop-in replacement for system
linkers and runs much faster than them. It also provides features that are
useful for toolchain developers.

%package -n %lld_name-devel
Summary: Header files for LLD
Group: Development/C
Provides: lld-devel = %EVR
Requires: %lld_name = %EVR
Obsoletes: lld-devel < %EVR

%description -n %lld_name-devel
This package contains header files for the LLD linker.

%package -n %lld_name-doc
Summary: Documentation for LLD
Group: Documentation
BuildArch: noarch
Provides: lld-doc = %EVR
Obsoletes: lld-doc < %EVR

%description -n %lld_name-doc
Documentation for the LLD linker.

%setup -n llvm-%version -a1 -a2 -a3
for pkg in clang lld; do
  mv $pkg-%version tools/$pkg
mv compiler-rt-%version projects/compiler-rt
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
%patch15 -p1
%patch16 -p1
%patch17 -p1

%cmake -G Ninja \
-DLLVM_BINUTILS_INCDIR="%_includedir/bfd" \
%if_with clang
-DCMAKE_RANLIB:PATH=%_bindir/llvm-ranlib \
-DCMAKE_AR:PATH=%_bindir/llvm-ar \
-DCMAKE_NM:PATH=%_bindir/llvm-nm \
-DCMAKE_AR:PATH=%_bindir/gcc-ar \
-DCMAKE_NM:PATH=%_bindir/gcc-nm \
-DCMAKE_RANLIB:PATH=%_bindir/gcc-ranlib \
-DLLVM_LIBDIR_SUFFIX="%_libsuff" \
%if_enabled tests

ninja \
      -vvv \
      -j %__nprocs \
      -C BUILD

pushd BUILD
cmake -DCMAKE_INSTALL_PREFIX=%buildroot%prefix ../
ninja -C BUILD install

# And prepare Clang documentation

rm -rf BUILD/clang-docs
mkdir -p BUILD/clang-docs
for f in LICENSE.TXT NOTES.txt README.txt; do
 ln tools/clang/$f BUILD/clang-docs/
rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}

file %buildroot%_bindir/* | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d
file %buildroot%_libdir/*.so | awk -F: '$2~/ELF/{print $1}' | xargs -r chrpath -d

%if_enabled tests
ninja -C BUILD check-all || :

%exclude %_bindir/llvm-config*
%exclude %_bindir/*clang*
%exclude %_bindir/c-index-test
%exclude %_bindir/scan-*
%exclude %_man1dir/llvm-config.1.*
%exclude %_man1dir/clang.1*
%exclude %_man1dir/scan-build.1*
%exclude %_bindir/lld*
%exclude %_bindir/ld*.lld
%exclude %_bindir/wasm-ld

%files libs
%exclude %_libdir/LLVMgold.so
%exclude %_libdir/libclang.so.*

%files devel
%exclude %_libdir/libclang.so
%exclude %_datadir/cmake/Modules/llvm/LLVMStaticExports.cmake

%files devel-static
%exclude %_libdir/libclang*.a

%files doc
%doc %_docdir/llvm

%files -n %clang_name
%doc BUILD/clang-docs/*

%files -n %clang_name-libs

%files -n %clang_name-devel

%files -n %clang_name-devel-static

%files -n %clang_name-analyzer

%files -n %clang_name-doc
%doc %_docdir/clang

%files -n %lld_name

%files -n %lld_name-devel
%dir %_includedir/lld

%files -n %lld_name-doc
%doc %_docdir/lld


Полный changelog можно просмотреть здесь

дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin