3 # - normal build (x86_64) requires about 80 GB of disk space
7 # %{_datadir}/clang/bash-autocomplete.sh
8 # %{_datadir}/clang/clang-format-sublime.py - sublime plugin
9 # %{_datadir}/clang/clang-format.el - clang tools emacs integration
10 # %{_datadir}/clang/clang-include-fixer.el
11 # %{_datadir}/clang/clang-rename.el
12 # - no content in doc package (it used to contain parts of clang apidocs and some examples)
13 # - system isl in polly?
16 %bcond_without lldb # LLDB debugger
17 %bcond_without polly # Polly cache-locality optimization, auto-parallelism and vectorization
18 %bcond_without rt # compiler-rt libraries
19 %bcond_without multilib # compiler-rt multilib libraries
20 %bcond_without ocaml # OCaml binding
21 %bcond_without z3 # Z3 constraint solver support in Clang Static Analyzer
22 %bcond_without doc # HTML docs and man pages
23 %bcond_with cxxmodules # C++20 modules (requires support in bootstrap compiler)
24 %bcond_with apidocs # doxygen docs (HUGE, so they are not built by default)
25 %bcond_with tests # run tests
26 %bcond_with lowmem # lower memory requirements
28 # No ocaml on other arches or no native ocaml (required for ocaml-ctypes)
29 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
33 %ifarch armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl
37 %ifarch %{arm} aarch64
41 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
42 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
46 License: University of Illinois/NCSA Open Source License
47 Group: Development/Languages
48 #Source0Download: https://github.com/llvm/llvm-project/releases/
49 Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz
50 # Source0-md5: 6ec7ae9fd43da9b87cda15b3ab9cc7af
51 Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz
52 # Source1-md5: b4cb0b74b1f3292a89c9720f3e1e2934
53 Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/compiler-rt-%{version}.src.tar.xz
54 # Source2-md5: 29d6186e048936008512b8bbdb3a1b71
55 Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lldb-%{version}.src.tar.xz
56 # Source3-md5: e49cde09adb5ed43a651e6d5bcb2aded
57 Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/polly-%{version}.src.tar.xz
58 # Source4-md5: f9cc25cb4e52f1176225ef28d3b4d8ab
59 Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-tools-extra-%{version}.src.tar.xz
60 # Source5-md5: 1e577a85948a0f07483b7c405e59a0ca
61 Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz
62 # Source6-md5: 652c93bd3f78fcb9a02d8d3027f7dae2
63 Patch1: %{name}-pld.patch
64 Patch2: %{name}-python-modules.patch
65 Patch3: x32-gcc-toolchain.patch
66 Patch4: cmake-buildtype.patch
67 Patch5: %{name}-ocaml-shared.patch
70 BuildRequires: binutils-devel
72 BuildRequires: cmake >= 3.4.3
74 BuildRequires: gcc >= 5:3.4
75 # gcc4 might be installed, but not current __cc
76 %if %(rpmvercmp %{cc_version} 3.4 > /dev/null; test $? = 2 && echo 1 || echo 0)
77 BuildRequires: __cc >= 3.4
80 BuildRequires: libedit-devel
81 BuildRequires: libltdl-devel
82 BuildRequires: libpfm-devel
83 BuildRequires: libstdc++-devel >= 5:3.4
84 BuildRequires: libxml2-devel >= 2
85 BuildRequires: ncurses-devel
87 BuildRequires: ocaml >= 4.00.0
88 BuildRequires: ocaml-ctypes-devel >= 0.4
89 BuildRequires: ocaml-findlib
90 BuildRequires: ocaml-ocamldoc
91 BuildRequires: ocaml-ounit >= 2
93 BuildRequires: perl-base >= 1:5.6
94 BuildRequires: perl-tools-pod
95 BuildRequires: python >= 1:2.7
96 BuildRequires: python-PyYAML
97 BuildRequires: python-pygments >= 2.0
98 BuildRequires: rpm-pythonprov
99 BuildRequires: rpmbuild(macros) >= 1.734
100 %{?with_doc:BuildRequires: sphinx-pdg}
101 BuildRequires: tar >= 1:1.22
103 %{?with_z3:BuildRequires: z3-devel >= 4.7.1}
104 BuildRequires: zlib-devel
106 BuildRequires: doxygen
107 BuildRequires: graphviz
110 BuildRequires: dejagnu
111 BuildRequires: tcl-devel
113 %if %{with rt} && %{with multilib}
115 BuildRequires: gcc-c++-multilib-32
116 BuildRequires: libstdc++-multilib-32-devel
119 BuildRequires: gcc-c++-multilib-32
120 BuildRequires: gcc-c++-multilib-64
121 BuildRequires: glibc-devel(x86_64)
122 BuildRequires: libstdc++-multilib-32-devel
123 BuildRequires: libstdc++-multilib-64-devel
127 BuildRequires: epydoc
128 %ifarch i386 i486 %{arm}
129 BuildRequires: libatomic-devel
131 BuildRequires: libxml2-devel >= 2
132 BuildRequires: ncurses-ext-devel
133 BuildRequires: python-devel >= 1:2.7
134 %{?with_doc:BuildRequires: python3-recommonmark}
135 BuildRequires: swig-python >= 3.0.11
138 #BuildRequires: gmp-devel or imath-devel (private copy in polly/lib/External/isl/imath)
139 # private copy in polly/lib/External/isl
140 #BuildRequires: isl-devel >= 0.18
141 #TODO (bcond): cuda-devel (with POLLY_ENABLE_GPGPU_CODEGEN=ON)
144 BuildConflicts: llvm-ocaml
146 Requires: %{name}-libs = %{version}-%{release}
147 # LLVM is not supported on PPC64
148 # http://llvm.org/bugs/show_bug.cgi?id=3729
150 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
153 %define _sysconfdir /etc/%{name}
155 %define specflags_ppc -fno-var-tracking-assignments
157 # objcopy: BFD (GNU Binutils) 2.32 assertion fail format.c:459
158 # objcopy: error: .../libLLVM-8.so(.debug_gnu_pubtypes) is too large (0x1ceee347 bytes)
159 # objcopy: .../libLLVM-8.so[.debug_gnu_pubtypes]: memory exhausted
161 %define _enable_debug_packages 0
163 # ix86 and x32 - the same issue as https://llvm.org/bugs/show_bug.cgi?id=27237
164 # use -gsplit-dwarf only when building packages with debuginfo
165 # to avoid excessive disk space usage
166 %if 0%{?_enable_debug_packages}
167 %define specflags -gsplit-dwarf
170 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
171 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
173 # clang doesn't know -fvar-tracking-assignments, and leaving it here would pollute llvm-config
174 # -Werror=format-security is for swig
175 # TODO: add - -Werror=format-security to tools/lldb/scripts/LLDBWrapPython.cpp
176 %define filterout_c -fvar-tracking-assignments
177 %define filterout_cxx -fvar-tracking-assignments -Werror=format-security
178 %define filterout_ccpp -fvar-tracking-assignments
181 LLVM is a compiler infrastructure designed for compile-time,
182 link-time, runtime, and idle-time optimization of programs from
183 arbitrary programming languages. LLVM is written in C++ and has been
184 developed since 2000 at the University of Illinois and Apple. It
185 currently supports compilation of C and C++ programs using clang
188 %description -l pl.UTF-8
189 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
190 czasu kompilowania, linkowania, działania i bezczynności programów w
191 dowolnych językach programowania. Jest napisana w C++, rozwijana od
192 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
193 kompilację programów w C i C++ przy użyciu frontendu clang.
196 Summary: LLVM shared libraries
197 Summary(pl.UTF-8): Biblioteki współdzielone LLVM-a
199 Conflicts: llvm < 3.2
202 LLVM shared libraries.
204 %description libs -l pl.UTF-8
205 Biblioteki współdzielone LLVM-a.
208 Summary: Static libraries and header files for LLVM
209 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
210 Group: Development/Languages
211 Requires: %{name}-libs = %{version}-%{release}
212 Requires: libstdc++-devel >= 6:3.4
215 This package contains static libraries and header files needed to
216 develop new native programs that use the LLVM infrastructure.
218 %description devel -l pl.UTF-8
219 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
220 potrzebne do tworzenia nowych programów natywnych wykorzystujących
224 Summary: Documentation for LLVM
225 Summary(pl.UTF-8): Dokumentacja do LLVM-a
227 # does not require base
230 Documentation for the LLVM compiler infrastructure.
232 %description doc -l pl.UTF-8
233 Dokumentacja do infrastruktury kompilatorów LLVM.
236 Summary: API documentation for LLVM
237 Summary(pl.UTF-8): Dokumentacja API LLVM-a
238 Group: Development/Languages
239 Requires: %{name}-doc = %{version}-%{release}
242 API documentation for the LLVM compiler infrastructure.
244 %description apidocs -l pl.UTF-8
245 Dokumentacja API infrastruktury kompilatorów LLVM.
248 Summary: Polyhedral optimizations for LLVM
249 Summary(pl.UTF-8): Optymalizacje wielościanowe dla LLVM-a
250 Group: Development/Tools
251 URL: http://polly.llvm.org/
252 Requires: %{name} = %{version}-%{release}
255 Polly is a high-level loop and data-locality optimizer and
256 optimization infrastructure for LLVM. It uses an abstract mathematical
257 representation based on integer polyhedra to analyze and optimize the
258 memory access pattern of a program.
260 %description polly -l pl.UTF-8
261 Polly to wysokopoziomowy optymalizator i infrastruktura LLVM-a do
262 optymalizacji pętli i położenia danych. Wykorzystuje abstrakcyjną
263 reprezentację matematyczną opartą na wielościanach całkowitoliczbowych
264 do analizy i optymalizacji wzorców dostępu do pamięci przez program.
267 Summary: Header files for LLVM Polly optimization infrastructure
268 Summary(pl.UTF-8): Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly
269 Group: Development/Libraries
270 URL: http://polly.llvm.org/
271 Requires: %{name}-devel = %{version}-%{release}
272 Requires: %{name}-polly = %{version}-%{release}
274 %description polly-devel
275 Header files for LLVM Polly optimization infrastructure.
277 %description polly-devel -l pl.UTF-8
278 Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly.
281 Summary: A C language family frontend for LLVM
282 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
284 Group: Development/Languages
285 Requires: %{name} = %{version}-%{release}
286 Requires: clang-libs = %{version}-%{release}
288 %description -n clang
289 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
290 of a crane or goose. 3. C-language family front-end toolkit.
292 The goal of the Clang project is to create a new C, C++, Objective C
293 and Objective C++ front-end for the LLVM compiler. Its tools are built
294 as libraries and designed to be loosely-coupled and extendable.
296 %description -n clang -l pl.UTF-8
297 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
298 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
301 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
302 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
303 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
306 %package -n clang-libs
307 Summary: Clang shared libraries
308 Summary(pl.UTF-8): Biblioteki współdzielone Clanga
311 %description -n clang-libs
312 Clang shared libraries.
314 %description -n clang-libs -l pl.UTF-8
315 Biblioteki współdzielone Clanga.
317 %package -n clang-multilib
318 Summary: A C language family frontend for LLVM - 32-bit support
319 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C - obsługa binariów 32-bitowych
321 Group: Development/Languages
322 Requires: clang = %{version}-%{release}
324 %description -n clang-multilib
325 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
326 of a crane or goose. 3. C-language family front-end toolkit.
328 The goal of the Clang project is to create a new C, C++, Objective C
329 and Objective C++ front-end for the LLVM compiler. Its tools are built
330 as libraries and designed to be loosely-coupled and extendable.
332 This package contains the C compiler support for producing 32-bit
333 programs on 64-bit host.
335 %description -n clang-multilib -l pl.UTF-8
336 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
337 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
340 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
341 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
342 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
345 Ten pakiet zawiera rozszerzenie kompilatora C o obsługę tworzenia
346 programów 32-bitowych na maszynie 64-bitowej.
348 %package -n clang-analyzer
349 Summary: A source code analysis framework
350 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
352 Group: Development/Languages
353 Requires: clang = %{version}-%{release}
354 # not picked up automatically since files are currently not instaled
355 # in standard Python hierarchies yet
358 %description -n clang-analyzer
359 The Clang Static Analyzer consists of both a source code analysis
360 framework and a standalone tool that finds bugs in C and Objective-C
361 programs. The standalone tool is invoked from the command-line, and is
362 intended to run in tandem with a build of a project or code base.
364 %description -n clang-analyzer -l pl.UTF-8
365 Clang Static Analyzer składa się ze szkieletu do analizy kodu
366 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
367 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
368 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
370 %package -n clang-devel
371 Summary: Header files for Clang
372 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
373 Group: Development/Languages
374 Requires: %{name}-devel = %{version}-%{release}
375 Requires: clang = %{version}-%{release}
376 %{?with_polly:Requires: llvm-polly-devel = %{version}-%{release}}
378 %description -n clang-devel
379 This package contains header files for the Clang compiler.
381 %description -n clang-devel -l pl.UTF-8
382 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
384 %package -n clang-doc
385 Summary: Documentation for Clang
386 Summary(pl.UTF-8): Dokumentacja do Clanga
388 Requires: %{name} = %{version}-%{release}
390 %description -n clang-doc
391 Documentation for the Clang compiler front-end.
393 %description -n clang-doc -l pl.UTF-8
394 Dokumentacja do frontendu kompilatora Clang.
396 %package -n clang-apidocs
397 Summary: API documentation for Clang
398 Summary(pl.UTF-8): Dokumentacja API Clanga
399 Group: Development/Languages
400 Requires: clang-doc = %{version}-%{release}
402 %description -n clang-apidocs
403 API documentation for the Clang compiler.
405 %description -n clang-apidocs -l pl.UTF-8
406 Dokumentacja API kompilatora Clang.
408 %package -n clang-tools-extra
409 Summary: Extra tools for Clang
410 Summary(pl.UTF-8): Dodatkowe narzędzia do kompilatora Clang
411 Group: Development/Tools
412 URL: http://clang.llvm.org/docs/ClangTools.html
413 Requires: clang = %{version}-%{release}
415 %description -n clang-tools-extra
416 Extra tools for Clang.
418 %description -n clang-tools-extra -l pl.UTF-8
419 Dodatkowe narzędzia do kompilatora Clang.
422 Summary: The LLVM linker
423 Summary(pl.UTF-8): Konsolidator z projektu LLVM
424 Group: Development/Libraries
425 URL: http://lld.llvm.org/
426 Requires: %{name} = %{version}-%{release}
429 lld is a new set of modular code for creating linker tools.
431 %description -n lld -l pl.UTF-8
432 lld to nowy zbiór modularnego kodu do tworzenia narzędzi
435 %package -n lld-devel
436 Summary: Development files for LLD linker tools
437 Summary(pl.UTF-8): Pliki programistyczne narzędzi konsolidujących LLD
438 Group: Development/Tools
439 URL: http://lld.llvm.org/
440 Requires: %{name}-devel = %{version}-%{release}
442 %description -n lld-devel
443 Development files for LLD linker tools.
445 %description -n lld-devel -l pl.UTF-8
446 Pliki programistyczne narzędzi konsolidujących LLD.
449 Summary: Next generation high-performance debugger
450 Summary(pl.UTF-8): Wydajny debugger nowej generacji
451 Group: Development/Debuggers
452 URL: http://lldb.llvm.org/
453 Requires: %{name} = %{version}-%{release}
457 LLDB is a next generation, high-performance debugger. It is built as a
458 set of reusable components which highly leverage existing libraries in
459 the larger LLVM Project, such as the Clang expression parser and LLVM
462 %description -n lldb -l pl.UTF-8
463 LLDB to wydajny debugger nowej generacji. Jest zbudowany w oparciu o
464 komponenty wielokrotnego użytku, wykorzystujące istniejące biblioteki
465 w projekcie LLVM, takie jak analizator wyrażeń kompilatora Clang oraz
468 %package -n lldb-devel
469 Summary: Development files for LLDB debugger
470 Summary(pl.UTF-8): Pliki programistyczne debuggera LLDB
471 Group: Development/Libraries
472 URL: http://lldb.llvm.org/
473 Requires: %{name}-devel = %{version}-%{release}
474 Requires: clang-devel = %{version}-%{release}
475 Requires: lldb = %{version}-%{release}
477 %description -n lldb-devel
478 Development files for LLDB debugger.
480 %description -n lldb-devel -l pl.UTF-8
481 Pliki programistyczne debuggera LLDB.
484 Summary: OCaml binding for LLVM
485 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
487 Requires: %{name} = %{version}-%{release}
489 %requires_eq ocaml-runtime
493 OCaml binding for LLVM.
495 %description ocaml -l pl.UTF-8
496 Wiązanie OCamla do LLVM-a.
499 Summary: Development files for LLVM OCaml binding
500 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
501 Group: Development/Libraries
502 Requires: %{name}-devel = %{version}-%{release}
503 Requires: %{name}-ocaml = %{version}-%{release}
505 %description ocaml-devel
506 The llvm-ocaml-devel package contains libraries and signature files
507 for developing applications that use llvm-ocaml binding.
509 %description ocaml-devel -l pl.UTF-8
510 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
511 wykorzystujących wiązanie llvm-ocaml.
514 Summary: Documentation for LLVM's OCaml binding
515 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
517 Requires: %{name}-ocaml = %{version}-%{release}
519 %description ocaml-doc
520 HTML documentation for LLVM's OCaml binding.
522 %description ocaml-doc -l pl.UTF-8
523 Dokumentacja HTML wiązania OCamla do LLVM-a.
526 Summary: Optimization records visualization tools
527 Summary(pl.UTF-8): Narzędzia do wizualizacji rekordów optymalizacji
528 Group: Development/Tools
529 Requires: %{name} = %{version}
532 %description opt-viewer
533 Optimization records visualization tools.
535 %description opt-viewer -l pl.UTF-8
536 Narzędzia do wizualizacji rekordów optymalizacji.
538 %package -n vim-plugin-clang
539 Summary: Clang format and rename integration for Vim
540 Summary(pl.UTF-8): Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem
541 Group: Applications/Editors/Vim
542 Requires: vim-rt >= 4:7.0
545 %description -n vim-plugin-clang
546 Clang format and rename integration for Vim.
548 %description -n vim-plugin-clang -l pl.UTF-8
549 Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem.
552 %setup -q -n %{name}-%{version}.src -a1 %{?with_rt:-a2} %{?with_lldb:-a3} %{?with_polly:-a4} -a5 -a6
553 %{__mv} clang-%{version}.src tools/clang
554 %{?with_rt:%{__mv} compiler-rt-%{version}.src projects/compiler-rt}
555 %{?with_lldb:%{__mv} lldb-%{version}.src tools/lldb}
556 %{?with_polly:%{__mv} polly-%{version}.src tools/polly}
557 %{__mv} clang-tools-extra-%{version}.src tools/clang/tools/extra
558 %{__mv} lld-%{version}.src tools/lld
566 grep -rl /usr/bin/env projects tools utils | xargs sed -i -e '1{
567 s,^#!.*bin/env python,#!%{__python},
568 s,^#!.*bin/env perl,#!%{__perl},
571 find -name '*.py' -print0 | xargs -0 sed -i -e '1{
572 s,^#!.*bin/python.*,#!%{__python},
578 # Disabling assertions now, rec. by pure and needed for OpenGTL
579 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
581 CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
584 export CFLAGS="%{rpmcflags} -g0"
585 export CXXFLAGS="%{rpmcxxflags} -g0"
586 export LDFLAGS="%{rpmldflags} -Wl,--reduce-memory-overheads"
590 -DBUILD_SHARED_LIBS:BOOL=OFF \
591 -DENABLE_LINKER_BUILD_ID:BOOL=ON \
592 -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
593 -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
594 -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
595 -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
596 -DLLVM_ENABLE_CXX1Y:BOOL=ON \
598 -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
600 %{?with_cxxmodules:-DLLVM_ENABLE_MODULES:BOOL=ON} \
601 -DLLVM_ENABLE_PIC:BOOL=ON \
602 -DLLVM_ENABLE_RTTI:BOOL=ON \
604 -DLLVM_ENABLE_SPHINX:BOOL=ON \
606 %{!?with_z3:-DLLVM_ENABLE_Z3_SOLVER:BOOL=OFF} \
607 %if "%{_lib}" == "lib64"
608 -DLLVM_LIBDIR_SUFFIX:STRING=64 \
610 %if "%{_lib}" == "libx32"
611 -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
613 -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
614 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=%{_target_platform} \
616 -DLLVM_PARALLEL_LINK_JOBS:STRING=1 \
618 -DSPHINX_WARNINGS_AS_ERRORS=OFF
622 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
625 %{__make} check 2>&1 | tee llvm-testlog.txt
626 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
630 %{__make} -C docs docs-llvm-html
631 %{__make} -C docs docs-llvm-man
633 %{__make} -C docs ocaml_doc
635 %{__make} -C tools/clang/docs docs-clang-html
636 %{__make} -C tools/clang/docs docs-clang-man
637 %{__make} -C tools/lld/docs docs-lld-html
638 # workaround failed import of _lldb
639 cp -pnL %{_lib}/python%{py_ver}/site-packages/lldb/_lldb.so tools/lldb/docs/lldb
641 LD_LIBRARY_PATH=$(pwd)/%{_lib} \
642 -C tools/lldb/docs lldb-python-doc
643 %{__make} -C tools/lldb/docs lldb-cpp-doc
647 rm -rf $RPM_BUILD_ROOT
649 %{__make} -j1 -C build install \
650 DESTDIR=$RPM_BUILD_ROOT
652 # only some .pyc files are created by make install
653 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
654 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
656 # Adjust static analyzer installation
657 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
658 install -d $RPM_BUILD_ROOT%{_libdir}/scan-build
659 %{__mv} $RPM_BUILD_ROOT%{_prefix}/libexec/c??-analyzer $RPM_BUILD_ROOT%{_libdir}/scan-build
660 %{__sed} -i -e 's,/\.\./libexec/,/../%{_lib}/scan-build/,' $RPM_BUILD_ROOT%{_bindir}/scan-build
661 %py_comp $RPM_BUILD_ROOT%{_datadir}/scan-view
662 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/scan-view
663 %py_postclean %{_datadir}/scan-view
665 # not installed by cmake buildsystem
666 install build/bin/pp-trace $RPM_BUILD_ROOT%{_bindir}
669 cp -p build/docs/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
670 # these tools are not installed
671 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
673 echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1
676 # Move documentation back to build directory
679 %{__mv} $RPM_BUILD_ROOT%{_docdir}/llvm/ocaml-html ocamldocs
682 # and separate the apidoc
685 cp -a build/tools/clang/docs/html clang-apidoc
688 # And prepare Clang documentation
690 install -d clang-docs
691 for f in LICENSE.TXT NOTES.txt README.txt; do
692 ln tools/clang/$f clang-docs
695 %{__rm} $RPM_BUILD_ROOT%{_bindir}/{c-index-test,llvm-c-test}
697 %{__rm} $RPM_BUILD_ROOT%{_datadir}/clang/clang-format-bbedit.applescript
699 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/six.py*
700 # it seems it is used internally by an extra clang tool
701 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libfindAllSymbols.a
703 # disable completeness check incompatible with split packaging
704 %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_libdir}/cmake/llvm/LLVMExports.cmake
707 rm -rf $RPM_BUILD_ROOT
709 %post libs -p /sbin/ldconfig
710 %postun libs -p /sbin/ldconfig
712 %post -n clang-libs -p /sbin/ldconfig
713 %postun -n clang-libs -p /sbin/ldconfig
715 %post -n lldb -p /sbin/ldconfig
716 %postun -n lldb -p /sbin/ldconfig
719 %defattr(644,root,root,755)
720 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
721 %attr(755,root,root) %{_bindir}/bugpoint
722 %attr(755,root,root) %{_bindir}/dsymutil
723 %attr(755,root,root) %{_bindir}/llc
724 %attr(755,root,root) %{_bindir}/lli
725 %attr(755,root,root) %{_bindir}/llvm-addr2line
726 %attr(755,root,root) %{_bindir}/llvm-ar
727 %attr(755,root,root) %{_bindir}/llvm-as
728 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
729 %attr(755,root,root) %{_bindir}/llvm-cat
730 %attr(755,root,root) %{_bindir}/llvm-cfi-verify
731 %attr(755,root,root) %{_bindir}/llvm-cov
732 %attr(755,root,root) %{_bindir}/llvm-cvtres
733 %attr(755,root,root) %{_bindir}/llvm-cxxdump
734 %attr(755,root,root) %{_bindir}/llvm-cxxfilt
735 %attr(755,root,root) %{_bindir}/llvm-cxxmap
736 %attr(755,root,root) %{_bindir}/llvm-diff
737 %attr(755,root,root) %{_bindir}/llvm-dis
738 %attr(755,root,root) %{_bindir}/llvm-dlltool
739 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
740 %attr(755,root,root) %{_bindir}/llvm-dwp
741 %attr(755,root,root) %{_bindir}/llvm-elfabi
742 %attr(755,root,root) %{_bindir}/llvm-exegesis
743 %attr(755,root,root) %{_bindir}/llvm-extract
744 %attr(755,root,root) %{_bindir}/llvm-gsymutil
745 %attr(755,root,root) %{_bindir}/llvm-ifs
746 %attr(755,root,root) %{_bindir}/llvm-install-name-tool
747 %attr(755,root,root) %{_bindir}/llvm-jitlink
748 %attr(755,root,root) %{_bindir}/llvm-lib
749 %attr(755,root,root) %{_bindir}/llvm-link
750 %attr(755,root,root) %{_bindir}/llvm-lipo
751 %attr(755,root,root) %{_bindir}/llvm-lto
752 %attr(755,root,root) %{_bindir}/llvm-lto2
753 %attr(755,root,root) %{_bindir}/llvm-mc
754 %attr(755,root,root) %{_bindir}/llvm-mca
755 %attr(755,root,root) %{_bindir}/llvm-ml
756 %attr(755,root,root) %{_bindir}/llvm-modextract
757 %attr(755,root,root) %{_bindir}/llvm-mt
758 %attr(755,root,root) %{_bindir}/llvm-nm
759 %attr(755,root,root) %{_bindir}/llvm-objcopy
760 %attr(755,root,root) %{_bindir}/llvm-objdump
761 %attr(755,root,root) %{_bindir}/llvm-opt-report
762 %attr(755,root,root) %{_bindir}/llvm-pdbutil
763 %attr(755,root,root) %{_bindir}/llvm-profdata
764 %attr(755,root,root) %{_bindir}/llvm-ranlib
765 %attr(755,root,root) %{_bindir}/llvm-rc
766 %attr(755,root,root) %{_bindir}/llvm-readelf
767 %attr(755,root,root) %{_bindir}/llvm-readobj
768 %attr(755,root,root) %{_bindir}/llvm-reduce
769 %attr(755,root,root) %{_bindir}/llvm-rtdyld
770 %attr(755,root,root) %{_bindir}/llvm-size
771 %attr(755,root,root) %{_bindir}/llvm-split
772 %attr(755,root,root) %{_bindir}/llvm-strip
773 %attr(755,root,root) %{_bindir}/llvm-stress
774 %attr(755,root,root) %{_bindir}/llvm-strings
775 %attr(755,root,root) %{_bindir}/llvm-symbolizer
776 %attr(755,root,root) %{_bindir}/llvm-tblgen
777 %attr(755,root,root) %{_bindir}/llvm-undname
778 %attr(755,root,root) %{_bindir}/llvm-xray
779 %attr(755,root,root) %{_bindir}/obj2yaml
780 %attr(755,root,root) %{_bindir}/opt
781 %attr(755,root,root) %{_bindir}/sancov
782 %attr(755,root,root) %{_bindir}/sanstats
783 %attr(755,root,root) %{_bindir}/verify-uselistorder
784 %attr(755,root,root) %{_bindir}/yaml2obj
786 %{_mandir}/man1/bugpoint.1*
787 %{_mandir}/man1/dsymutil.1*
788 %{_mandir}/man1/lit.1*
789 %{_mandir}/man1/llc.1*
790 %{_mandir}/man1/lli.1*
791 %{_mandir}/man1/llvm-addr2line.1*
792 %{_mandir}/man1/llvm-ar.1*
793 %{_mandir}/man1/llvm-as.1*
794 %{_mandir}/man1/llvm-bcanalyzer.1*
795 %{_mandir}/man1/llvm-cov.1*
796 %{_mandir}/man1/llvm-cxxfilt.1*
797 %{_mandir}/man1/llvm-cxxmap.1*
798 %{_mandir}/man1/llvm-diff.1*
799 %{_mandir}/man1/llvm-dis.1*
800 %{_mandir}/man1/llvm-dwarfdump.1*
801 %{_mandir}/man1/llvm-exegesis.1*
802 %{_mandir}/man1/llvm-extract.1*
803 %{_mandir}/man1/llvm-lib.1*
804 %{_mandir}/man1/llvm-link.1*
805 %{_mandir}/man1/llvm-lipo.1*
806 %{_mandir}/man1/llvm-locstats.1*
807 %{_mandir}/man1/llvm-mca.1*
808 %{_mandir}/man1/llvm-nm.1*
809 %{_mandir}/man1/llvm-objcopy.1*
810 %{_mandir}/man1/llvm-objdump.1*
811 %{_mandir}/man1/llvm-pdbutil.1*
812 %{_mandir}/man1/llvm-profdata.1*
813 %{_mandir}/man1/llvm-ranlib.1*
814 %{_mandir}/man1/llvm-readelf.1*
815 %{_mandir}/man1/llvm-readobj.1*
816 %{_mandir}/man1/llvm-size.1*
817 %{_mandir}/man1/llvm-stress.1*
818 %{_mandir}/man1/llvm-strings.1*
819 %{_mandir}/man1/llvm-strip.1*
820 %{_mandir}/man1/llvm-symbolizer.1*
821 %{_mandir}/man1/opt.1*
822 %{_mandir}/man1/tblgen.1*
826 %defattr(644,root,root,755)
827 %attr(755,root,root) %{_libdir}/libLLVM-%{abi}.so
829 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
830 %attr(755,root,root) %ghost %{_libdir}/libLTO.so.11
831 %attr(755,root,root) %{_libdir}/LLVMgold.so
832 %attr(755,root,root) %{_libdir}/libRemarks.so.11
833 %attr(755,root,root) %{_libdir}/libclang-cpp.so.11
836 %defattr(644,root,root,755)
837 %attr(755,root,root) %{_bindir}/llvm-config
838 %attr(755,root,root) %{_libdir}/libLLVM.so
839 %attr(755,root,root) %{_libdir}/libLTO.so
840 %attr(755,root,root) %{_libdir}/libRemarks.so
841 %attr(755,root,root) %{_libdir}/libclang-cpp.so
842 %{_libdir}/libLLVM*.a
844 %{_includedir}/llvm-c
845 %{_libdir}/cmake/llvm
847 %{_mandir}/man1/llvm-config.1*
851 #%defattr(644,root,root,755)
855 %defattr(644,root,root,755)
861 %defattr(644,root,root,755)
862 %doc tools/polly/{CREDITS.txt,LICENSE.txt,README} tools/polly/www/{bugs,changelog,contributors}.html
863 %attr(755,root,root) %{_libdir}/LLVMPolly.so
866 %defattr(644,root,root,755)
867 %{_libdir}/libPolly.a
868 %{_libdir}/libPollyISL.a
869 %{_libdir}/libPollyPPCG.a
871 %{_libdir}/cmake/polly
875 %defattr(644,root,root,755)
876 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
877 %attr(755,root,root) %{_bindir}/clang
878 %attr(755,root,root) %{_bindir}/clang++
879 %attr(755,root,root) %{_bindir}/clang-%{abi}
880 %attr(755,root,root) %{_bindir}/clang-check
881 %attr(755,root,root) %{_bindir}/clang-cl
882 %attr(755,root,root) %{_bindir}/clang-cpp
883 %attr(755,root,root) %{_bindir}/clang-doc
884 %attr(755,root,root) %{_bindir}/clang-format
885 %attr(755,root,root) %{_bindir}/clang-offload-bundler
886 %attr(755,root,root) %{_bindir}/clang-offload-wrapper
887 %attr(755,root,root) %{_bindir}/git-clang-format
888 %dir %{_libdir}/clang
889 %dir %{_libdir}/clang/%{version}
890 %{_libdir}/clang/%{version}/include
892 %ifarch %{x8664} aarch64
893 %dir %{_libdir}/clang/%{version}/bin
894 %attr(755,root,root) %{_libdir}/clang/%{version}/bin/hwasan_symbolize
896 %ifarch %{ix86} %{x8664} aarch64
897 %dir %{_libdir}/clang/%{version}/lib
898 %dir %{_libdir}/clang/%{version}/lib/linux
899 %dir %{_libdir}/clang/%{version}/share
903 %dir %{_libdir}/clang/%{version}/lib
904 %dir %{_libdir}/clang/%{version}/lib/linux
905 %dir %{_libdir}/clang/%{version}/share
909 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-i*86.o
910 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.a
911 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.so
914 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-x86_64.o
915 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
916 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
917 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
920 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-aarch64.o
921 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-aarch64.a
922 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-aarch64.so
923 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-aarch64.a.syms
925 %ifarch %{ix86} %{x8664} %{arm} aarch64 mips mips64 ppc64
926 %{_libdir}/clang/%{version}/share/asan_blacklist.txt
928 %ifarch %{ix86} %{x8664} mips64 aarch64
929 %{_libdir}/clang/%{version}/share/cfi_blacklist.txt
931 %ifarch %{x8664} aarch64 mips64
932 %{_libdir}/clang/%{version}/share/dfsan_abilist.txt
933 %{_libdir}/clang/%{version}/share/msan_blacklist.txt
935 %ifarch %{x8664} aarch64
936 %{_libdir}/clang/%{version}/share/hwasan_blacklist.txt
940 %{_libdir}/clang/%{version}/share/asan_blacklist.txt
941 %{_libdir}/clang/%{version}/share/cfi_blacklist.txt
942 %{_libdir}/clang/%{version}/share/dfsan_abilist.txt
943 %{_libdir}/clang/%{version}/share/msan_blacklist.txt
944 %{_libdir}/clang/%{version}/share/hwasan_blacklist.txt
948 %dir %{_datadir}/clang
949 %{_datadir}/clang/clang-format-diff.py
952 %defattr(644,root,root,755)
953 %attr(755,root,root) %{_libdir}/libclang.so.%{abi}
955 %if %{with rt} && %{with multilib}
957 %files -n clang-multilib
958 %defattr(644,root,root,755)
959 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-i386.o
960 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.a
961 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.so
964 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-x86_64.o
965 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
966 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
967 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
971 %files -n clang-analyzer
972 %defattr(644,root,root,755)
973 %attr(755,root,root) %{_bindir}/scan-build
974 %attr(755,root,root) %{_bindir}/scan-view
975 %{_datadir}/scan-build
976 %{_datadir}/scan-view
977 %{_mandir}/man1/scan-build.1*
978 %dir %{_libdir}/scan-build
979 %attr(755,root,root) %{_libdir}/scan-build/c++-analyzer
980 %attr(755,root,root) %{_libdir}/scan-build/ccc-analyzer
982 %files -n clang-devel
983 %defattr(644,root,root,755)
984 %attr(755,root,root) %{_libdir}/libclang.so
985 %{_libdir}/libclang*.a
987 %{_includedir}/clang-c
988 %{_includedir}/clang-tidy
989 %{_libdir}/cmake/clang
992 %defattr(644,root,root,755)
993 %doc tools/clang/docs/*.{html,png,txt}
996 %files -n clang-apidocs
997 %defattr(644,root,root,755)
1001 %files -n clang-tools-extra
1002 %defattr(644,root,root,755)
1003 %doc tools/clang/tools/extra/{CODE_OWNERS.TXT,README.txt}
1004 %attr(755,root,root) %{_bindir}/clang-apply-replacements
1005 %attr(755,root,root) %{_bindir}/clang-change-namespace
1006 %attr(755,root,root) %{_bindir}/clang-extdef-mapping
1007 %attr(755,root,root) %{_bindir}/clang-include-fixer
1008 %attr(755,root,root) %{_bindir}/clang-move
1009 %attr(755,root,root) %{_bindir}/clang-query
1010 %attr(755,root,root) %{_bindir}/clang-refactor
1011 %attr(755,root,root) %{_bindir}/clang-rename
1012 %attr(755,root,root) %{_bindir}/clang-reorder-fields
1013 %attr(755,root,root) %{_bindir}/clang-scan-deps
1014 %attr(755,root,root) %{_bindir}/clang-tidy
1015 %attr(755,root,root) %{_bindir}/clangd
1016 %attr(755,root,root) %{_bindir}/diagtool
1017 %attr(755,root,root) %{_bindir}/find-all-symbols
1018 %attr(755,root,root) %{_bindir}/hmaptool
1019 %attr(755,root,root) %{_bindir}/modularize
1020 %attr(755,root,root) %{_bindir}/pp-trace
1021 %{_datadir}/clang/clang-include-fixer.py
1022 %{_datadir}/clang/clang-tidy-diff.py
1023 %{_datadir}/clang/run-clang-tidy.py
1024 %{_datadir}/clang/run-find-all-symbols.py
1027 %defattr(644,root,root,755)
1028 %doc tools/lld/{LICENSE.TXT,README.md}
1029 %attr(755,root,root) %{_bindir}/ld.lld
1030 %attr(755,root,root) %{_bindir}/ld64.lld
1031 %attr(755,root,root) %{_bindir}/lld
1032 %attr(755,root,root) %{_bindir}/lld-link
1033 %attr(755,root,root) %{_bindir}/wasm-ld
1036 %defattr(644,root,root,755)
1037 %{_libdir}/liblld[ACDEHMRWXY]*.a
1039 %{_libdir}/cmake/lld
1043 %defattr(644,root,root,755)
1044 %attr(755,root,root) %{_bindir}/lldb
1045 %attr(755,root,root) %{_bindir}/lldb-argdumper
1046 %attr(755,root,root) %{_bindir}/lldb-instr
1047 %attr(755,root,root) %{_bindir}/lldb-server
1048 %attr(755,root,root) %{_bindir}/lldb-vscode
1049 %attr(755,root,root) %{_libdir}/liblldb.so.%{version}
1050 %attr(755,root,root) %ghost %{_libdir}/liblldb.so.11
1051 %attr(755,root,root) %ghost %{_libdir}/liblldbIntelFeatures.so.11
1052 %dir %{py_sitedir}/lldb
1053 %attr(755,root,root) %{py_sitedir}/lldb/lldb-argdumper
1054 %{py_sitedir}/lldb/formatters
1055 %{py_sitedir}/lldb/utils
1056 %{py_sitedir}/lldb/__init__.py[co]
1057 %{py_sitedir}/lldb/embedded_interpreter.py[co]
1058 %attr(755,root,root) %{py_sitedir}/lldb/_lldb.so
1060 %files -n lldb-devel
1061 %defattr(644,root,root,755)
1062 %attr(755,root,root) %{_libdir}/liblldb.so
1063 %attr(755,root,root) %{_libdir}/liblldbIntelFeatures.so
1069 %defattr(644,root,root,755)
1070 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllllvm*.so
1071 %dir %{_libdir}/ocaml/llvm
1072 %{_libdir}/ocaml/llvm/llvm*.cma
1073 %{_libdir}/ocaml/llvm/llvm*.cmi
1074 %{_libdir}/ocaml/META.llvm*
1077 %defattr(644,root,root,755)
1078 %{_libdir}/ocaml/llvm/libllvm*.a
1079 %{_libdir}/ocaml/llvm/llvm*.a
1080 %{_libdir}/ocaml/llvm/llvm*.cmx
1081 %{_libdir}/ocaml/llvm/llvm*.cmxa
1082 %{_libdir}/ocaml/llvm/llvm*.mli
1085 %defattr(644,root,root,755)
1090 %defattr(644,root,root,755)
1091 %{_datadir}/opt-viewer
1093 %files -n vim-plugin-clang
1094 %defattr(644,root,root,755)
1095 %{_datadir}/clang/clang-format.py
1096 %{_datadir}/clang/clang-rename.py