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 flang # flang (Fortran18) compiler (broken as of 11.0.1)
24 %bcond_with cxxmodules # C++20 modules (requires support in bootstrap compiler)
25 %bcond_with apidocs # doxygen docs (HUGE, so they are not built by default)
26 %bcond_with tests # run tests
27 %bcond_with lowmem # lower memory requirements
29 # No ocaml on other arches or no native ocaml (required for ocaml-ctypes)
30 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
34 %ifarch armv3l armv4b armv4l armv4tl armv5tl armv5tel armv5tejl armv6l armv6hl
38 %ifarch %{arm} aarch64
42 Summary: The Low Level Virtual Machine (An Optimizing Compiler Infrastructure)
43 Summary(pl.UTF-8): Niskopoziomowa maszyna wirtualna (infrastruktura kompilatora optymalizującego)
47 License: University of Illinois/NCSA Open Source License
48 Group: Development/Languages
49 #Source0Download: https://github.com/llvm/llvm-project/releases/
50 Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{name}-%{version}.src.tar.xz
51 # Source0-md5: 6ec7ae9fd43da9b87cda15b3ab9cc7af
52 Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-%{version}.src.tar.xz
53 # Source1-md5: b4cb0b74b1f3292a89c9720f3e1e2934
54 Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/compiler-rt-%{version}.src.tar.xz
55 # Source2-md5: 29d6186e048936008512b8bbdb3a1b71
56 Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lldb-%{version}.src.tar.xz
57 # Source3-md5: e49cde09adb5ed43a651e6d5bcb2aded
58 Source4: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/polly-%{version}.src.tar.xz
59 # Source4-md5: f9cc25cb4e52f1176225ef28d3b4d8ab
60 Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/clang-tools-extra-%{version}.src.tar.xz
61 # Source5-md5: 1e577a85948a0f07483b7c405e59a0ca
62 Source6: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/lld-%{version}.src.tar.xz
63 # Source6-md5: 652c93bd3f78fcb9a02d8d3027f7dae2
64 Source7: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/flang-%{version}.src.tar.xz
65 # Source7-md5: 3d37b40aa1618d8337e9b010d3e24f2d
66 # "mlir" subdir extracted from https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/llvm-project-11.0.1.src.tar.xz
67 Source8: mlir-%{version}.tar.xz
68 # Source8-md5: 97736d1209b01ac52b0dd3c0916f8198
69 Patch1: %{name}-pld.patch
70 Patch2: %{name}-python-modules.patch
71 Patch3: x32-gcc-toolchain.patch
72 Patch4: cmake-buildtype.patch
73 Patch5: %{name}-ocaml-shared.patch
74 Patch6: %{name}-flang.patch
77 BuildRequires: binutils-devel
79 BuildRequires: cmake >= 3.4.3
81 BuildRequires: gcc >= 5:3.4
82 # gcc4 might be installed, but not current __cc
83 %if %(rpmvercmp %{cc_version} 3.4 > /dev/null; test $? = 2 && echo 1 || echo 0)
84 BuildRequires: __cc >= 3.4
87 BuildRequires: libedit-devel
88 BuildRequires: libltdl-devel
89 BuildRequires: libpfm-devel
90 BuildRequires: libstdc++-devel >= 5:3.4
91 BuildRequires: libxml2-devel >= 2
92 BuildRequires: ncurses-devel
94 BuildRequires: ocaml >= 4.00.0
95 BuildRequires: ocaml-ctypes-devel >= 0.4
96 BuildRequires: ocaml-findlib
97 BuildRequires: ocaml-ocamldoc
98 BuildRequires: ocaml-ounit >= 2
100 BuildRequires: perl-base >= 1:5.6
101 BuildRequires: perl-tools-pod
102 BuildRequires: python >= 1:2.7
103 BuildRequires: python-PyYAML
104 BuildRequires: python-pygments >= 2.0
105 BuildRequires: rpm-pythonprov
106 BuildRequires: rpmbuild(macros) >= 1.734
107 %{?with_doc:BuildRequires: sphinx-pdg}
108 BuildRequires: tar >= 1:1.22
110 %{?with_z3:BuildRequires: z3-devel >= 4.7.1}
111 BuildRequires: zlib-devel
113 BuildRequires: doxygen
114 BuildRequires: graphviz
117 BuildRequires: dejagnu
118 BuildRequires: tcl-devel
120 %if %{with rt} && %{with multilib}
122 BuildRequires: gcc-c++-multilib-32
123 BuildRequires: libstdc++-multilib-32-devel
126 BuildRequires: gcc-c++-multilib-32
127 BuildRequires: gcc-c++-multilib-64
128 BuildRequires: glibc-devel(x86_64)
129 BuildRequires: libstdc++-multilib-32-devel
130 BuildRequires: libstdc++-multilib-64-devel
134 BuildRequires: epydoc
135 %ifarch i386 i486 %{arm}
136 BuildRequires: libatomic-devel
138 BuildRequires: libxml2-devel >= 2
139 BuildRequires: ncurses-ext-devel
140 BuildRequires: python-devel >= 1:2.7
141 %{?with_doc:BuildRequires: python3-recommonmark}
142 BuildRequires: swig-python >= 3.0.11
145 #BuildRequires: gmp-devel or imath-devel (private copy in polly/lib/External/isl/imath)
146 # private copy in polly/lib/External/isl
147 #BuildRequires: isl-devel >= 0.18
148 #TODO (bcond): cuda-devel (with POLLY_ENABLE_GPGPU_CODEGEN=ON)
151 BuildConflicts: llvm-ocaml
153 Requires: %{name}-libs = %{version}-%{release}
154 # LLVM is not supported on PPC64
155 # http://llvm.org/bugs/show_bug.cgi?id=3729
157 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
160 %define _sysconfdir /etc/%{name}
162 %define specflags_ppc -fno-var-tracking-assignments
164 # objcopy: BFD (GNU Binutils) 2.32 assertion fail format.c:459
165 # objcopy: error: .../libLLVM-8.so(.debug_gnu_pubtypes) is too large (0x1ceee347 bytes)
166 # objcopy: .../libLLVM-8.so[.debug_gnu_pubtypes]: memory exhausted
168 %define _enable_debug_packages 0
170 # ix86 and x32 - the same issue as https://llvm.org/bugs/show_bug.cgi?id=27237
171 # use -gsplit-dwarf only when building packages with debuginfo
172 # to avoid excessive disk space usage
173 %if 0%{?_enable_debug_packages}
174 %define specflags -gsplit-dwarf
177 # strip corrupts: $RPM_BUILD_ROOT/usr/lib64/llvm-gcc/bin/llvm-c++ ...
178 %define _noautostrip .*/\\(libmud.*\\.a\\|bin/llvm-.*\\|lib.*++\\.a\\)
180 # clang doesn't know -fvar-tracking-assignments, and leaving it here would pollute llvm-config
181 # -Werror=format-security is for swig
182 # TODO: add - -Werror=format-security to tools/lldb/scripts/LLDBWrapPython.cpp
183 %define filterout_c -fvar-tracking-assignments
184 %define filterout_cxx -fvar-tracking-assignments -Werror=format-security
185 %define filterout_ccpp -fvar-tracking-assignments
188 LLVM is a compiler infrastructure designed for compile-time,
189 link-time, runtime, and idle-time optimization of programs from
190 arbitrary programming languages. LLVM is written in C++ and has been
191 developed since 2000 at the University of Illinois and Apple. It
192 currently supports compilation of C and C++ programs using clang
195 %description -l pl.UTF-8
196 LLVM to infrastruktura kompilatora zaprojektowana do optymalizacji
197 czasu kompilowania, linkowania, działania i bezczynności programów w
198 dowolnych językach programowania. Jest napisana w C++, rozwijana od
199 roku 2000 przez Uniwersytet w Illinois i Apple. Aktualnie obsługuje
200 kompilację programów w C i C++ przy użyciu frontendu clang.
203 Summary: LLVM shared libraries
204 Summary(pl.UTF-8): Biblioteki współdzielone LLVM-a
206 Conflicts: llvm < 3.2
209 LLVM shared libraries.
211 %description libs -l pl.UTF-8
212 Biblioteki współdzielone LLVM-a.
215 Summary: Static libraries and header files for LLVM
216 Summary(pl.UTF-8): Biblioteki statyczne i pliki nagłówkowe dla LLVM-a
217 Group: Development/Languages
218 Requires: %{name}-libs = %{version}-%{release}
219 Requires: libstdc++-devel >= 6:3.4
222 This package contains static libraries and header files needed to
223 develop new native programs that use the LLVM infrastructure.
225 %description devel -l pl.UTF-8
226 Ten pakiet zawiera biblioteki statyczne oraz pliki nagłówkowe
227 potrzebne do tworzenia nowych programów natywnych wykorzystujących
231 Summary: Documentation for LLVM
232 Summary(pl.UTF-8): Dokumentacja do LLVM-a
234 # does not require base
237 Documentation for the LLVM compiler infrastructure.
239 %description doc -l pl.UTF-8
240 Dokumentacja do infrastruktury kompilatorów LLVM.
243 Summary: API documentation for LLVM
244 Summary(pl.UTF-8): Dokumentacja API LLVM-a
245 Group: Development/Languages
246 Requires: %{name}-doc = %{version}-%{release}
249 API documentation for the LLVM compiler infrastructure.
251 %description apidocs -l pl.UTF-8
252 Dokumentacja API infrastruktury kompilatorów LLVM.
255 Summary: Polyhedral optimizations for LLVM
256 Summary(pl.UTF-8): Optymalizacje wielościanowe dla LLVM-a
257 Group: Development/Tools
258 URL: http://polly.llvm.org/
259 Requires: %{name} = %{version}-%{release}
262 Polly is a high-level loop and data-locality optimizer and
263 optimization infrastructure for LLVM. It uses an abstract mathematical
264 representation based on integer polyhedra to analyze and optimize the
265 memory access pattern of a program.
267 %description polly -l pl.UTF-8
268 Polly to wysokopoziomowy optymalizator i infrastruktura LLVM-a do
269 optymalizacji pętli i położenia danych. Wykorzystuje abstrakcyjną
270 reprezentację matematyczną opartą na wielościanach całkowitoliczbowych
271 do analizy i optymalizacji wzorców dostępu do pamięci przez program.
274 Summary: Header files for LLVM Polly optimization infrastructure
275 Summary(pl.UTF-8): Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly
276 Group: Development/Libraries
277 URL: http://polly.llvm.org/
278 Requires: %{name}-devel = %{version}-%{release}
279 Requires: %{name}-polly = %{version}-%{release}
281 %description polly-devel
282 Header files for LLVM Polly optimization infrastructure.
284 %description polly-devel -l pl.UTF-8
285 Pliki nagłówkowe infrastruktury optymalizacji LLVM-a Polly.
288 Summary: A C language family frontend for LLVM
289 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C
291 Group: Development/Languages
292 Requires: %{name} = %{version}-%{release}
293 Requires: clang-libs = %{version}-%{release}
295 %description -n clang
296 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
297 of a crane or goose. 3. C-language family front-end toolkit.
299 The goal of the Clang project is to create a new C, C++, Objective C
300 and Objective C++ front-end for the LLVM compiler. Its tools are built
301 as libraries and designed to be loosely-coupled and extendable.
303 %description -n clang -l pl.UTF-8
304 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
305 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
308 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
309 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
310 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
313 %package -n clang-libs
314 Summary: Clang shared libraries
315 Summary(pl.UTF-8): Biblioteki współdzielone Clanga
318 %description -n clang-libs
319 Clang shared libraries.
321 %description -n clang-libs -l pl.UTF-8
322 Biblioteki współdzielone Clanga.
324 %package -n clang-multilib
325 Summary: A C language family frontend for LLVM - 32-bit support
326 Summary(pl.UTF-8): Frontend LLVM-a do języków z rodziny C - obsługa binariów 32-bitowych
328 Group: Development/Languages
329 Requires: clang = %{version}-%{release}
331 %description -n clang-multilib
332 clang: noun 1. A loud, resonant, metallic sound. 2. The strident call
333 of a crane or goose. 3. C-language family front-end toolkit.
335 The goal of the Clang project is to create a new C, C++, Objective C
336 and Objective C++ front-end for the LLVM compiler. Its tools are built
337 as libraries and designed to be loosely-coupled and extendable.
339 This package contains the C compiler support for producing 32-bit
340 programs on 64-bit host.
342 %description -n clang-multilib -l pl.UTF-8
343 clang (z angielskiego): 1. głośny, rezonujący, metaliczny dźwięk; 2.
344 piskliwy odgłos żurawia lub gęsi; 3. narzędzia frontendowe dla języków
347 Celem projektu Clang jest utworzenie nowego frontendu dla kompilatora
348 LLVM do języków C, C++, Objective C i Objective C++. Narzędzia są
349 budowane jako biblioteki i zaprojektowane z myślą o swobodnym łączeniu
352 Ten pakiet zawiera rozszerzenie kompilatora C o obsługę tworzenia
353 programów 32-bitowych na maszynie 64-bitowej.
355 %package -n clang-analyzer
356 Summary: A source code analysis framework
357 Summary(pl.UTF-8): Szkielet do analizy kodu źródłowego
359 Group: Development/Languages
360 Requires: clang = %{version}-%{release}
361 # not picked up automatically since files are currently not instaled
362 # in standard Python hierarchies yet
365 %description -n clang-analyzer
366 The Clang Static Analyzer consists of both a source code analysis
367 framework and a standalone tool that finds bugs in C and Objective-C
368 programs. The standalone tool is invoked from the command-line, and is
369 intended to run in tandem with a build of a project or code base.
371 %description -n clang-analyzer -l pl.UTF-8
372 Clang Static Analyzer składa się ze szkieletu do analizy kodu
373 źródłowego oraz samodzielnego narzędzia znajdującego błędy w
374 programach w C i C++. Narzędzie jest wywoływane z linii poleceń, z
375 myślą o uruchamianiu wraz z kompilacją projektu lub kodu.
377 %package -n clang-devel
378 Summary: Header files for Clang
379 Summary(pl.UTF-8): Pliki nagłówkowe Clanga
380 Group: Development/Languages
381 Requires: %{name}-devel = %{version}-%{release}
382 Requires: clang = %{version}-%{release}
383 %{?with_polly:Requires: llvm-polly-devel = %{version}-%{release}}
385 %description -n clang-devel
386 This package contains header files for the Clang compiler.
388 %description -n clang-devel -l pl.UTF-8
389 Ten pakiet zawiera pliki nagłówkowe kompilatora Clang.
391 %package -n clang-doc
392 Summary: Documentation for Clang
393 Summary(pl.UTF-8): Dokumentacja do Clanga
395 Requires: %{name} = %{version}-%{release}
397 %description -n clang-doc
398 Documentation for the Clang compiler front-end.
400 %description -n clang-doc -l pl.UTF-8
401 Dokumentacja do frontendu kompilatora Clang.
403 %package -n clang-apidocs
404 Summary: API documentation for Clang
405 Summary(pl.UTF-8): Dokumentacja API Clanga
406 Group: Development/Languages
407 Requires: clang-doc = %{version}-%{release}
409 %description -n clang-apidocs
410 API documentation for the Clang compiler.
412 %description -n clang-apidocs -l pl.UTF-8
413 Dokumentacja API kompilatora Clang.
415 %package -n clang-tools-extra
416 Summary: Extra tools for Clang
417 Summary(pl.UTF-8): Dodatkowe narzędzia do kompilatora Clang
418 Group: Development/Tools
419 URL: http://clang.llvm.org/docs/ClangTools.html
420 Requires: clang = %{version}-%{release}
422 %description -n clang-tools-extra
423 Extra tools for Clang.
425 %description -n clang-tools-extra -l pl.UTF-8
426 Dodatkowe narzędzia do kompilatora Clang.
429 Summary: The LLVM linker
430 Summary(pl.UTF-8): Konsolidator z projektu LLVM
431 Group: Development/Libraries
432 URL: http://lld.llvm.org/
433 Requires: %{name} = %{version}-%{release}
436 lld is a new set of modular code for creating linker tools.
438 %description -n lld -l pl.UTF-8
439 lld to nowy zbiór modularnego kodu do tworzenia narzędzi
442 %package -n lld-devel
443 Summary: Development files for LLD linker tools
444 Summary(pl.UTF-8): Pliki programistyczne narzędzi konsolidujących LLD
445 Group: Development/Tools
446 URL: http://lld.llvm.org/
447 Requires: %{name}-devel = %{version}-%{release}
449 %description -n lld-devel
450 Development files for LLD linker tools.
452 %description -n lld-devel -l pl.UTF-8
453 Pliki programistyczne narzędzi konsolidujących LLD.
456 Summary: Next generation high-performance debugger
457 Summary(pl.UTF-8): Wydajny debugger nowej generacji
458 Group: Development/Debuggers
459 URL: http://lldb.llvm.org/
460 Requires: %{name} = %{version}-%{release}
464 LLDB is a next generation, high-performance debugger. It is built as a
465 set of reusable components which highly leverage existing libraries in
466 the larger LLVM Project, such as the Clang expression parser and LLVM
469 %description -n lldb -l pl.UTF-8
470 LLDB to wydajny debugger nowej generacji. Jest zbudowany w oparciu o
471 komponenty wielokrotnego użytku, wykorzystujące istniejące biblioteki
472 w projekcie LLVM, takie jak analizator wyrażeń kompilatora Clang oraz
475 %package -n lldb-devel
476 Summary: Development files for LLDB debugger
477 Summary(pl.UTF-8): Pliki programistyczne debuggera LLDB
478 Group: Development/Libraries
479 URL: http://lldb.llvm.org/
480 Requires: %{name}-devel = %{version}-%{release}
481 Requires: clang-devel = %{version}-%{release}
482 Requires: lldb = %{version}-%{release}
484 %description -n lldb-devel
485 Development files for LLDB debugger.
487 %description -n lldb-devel -l pl.UTF-8
488 Pliki programistyczne debuggera LLDB.
491 Summary: OCaml binding for LLVM
492 Summary(pl.UTF-8): Wiązanie OCamla do LLVM-a
494 Requires: %{name} = %{version}-%{release}
496 %requires_eq ocaml-runtime
500 OCaml binding for LLVM.
502 %description ocaml -l pl.UTF-8
503 Wiązanie OCamla do LLVM-a.
506 Summary: Development files for LLVM OCaml binding
507 Summary(pl.UTF-8): Pliki programistyczne wiązania OCamla do LLVM-a
508 Group: Development/Libraries
509 Requires: %{name}-devel = %{version}-%{release}
510 Requires: %{name}-ocaml = %{version}-%{release}
512 %description ocaml-devel
513 The llvm-ocaml-devel package contains libraries and signature files
514 for developing applications that use llvm-ocaml binding.
516 %description ocaml-devel -l pl.UTF-8
517 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
518 wykorzystujących wiązanie llvm-ocaml.
521 Summary: Documentation for LLVM's OCaml binding
522 Summary(pl.UTF-8): Dokumentacja wiązania OCamla do LLVM-a
524 Requires: %{name}-ocaml = %{version}-%{release}
526 %description ocaml-doc
527 HTML documentation for LLVM's OCaml binding.
529 %description ocaml-doc -l pl.UTF-8
530 Dokumentacja HTML wiązania OCamla do LLVM-a.
533 Summary: Optimization records visualization tools
534 Summary(pl.UTF-8): Narzędzia do wizualizacji rekordów optymalizacji
535 Group: Development/Tools
536 Requires: %{name} = %{version}
539 %description opt-viewer
540 Optimization records visualization tools.
542 %description opt-viewer -l pl.UTF-8
543 Narzędzia do wizualizacji rekordów optymalizacji.
545 %package -n vim-plugin-clang
546 Summary: Clang format and rename integration for Vim
547 Summary(pl.UTF-8): Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem
548 Group: Applications/Editors/Vim
549 Requires: vim-rt >= 4:7.0
552 %description -n vim-plugin-clang
553 Clang format and rename integration for Vim.
555 %description -n vim-plugin-clang -l pl.UTF-8
556 Integracja narzędzi Clang do formatowania i zmiany nazw z Vimem.
559 %setup -q -n %{name}-%{version}.src -a1 %{?with_rt:-a2} %{?with_lldb:-a3} %{?with_polly:-a4} -a5 -a6 %{?with_flang:-a7 -a8}
560 %{__mv} clang-%{version}.src tools/clang
561 %{?with_rt:%{__mv} compiler-rt-%{version}.src projects/compiler-rt}
562 %{?with_lldb:%{__mv} lldb-%{version}.src tools/lldb}
563 %{?with_polly:%{__mv} polly-%{version}.src tools/polly}
564 %{__mv} clang-tools-extra-%{version}.src tools/clang/tools/extra
565 %{__mv} lld-%{version}.src tools/lld
567 %{__mv} flang-%{version}.src tools/flang
568 %{__mv} mlir tools/mlir
580 grep -rl /usr/bin/env projects tools utils | xargs sed -i -e '1{
581 s,^#!.*bin/env python,#!%{__python},
582 s,^#!.*bin/env perl,#!%{__perl},
585 find -name '*.py' -print0 | xargs -0 sed -i -e '1{
586 s,^#!.*bin/python.*,#!%{__python},
592 # Disabling assertions now, rec. by pure and needed for OpenGTL
593 # TESTFIX no PIC on ix86: http://llvm.org/bugs/show_bug.cgi?id=3801
595 CPPFLAGS="%{rpmcppflags} -D_FILE_OFFSET_BITS=64"
598 export CFLAGS="%{rpmcflags} -g0"
599 export CXXFLAGS="%{rpmcxxflags} -g0"
600 export LDFLAGS="%{rpmldflags} -Wl,--reduce-memory-overheads"
604 -DBUILD_SHARED_LIBS:BOOL=OFF \
605 -DENABLE_LINKER_BUILD_ID:BOOL=ON \
606 -DLLVM_BINDINGS_LIST:LIST="%{?with_ocaml:ocaml}" \
607 -DLLVM_BINUTILS_INCDIR:STRING=%{_includedir} \
608 -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
609 -DLLVM_ENABLE_ASSERTIONS:BOOL=OFF \
610 -DLLVM_ENABLE_CXX1Y:BOOL=ON \
612 -DLLVM_ENABLE_DOXYGEN:BOOL=ON \
614 %{?with_cxxmodules:-DLLVM_ENABLE_MODULES:BOOL=ON} \
615 -DLLVM_ENABLE_PIC:BOOL=ON \
616 -DLLVM_ENABLE_RTTI:BOOL=ON \
618 -DLLVM_ENABLE_SPHINX:BOOL=ON \
620 %{!?with_z3:-DLLVM_ENABLE_Z3_SOLVER:BOOL=OFF} \
621 %if "%{_lib}" == "lib64"
622 -DLLVM_LIBDIR_SUFFIX:STRING=64 \
624 %if "%{_lib}" == "libx32"
625 -DLLVM_LIBDIR_SUFFIX:STRING=x32 \
627 -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
628 -DLLVM_DEFAULT_TARGET_TRIPLE:STRING=%{_target_platform} \
630 -DLLVM_PARALLEL_LINK_JOBS:STRING=1 \
632 -DSPHINX_WARNINGS_AS_ERRORS=OFF
636 OPTIMIZE_OPTION="%{rpmcflags} %{rpmcppflags}"
639 %{__make} check 2>&1 | tee llvm-testlog.txt
640 %{__make} -C tools/clang test 2>&1 | tee clang-testlog.txt
644 %{__make} -C docs docs-llvm-html
645 %{__make} -C docs docs-llvm-man
647 %{__make} -C docs ocaml_doc
649 %{__make} -C tools/clang/docs docs-clang-html
650 %{__make} -C tools/clang/docs docs-clang-man
651 %{__make} -C tools/lld/docs docs-lld-html
652 # workaround failed import of _lldb
653 cp -pnL %{_lib}/python%{py_ver}/site-packages/lldb/_lldb.so tools/lldb/docs/lldb
655 LD_LIBRARY_PATH=$(pwd)/%{_lib} \
656 -C tools/lldb/docs lldb-python-doc
657 %{__make} -C tools/lldb/docs lldb-cpp-doc
661 rm -rf $RPM_BUILD_ROOT
663 %{__make} -j1 -C build install \
664 DESTDIR=$RPM_BUILD_ROOT
666 # only some .pyc files are created by make install
667 %py_comp $RPM_BUILD_ROOT%{py_sitedir}
668 %py_ocomp $RPM_BUILD_ROOT%{py_sitedir}
670 # Adjust static analyzer installation
671 # http://clang-analyzer.llvm.org/installation#OtherPlatforms
672 install -d $RPM_BUILD_ROOT%{_libdir}/scan-build
673 %{__mv} $RPM_BUILD_ROOT%{_prefix}/libexec/c??-analyzer $RPM_BUILD_ROOT%{_libdir}/scan-build
674 %{__sed} -i -e 's,/\.\./libexec/,/../%{_lib}/scan-build/,' $RPM_BUILD_ROOT%{_bindir}/scan-build
675 %py_comp $RPM_BUILD_ROOT%{_datadir}/scan-view
676 %py_ocomp $RPM_BUILD_ROOT%{_datadir}/scan-view
677 %py_postclean %{_datadir}/scan-view
679 # not installed by cmake buildsystem
680 install build/bin/pp-trace $RPM_BUILD_ROOT%{_bindir}
683 cp -p build/docs/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
684 # these tools are not installed
685 %{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/{FileCheck,llvm-build}.1
687 echo '.so llvm-ar.1' > $RPM_BUILD_ROOT%{_mandir}/man1/llvm-ranlib.1
690 # Move documentation back to build directory
693 %{__mv} $RPM_BUILD_ROOT%{_docdir}/llvm/ocaml-html ocamldocs
696 # and separate the apidoc
699 cp -a build/tools/clang/docs/html clang-apidoc
702 # And prepare Clang documentation
704 install -d clang-docs
705 for f in LICENSE.TXT NOTES.txt README.txt; do
706 ln tools/clang/$f clang-docs
709 %{__rm} $RPM_BUILD_ROOT%{_bindir}/{c-index-test,llvm-c-test}
711 %{__rm} $RPM_BUILD_ROOT%{_datadir}/clang/clang-format-bbedit.applescript
713 %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/six.py*
714 # it seems it is used internally by an extra clang tool
715 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libfindAllSymbols.a
717 # disable completeness check incompatible with split packaging
718 %{__sed} -i -e '/^foreach(target .*IMPORT_CHECK_TARGETS/,/^endforeach/d; /^unset(_IMPORT_CHECK_TARGETS)/d' $RPM_BUILD_ROOT%{_libdir}/cmake/llvm/LLVMExports.cmake
721 rm -rf $RPM_BUILD_ROOT
723 %post libs -p /sbin/ldconfig
724 %postun libs -p /sbin/ldconfig
726 %post -n clang-libs -p /sbin/ldconfig
727 %postun -n clang-libs -p /sbin/ldconfig
729 %post -n lldb -p /sbin/ldconfig
730 %postun -n lldb -p /sbin/ldconfig
733 %defattr(644,root,root,755)
734 %doc CREDITS.TXT LICENSE.TXT README.txt %{?with_tests:llvm-testlog.txt}
735 %attr(755,root,root) %{_bindir}/bugpoint
736 %attr(755,root,root) %{_bindir}/dsymutil
737 %attr(755,root,root) %{_bindir}/llc
738 %attr(755,root,root) %{_bindir}/lli
739 %attr(755,root,root) %{_bindir}/llvm-addr2line
740 %attr(755,root,root) %{_bindir}/llvm-ar
741 %attr(755,root,root) %{_bindir}/llvm-as
742 %attr(755,root,root) %{_bindir}/llvm-bcanalyzer
743 %attr(755,root,root) %{_bindir}/llvm-cat
744 %attr(755,root,root) %{_bindir}/llvm-cfi-verify
745 %attr(755,root,root) %{_bindir}/llvm-cov
746 %attr(755,root,root) %{_bindir}/llvm-cvtres
747 %attr(755,root,root) %{_bindir}/llvm-cxxdump
748 %attr(755,root,root) %{_bindir}/llvm-cxxfilt
749 %attr(755,root,root) %{_bindir}/llvm-cxxmap
750 %attr(755,root,root) %{_bindir}/llvm-diff
751 %attr(755,root,root) %{_bindir}/llvm-dis
752 %attr(755,root,root) %{_bindir}/llvm-dlltool
753 %attr(755,root,root) %{_bindir}/llvm-dwarfdump
754 %attr(755,root,root) %{_bindir}/llvm-dwp
755 %attr(755,root,root) %{_bindir}/llvm-elfabi
756 %attr(755,root,root) %{_bindir}/llvm-exegesis
757 %attr(755,root,root) %{_bindir}/llvm-extract
758 %attr(755,root,root) %{_bindir}/llvm-gsymutil
759 %attr(755,root,root) %{_bindir}/llvm-ifs
760 %attr(755,root,root) %{_bindir}/llvm-install-name-tool
761 %attr(755,root,root) %{_bindir}/llvm-jitlink
762 %attr(755,root,root) %{_bindir}/llvm-lib
763 %attr(755,root,root) %{_bindir}/llvm-link
764 %attr(755,root,root) %{_bindir}/llvm-lipo
765 %attr(755,root,root) %{_bindir}/llvm-lto
766 %attr(755,root,root) %{_bindir}/llvm-lto2
767 %attr(755,root,root) %{_bindir}/llvm-mc
768 %attr(755,root,root) %{_bindir}/llvm-mca
769 %attr(755,root,root) %{_bindir}/llvm-ml
770 %attr(755,root,root) %{_bindir}/llvm-modextract
771 %attr(755,root,root) %{_bindir}/llvm-mt
772 %attr(755,root,root) %{_bindir}/llvm-nm
773 %attr(755,root,root) %{_bindir}/llvm-objcopy
774 %attr(755,root,root) %{_bindir}/llvm-objdump
775 %attr(755,root,root) %{_bindir}/llvm-opt-report
776 %attr(755,root,root) %{_bindir}/llvm-pdbutil
777 %attr(755,root,root) %{_bindir}/llvm-profdata
778 %attr(755,root,root) %{_bindir}/llvm-ranlib
779 %attr(755,root,root) %{_bindir}/llvm-rc
780 %attr(755,root,root) %{_bindir}/llvm-readelf
781 %attr(755,root,root) %{_bindir}/llvm-readobj
782 %attr(755,root,root) %{_bindir}/llvm-reduce
783 %attr(755,root,root) %{_bindir}/llvm-rtdyld
784 %attr(755,root,root) %{_bindir}/llvm-size
785 %attr(755,root,root) %{_bindir}/llvm-split
786 %attr(755,root,root) %{_bindir}/llvm-strip
787 %attr(755,root,root) %{_bindir}/llvm-stress
788 %attr(755,root,root) %{_bindir}/llvm-strings
789 %attr(755,root,root) %{_bindir}/llvm-symbolizer
790 %attr(755,root,root) %{_bindir}/llvm-tblgen
791 %attr(755,root,root) %{_bindir}/llvm-undname
792 %attr(755,root,root) %{_bindir}/llvm-xray
793 %attr(755,root,root) %{_bindir}/obj2yaml
794 %attr(755,root,root) %{_bindir}/opt
795 %attr(755,root,root) %{_bindir}/sancov
796 %attr(755,root,root) %{_bindir}/sanstats
797 %attr(755,root,root) %{_bindir}/verify-uselistorder
798 %attr(755,root,root) %{_bindir}/yaml2obj
800 %{_mandir}/man1/bugpoint.1*
801 %{_mandir}/man1/dsymutil.1*
802 %{_mandir}/man1/lit.1*
803 %{_mandir}/man1/llc.1*
804 %{_mandir}/man1/lli.1*
805 %{_mandir}/man1/llvm-addr2line.1*
806 %{_mandir}/man1/llvm-ar.1*
807 %{_mandir}/man1/llvm-as.1*
808 %{_mandir}/man1/llvm-bcanalyzer.1*
809 %{_mandir}/man1/llvm-cov.1*
810 %{_mandir}/man1/llvm-cxxfilt.1*
811 %{_mandir}/man1/llvm-cxxmap.1*
812 %{_mandir}/man1/llvm-diff.1*
813 %{_mandir}/man1/llvm-dis.1*
814 %{_mandir}/man1/llvm-dwarfdump.1*
815 %{_mandir}/man1/llvm-exegesis.1*
816 %{_mandir}/man1/llvm-extract.1*
817 %{_mandir}/man1/llvm-lib.1*
818 %{_mandir}/man1/llvm-link.1*
819 %{_mandir}/man1/llvm-lipo.1*
820 %{_mandir}/man1/llvm-locstats.1*
821 %{_mandir}/man1/llvm-mca.1*
822 %{_mandir}/man1/llvm-nm.1*
823 %{_mandir}/man1/llvm-objcopy.1*
824 %{_mandir}/man1/llvm-objdump.1*
825 %{_mandir}/man1/llvm-pdbutil.1*
826 %{_mandir}/man1/llvm-profdata.1*
827 %{_mandir}/man1/llvm-ranlib.1*
828 %{_mandir}/man1/llvm-readelf.1*
829 %{_mandir}/man1/llvm-readobj.1*
830 %{_mandir}/man1/llvm-size.1*
831 %{_mandir}/man1/llvm-stress.1*
832 %{_mandir}/man1/llvm-strings.1*
833 %{_mandir}/man1/llvm-strip.1*
834 %{_mandir}/man1/llvm-symbolizer.1*
835 %{_mandir}/man1/opt.1*
836 %{_mandir}/man1/tblgen.1*
840 %defattr(644,root,root,755)
841 %attr(755,root,root) %{_libdir}/libLLVM-%{abi}.so
843 %attr(755,root,root) %{_libdir}/libLLVM-%{version}.so
844 %attr(755,root,root) %ghost %{_libdir}/libLTO.so.11
845 %attr(755,root,root) %{_libdir}/LLVMgold.so
846 %attr(755,root,root) %{_libdir}/libRemarks.so.11
847 %attr(755,root,root) %{_libdir}/libclang-cpp.so.11
850 %defattr(644,root,root,755)
851 %attr(755,root,root) %{_bindir}/llvm-config
852 %attr(755,root,root) %{_libdir}/libLLVM.so
853 %attr(755,root,root) %{_libdir}/libLTO.so
854 %attr(755,root,root) %{_libdir}/libRemarks.so
855 %attr(755,root,root) %{_libdir}/libclang-cpp.so
856 %{_libdir}/libLLVM*.a
858 %{_includedir}/llvm-c
859 %{_libdir}/cmake/llvm
861 %{_mandir}/man1/llvm-config.1*
865 #%defattr(644,root,root,755)
869 %defattr(644,root,root,755)
875 %defattr(644,root,root,755)
876 %doc tools/polly/{CREDITS.txt,LICENSE.txt,README} tools/polly/www/{bugs,changelog,contributors}.html
877 %attr(755,root,root) %{_libdir}/LLVMPolly.so
880 %defattr(644,root,root,755)
881 %{_libdir}/libPolly.a
882 %{_libdir}/libPollyISL.a
883 %{_libdir}/libPollyPPCG.a
885 %{_libdir}/cmake/polly
889 %defattr(644,root,root,755)
890 %doc clang-docs/{LICENSE.TXT,NOTES.txt,README.txt} %{?with_tests:clang-testlog.txt}
891 %attr(755,root,root) %{_bindir}/clang
892 %attr(755,root,root) %{_bindir}/clang++
893 %attr(755,root,root) %{_bindir}/clang-%{abi}
894 %attr(755,root,root) %{_bindir}/clang-check
895 %attr(755,root,root) %{_bindir}/clang-cl
896 %attr(755,root,root) %{_bindir}/clang-cpp
897 %attr(755,root,root) %{_bindir}/clang-doc
898 %attr(755,root,root) %{_bindir}/clang-format
899 %attr(755,root,root) %{_bindir}/clang-offload-bundler
900 %attr(755,root,root) %{_bindir}/clang-offload-wrapper
901 %attr(755,root,root) %{_bindir}/git-clang-format
902 %dir %{_libdir}/clang
903 %dir %{_libdir}/clang/%{version}
904 %{_libdir}/clang/%{version}/include
906 %ifarch %{x8664} aarch64
907 %dir %{_libdir}/clang/%{version}/bin
908 %attr(755,root,root) %{_libdir}/clang/%{version}/bin/hwasan_symbolize
910 %ifarch %{ix86} %{x8664} aarch64
911 %dir %{_libdir}/clang/%{version}/lib
912 %dir %{_libdir}/clang/%{version}/lib/linux
913 %dir %{_libdir}/clang/%{version}/share
917 %dir %{_libdir}/clang/%{version}/lib
918 %dir %{_libdir}/clang/%{version}/lib/linux
919 %dir %{_libdir}/clang/%{version}/share
923 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-i*86.o
924 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.a
925 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i*86.so
928 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-x86_64.o
929 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
930 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
931 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
934 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-aarch64.o
935 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-aarch64.a
936 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-aarch64.so
937 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-aarch64.a.syms
939 %ifarch %{ix86} %{x8664} %{arm} aarch64 mips mips64 ppc64
940 %{_libdir}/clang/%{version}/share/asan_blacklist.txt
942 %ifarch %{ix86} %{x8664} mips64 aarch64
943 %{_libdir}/clang/%{version}/share/cfi_blacklist.txt
945 %ifarch %{x8664} aarch64 mips64
946 %{_libdir}/clang/%{version}/share/dfsan_abilist.txt
947 %{_libdir}/clang/%{version}/share/msan_blacklist.txt
949 %ifarch %{x8664} aarch64
950 %{_libdir}/clang/%{version}/share/hwasan_blacklist.txt
954 %{_libdir}/clang/%{version}/share/asan_blacklist.txt
955 %{_libdir}/clang/%{version}/share/cfi_blacklist.txt
956 %{_libdir}/clang/%{version}/share/dfsan_abilist.txt
957 %{_libdir}/clang/%{version}/share/msan_blacklist.txt
958 %{_libdir}/clang/%{version}/share/hwasan_blacklist.txt
962 %dir %{_datadir}/clang
963 %{_datadir}/clang/clang-format-diff.py
966 %defattr(644,root,root,755)
967 %attr(755,root,root) %{_libdir}/libclang.so.%{abi}
969 %if %{with rt} && %{with multilib}
971 %files -n clang-multilib
972 %defattr(644,root,root,755)
973 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-i386.o
974 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.a
975 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-i386.so
978 %{_libdir}/clang/%{version}/lib/linux/clang_rt.*-x86_64.o
979 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a
980 %attr(755,root,root) %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.so
981 %{_libdir}/clang/%{version}/lib/linux/libclang_rt.*-x86_64.a.syms
985 %files -n clang-analyzer
986 %defattr(644,root,root,755)
987 %attr(755,root,root) %{_bindir}/scan-build
988 %attr(755,root,root) %{_bindir}/scan-view
989 %{_datadir}/scan-build
990 %{_datadir}/scan-view
991 %{_mandir}/man1/scan-build.1*
992 %dir %{_libdir}/scan-build
993 %attr(755,root,root) %{_libdir}/scan-build/c++-analyzer
994 %attr(755,root,root) %{_libdir}/scan-build/ccc-analyzer
996 %files -n clang-devel
997 %defattr(644,root,root,755)
998 %attr(755,root,root) %{_libdir}/libclang.so
999 %{_libdir}/libclang*.a
1000 %{_includedir}/clang
1001 %{_includedir}/clang-c
1002 %{_includedir}/clang-tidy
1003 %{_libdir}/cmake/clang
1006 %defattr(644,root,root,755)
1007 %doc tools/clang/docs/*.{html,png,txt}
1010 %files -n clang-apidocs
1011 %defattr(644,root,root,755)
1015 %files -n clang-tools-extra
1016 %defattr(644,root,root,755)
1017 %doc tools/clang/tools/extra/{CODE_OWNERS.TXT,README.txt}
1018 %attr(755,root,root) %{_bindir}/clang-apply-replacements
1019 %attr(755,root,root) %{_bindir}/clang-change-namespace
1020 %attr(755,root,root) %{_bindir}/clang-extdef-mapping
1021 %attr(755,root,root) %{_bindir}/clang-include-fixer
1022 %attr(755,root,root) %{_bindir}/clang-move
1023 %attr(755,root,root) %{_bindir}/clang-query
1024 %attr(755,root,root) %{_bindir}/clang-refactor
1025 %attr(755,root,root) %{_bindir}/clang-rename
1026 %attr(755,root,root) %{_bindir}/clang-reorder-fields
1027 %attr(755,root,root) %{_bindir}/clang-scan-deps
1028 %attr(755,root,root) %{_bindir}/clang-tidy
1029 %attr(755,root,root) %{_bindir}/clangd
1030 %attr(755,root,root) %{_bindir}/diagtool
1031 %attr(755,root,root) %{_bindir}/find-all-symbols
1032 %attr(755,root,root) %{_bindir}/hmaptool
1033 %attr(755,root,root) %{_bindir}/modularize
1034 %attr(755,root,root) %{_bindir}/pp-trace
1035 %{_datadir}/clang/clang-include-fixer.py
1036 %{_datadir}/clang/clang-tidy-diff.py
1037 %{_datadir}/clang/run-clang-tidy.py
1038 %{_datadir}/clang/run-find-all-symbols.py
1041 %defattr(644,root,root,755)
1042 %doc tools/lld/{LICENSE.TXT,README.md}
1043 %attr(755,root,root) %{_bindir}/ld.lld
1044 %attr(755,root,root) %{_bindir}/ld64.lld
1045 %attr(755,root,root) %{_bindir}/lld
1046 %attr(755,root,root) %{_bindir}/lld-link
1047 %attr(755,root,root) %{_bindir}/wasm-ld
1050 %defattr(644,root,root,755)
1051 %{_libdir}/liblld[ACDEHMRWXY]*.a
1053 %{_libdir}/cmake/lld
1057 %defattr(644,root,root,755)
1058 %attr(755,root,root) %{_bindir}/lldb
1059 %attr(755,root,root) %{_bindir}/lldb-argdumper
1060 %attr(755,root,root) %{_bindir}/lldb-instr
1061 %attr(755,root,root) %{_bindir}/lldb-server
1062 %attr(755,root,root) %{_bindir}/lldb-vscode
1063 %attr(755,root,root) %{_libdir}/liblldb.so.%{version}
1064 %attr(755,root,root) %ghost %{_libdir}/liblldb.so.11
1065 %attr(755,root,root) %ghost %{_libdir}/liblldbIntelFeatures.so.11
1066 %dir %{py_sitedir}/lldb
1067 %attr(755,root,root) %{py_sitedir}/lldb/lldb-argdumper
1068 %{py_sitedir}/lldb/formatters
1069 %{py_sitedir}/lldb/utils
1070 %{py_sitedir}/lldb/__init__.py[co]
1071 %{py_sitedir}/lldb/embedded_interpreter.py[co]
1072 %attr(755,root,root) %{py_sitedir}/lldb/_lldb.so
1074 %files -n lldb-devel
1075 %defattr(644,root,root,755)
1076 %attr(755,root,root) %{_libdir}/liblldb.so
1077 %attr(755,root,root) %{_libdir}/liblldbIntelFeatures.so
1083 %defattr(644,root,root,755)
1084 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllllvm*.so
1085 %dir %{_libdir}/ocaml/llvm
1086 %{_libdir}/ocaml/llvm/llvm*.cma
1087 %{_libdir}/ocaml/llvm/llvm*.cmi
1088 %{_libdir}/ocaml/META.llvm*
1091 %defattr(644,root,root,755)
1092 %{_libdir}/ocaml/llvm/libllvm*.a
1093 %{_libdir}/ocaml/llvm/llvm*.a
1094 %{_libdir}/ocaml/llvm/llvm*.cmx
1095 %{_libdir}/ocaml/llvm/llvm*.cmxa
1096 %{_libdir}/ocaml/llvm/llvm*.mli
1099 %defattr(644,root,root,755)
1104 %defattr(644,root,root,755)
1105 %{_datadir}/opt-viewer
1107 %files -n vim-plugin-clang
1108 %defattr(644,root,root,755)
1109 %{_datadir}/clang/clang-format.py
1110 %{_datadir}/clang/clang-rename.py