source: general/prog/llvm.xml@ a14f8e11

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since a14f8e11 was a14f8e11, checked in by Pierre Labastie <pieere@…>, 9 years ago

LLVM figures and add r600 target, + fix doc instructions

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@16386 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 22.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY llvm-download-http "http://llvm.org/releases/&llvm-version;/llvm-&llvm-version;.src.tar.xz">
8 <!ENTITY llvm-download-ftp " ">
9 <!ENTITY llvm-md5sum "b98b9495e5655a672d6cb83e1a180f8e">
10 <!ENTITY llvm-size "14 MB">
11 <!ENTITY llvm-buildsize "1.2 GB (with Clang), and 300 MB for tests">
12 <!ENTITY llvm-time "47 SBU (with Clang)">
13
14 <!ENTITY clang-download-http "http://llvm.org/releases/&llvm-version;/cfe-&llvm-version;.src.tar.xz">
15 <!ENTITY clang-md5sum "8f9d27335e7331cf0a4711e952f21f01">
16 <!ENTITY clang-size " 8.7 MB">
17
18 <!ENTITY rt-version "&llvm-version;">
19 <!ENTITY compiler-rt-download-http "http://llvm.org/releases/&rt-version;/compiler-rt-&rt-version;.src.tar.xz">
20 <!ENTITY compiler-rt-md5sum "383c10affd513026f08936b5525523f5">
21 <!ENTITY compiler-rt-size "1.1 MB">
22]>
23
24<sect1 id="llvm" xreflabel="LLVM-&llvm-version;">
25 <?dbhtml filename="llvm.html" ?>
26
27 <sect1info>
28 <othername>$LastChangedBy$</othername>
29 <date>$Date$</date>
30 </sect1info>
31
32 <title>LLVM-&llvm-version;</title>
33
34 <indexterm zone="llvm">
35 <primary sortas="a-LLVM">LLVM</primary>
36 </indexterm>
37
38 <sect2 role="package">
39 <title>Introduction to LLVM</title>
40
41 <para>
42 The <application>LLVM</application> package contains a collection of
43 modular and reusable compiler and toolchain technologies. The Low Level
44 Virtual Machine (LLVM) Core libraries provide a modern source and
45 target-independent optimizer, along with code generation support for many
46 popular CPUs (as well as some less common ones!). These libraries are
47 built around a well specified code representation known as the LLVM
48 intermediate representation ("LLVM IR").
49 </para>
50
51 <para>
52 The optional <application>Clang</application> and <application>Compiler
53 RT</application> packages provide a new C, C++, Objective C and Objective
54 C++ front-ends and runtime libraries for the
55 <application>LLVM</application>.
56 </para>
57
58 <note>
59 <para>
60 This package hits a bug in GCC-4.9.0 or an unpatched GCC-4.9.1.
61 To build this package, GCC needs to be updated if you have one of
62 these versions. See <xref linkend="gcc"/>
63 for <application>gcc</application> installation instructions.
64 </para>
65 </note>
66
67 &lfs77_checked; &gcc5_checked;
68
69 <bridgehead renderas="sect3">Package Information</bridgehead>
70 <itemizedlist spacing="compact">
71 <listitem>
72 <para>
73 Download (HTTP): <ulink url="&llvm-download-http;"/>
74 </para>
75 </listitem>
76 <listitem>
77 <para>
78 Download (FTP): <ulink url="&llvm-download-ftp;"/>
79 </para>
80 </listitem>
81 <listitem>
82 <para>
83 Download MD5 sum: &llvm-md5sum;
84 </para>
85 </listitem>
86 <listitem>
87 <para>
88 Download size: &llvm-size;
89 </para>
90 </listitem>
91 <listitem>
92 <para>
93 Estimated disk space required: &llvm-buildsize;
94 </para>
95 </listitem>
96 <listitem>
97 <para>
98 Estimated build time: &llvm-time;
99 </para>
100 </listitem>
101 </itemizedlist>
102
103 <bridgehead renderas="sect3">Optional Downloads</bridgehead>
104
105 <bridgehead renderas="sect4">Clang</bridgehead>
106 <itemizedlist spacing="compact">
107 <listitem>
108 <para>
109 Download: <ulink url="&clang-download-http;"/>
110 </para>
111 </listitem>
112 <listitem>
113 <para>
114 Download MD5 sum: &clang-md5sum;
115 </para>
116 </listitem>
117 <listitem>
118 <para>
119 Download size: &clang-size;
120 </para>
121 </listitem>
122 </itemizedlist>
123
124 <bridgehead renderas="sect4">Compiler RT</bridgehead>
125 <itemizedlist spacing="compact">
126 <listitem>
127 <para>
128 Download: <ulink url="&compiler-rt-download-http;"/>
129 </para>
130 </listitem>
131 <listitem>
132 <para>
133 Download MD5 sum: &compiler-rt-md5sum;
134 </para>
135 </listitem>
136 <listitem>
137 <para>
138 Download size: &compiler-rt-size;
139 </para>
140 </listitem>
141 </itemizedlist>
142
143 <bridgehead renderas="sect3">LLVM Dependencies</bridgehead>
144
145 <bridgehead renderas="sect4">Recommended</bridgehead>
146 <para role="recommended">
147 <xref linkend="libffi"/> and
148 <xref linkend="python2"/>
149 </para>
150
151 <bridgehead renderas="sect4">Optional</bridgehead>
152 <para role="optional">
153 <xref linkend="cmake"/>,
154 <xref linkend="doxygen"/>,
155 <xref linkend="graphviz"/>,
156 <xref linkend="libxml2"/>,
157 <xref linkend="texlive"/> (or <xref linkend="tl-installer"/>),
158 <xref linkend="valgrind"/>,
159 <xref linkend="zip"/>,
160 <ulink url="http://www.ocaml.org/">OCaml</ulink>, and
161 <ulink url="http://pypi.python.org/pypi/Sphinx">Sphinx</ulink>
162 </para>
163
164 <para condition="html" role="usernotes">User Notes:
165 <ulink url="&blfs-wiki;/llvm"/>
166 </para>
167 </sect2>
168
169 <sect2 role="installation">
170 <title>Installation of LLVM</title>
171
172 <para>
173 If you have downloaded the optional packages, install them into
174 the source tree by running the following commands:
175 </para>
176
177<screen><userinput>tar -xf ../cfe-&llvm-version;.src.tar.xz -C tools &amp;&amp;
178tar -xf ../compiler-rt-&rt-version;.src.tar.xz -C projects &amp;&amp;
179
180mv tools/cfe-&llvm-version;.src tools/clang &amp;&amp;
181mv projects/compiler-rt-&rt-version;.src projects/compiler-rt</userinput></screen>
182
183<!-- Only for 3.7.0: hopefully fixed on later versions -->
184 <para>
185 The run-time library needs to be fixed for 32 bit installations:
186 </para>
187
188<screen><userinput>sed -r "/ifeq.*CompilerTargetArch/s#i386#i686#g" \
189 -i projects/compiler-rt/make/platform/clang_linux.mk</userinput></screen>
190
191 <para>
192 Install <application>LLVM</application> by running the following
193 commands:
194 </para>
195
196<screen><userinput>sed -e "s:/docs/llvm:/share/doc/llvm-&llvm-version;:" \
197 -i Makefile.config.in &amp;&amp;
198
199mkdir -v build &amp;&amp;
200cd build &amp;&amp;
201
202CC=gcc CXX=g++ \
203../configure --prefix=/usr \
204 --datarootdir=/usr/share \
205 --sysconfdir=/etc \
206 --enable-libffi \
207 --enable-optimized \
208 --enable-shared \
209 --enable-targets=host,r600 \
210 --disable-assertions \
211 --docdir=/usr/share/doc/llvm-&llvm-version; &amp;&amp;
212make</userinput></screen>
213
214 <para>
215 If you have installed <application>Sphinx</application> and wish
216 to generate manual pages, issue the following command:
217 </para>
218
219<screen><userinput>make -C ../docs -f Makefile.sphinx man</userinput></screen>
220
221 <para>
222 To test the results, issue: <command>make -k check-all</command>.
223 Some tests may fail for unknown reasons.
224 </para>
225
226 <para>
227 Now, as the <systemitem class="username">root</systemitem> user:
228 </para>
229
230<screen role="root"><userinput>make install &amp;&amp;
231
232for file in /usr/lib/lib{clang,LLVM,LTO}*.a
233do
234 test -f $file &amp;&amp; chmod -v 644 $file
235done &amp;&amp;
236unset file</userinput></screen>
237
238 <para>
239 If you had <xref linkend="python2"/> installed and you have
240 built <application>Clang</application>, install the
241 <application>Clang Analyzer</application> by running the
242 following command as the
243 <systemitem class="username">root</systemitem> user:
244 </para>
245
246<screen role="root"><userinput>install -v -dm755 /usr/lib/clang-analyzer &amp;&amp;
247
248for prog in scan-build scan-view
249do
250 cp -rfv ../tools/clang/tools/$prog /usr/lib/clang-analyzer/
251 ln -sfv ../lib/clang-analyzer/$prog/$prog /usr/bin/
252done &amp;&amp;
253
254ln -sfv /usr/bin/clang /usr/lib/clang-analyzer/scan-build/ &amp;&amp;
255mv -v /usr/lib/clang-analyzer/scan-build/scan-build.1 /usr/share/man/man1/ &amp;&amp;
256unset prog</userinput></screen>
257
258 <para>
259 If you have built manual pages, install them by running the
260 following command as the
261 <systemitem class="username">root</systemitem> user:
262 </para>
263
264<screen role="root"><userinput>install -v -m644 ../docs/_build/man/* /usr/share/man/man1/</userinput></screen>
265
266 </sect2>
267
268 <sect2 role="commands">
269 <title>Command Explanations</title>
270
271 <para>
272 <command>sed -e ... Makefile.config.in</command>: This sed fixes
273 location of the installed documentation.
274 </para>
275
276 <para>
277 <parameter>--enable-libffi</parameter>: This switch enables
278 <application>LLVM</application> to use
279 <application>libffi</application>. Remove if you did not
280 install <application>libffi</application>.
281 </para>
282
283 <para>
284 <parameter>--enable-optimized</parameter>: This switch enables
285 compiler optimizations in order to speed up the code and reduce
286 its size.
287 </para>
288
289 <para>
290 <parameter>--enable-shared</parameter>: This switch enables
291 building of the <application>LLVM</application> shared
292 library which contains all of the static libraries linked into
293 a single library.
294 </para>
295
296 <para>
297 <parameter>--enable-targets=host,r600</parameter>: This switch enables
298 building for the same target as the host, and also for the r600 AMD GPU
299 used by the Mesa r600 and radeonsi drivers. Default is all. You can use
300 a comma separated list. Valid targets are: host, x86, x86_64, sparc,
301 powerpc, arm64, arm, aarch64, mips, hexagon, xcore, msp430, nvptx,
302 systemz, r600, amdgpu (equivalent to r600), bpf, wasm, and cpp.
303 </para>
304
305 <para>
306 <parameter>--disable-assertions</parameter>: Disable some compile checks,
307 not necessary on a production system.
308 </para>
309
310 </sect2>
311
312 <sect2 role="content">
313 <title>Contents</title>
314
315 <segmentedlist>
316 <segtitle>Installed Programs</segtitle>
317 <segtitle>Installed Libraries</segtitle>
318 <segtitle>Installed Directories</segtitle>
319
320 <seglistitem>
321 <seg>
322 bugpoint, c-index-test, clang, clang++ (symlink), count, FileCheck,
323 clang-check, clang-format, clang-tblgen, llc, lli, lli-child-target,
324 llvm-ar, llvm-as, llvm-bcanalyzer, llvm-config, llvm-cov,
325 llvm-cxxdump, llvm-diff, llvm-dis, llvm-dsymutil, llvm-dwarfdump,
326 llvm-extract, llvm-link, llvm-mc, llvm-mcmarkup, llvm-nm,
327 llvm-objdump, llvm-pdbdump, llvm-profdata, llvm-ranlib (symlink),
328 llvm-readobj, llvm-rtdyld, llvm-size, llvm-stress, llvm-symbolizer,
329 llvm-tblgen, macho-dump, not, obj2yaml, opt, scan-build (symlink),
330 scan-view (symlink), verify-uselistorder, and yaml2obj
331 </seg>
332 <seg>
333 BugpointPasses.so, libclang.so, libLLVM-&llvm-version;.so,
334 libLTO.so,<!-- libprofile_rt.so,--> LLVMHello.so and numerous
335 static libraries in /usr/lib
336 </seg>
337 <seg>
338 /usr/include/{clang,clang-c,llvm,llvm-c},
339 /usr/lib/{clang,clang-analyzer}, and
340 /usr/share/{doc/llvm-&llvm-version;,llvm}
341 </seg>
342 </seglistitem>
343 </segmentedlist>
344
345 <variablelist>
346 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
347 <?dbfo list-presentation="list"?>
348 <?dbhtml list-presentation="table"?>
349
350 <varlistentry id="bugpoint">
351 <term><command>bugpoint</command></term>
352 <listitem>
353 <para>
354 is the automatic test case reduction tool.
355 </para>
356 <indexterm zone="llvm bugpoint">
357 <primary sortas="b-bugpoint">bugpoint</primary>
358 </indexterm>
359 </listitem>
360 </varlistentry>
361
362 <varlistentry id="clang">
363 <term><command>clang</command></term>
364 <listitem>
365 <para>
366 is the <application>Clang</application> C, C++,
367 and Objective-C compiler.
368 </para>
369 <indexterm zone="llvm clang">
370 <primary sortas="b-clang">clang</primary>
371 </indexterm>
372 </listitem>
373 </varlistentry>
374
375 <varlistentry id="llc">
376 <term><command>llc</command></term>
377 <listitem>
378 <para>
379 is the <application>LLVM</application> static compiler.
380 </para>
381 <indexterm zone="llvm llc">
382 <primary sortas="b-llc">llc</primary>
383 </indexterm>
384 </listitem>
385 </varlistentry>
386
387 <varlistentry id="lli">
388 <term><command>lli</command></term>
389 <listitem>
390 <para>
391 is used to directly execute programs from
392 <application>LLVM</application> bitcode.
393 </para>
394 <indexterm zone="llvm lli">
395 <primary sortas="b-lli">lli</primary>
396 </indexterm>
397 </listitem>
398 </varlistentry>
399
400 <varlistentry id="llvm-ar">
401 <term><command>llvm-ar</command></term>
402 <listitem>
403 <para>
404 is the <application>LLVM</application> archiver.
405 </para>
406 <indexterm zone="llvm llvm-ar">
407 <primary sortas="b-llvm-ar">llvm-ar</primary>
408 </indexterm>
409 </listitem>
410 </varlistentry>
411
412 <varlistentry id="llvm-as">
413 <term><command>llvm-as</command></term>
414 <listitem>
415 <para>
416 is the <application>LLVM</application> assembler.
417 </para>
418 <indexterm zone="llvm llvm-as">
419 <primary sortas="b-llvm-as">llvm-as</primary>
420 </indexterm>
421 </listitem>
422 </varlistentry>
423
424 <varlistentry id="llvm-bcanalyzer">
425 <term><command>llvm-bcanalyzer</command></term>
426 <listitem>
427 <para>
428 is the <application>LLVM</application> bitcode analyzer.
429 </para>
430 <indexterm zone="llvm llvm-bcanalyzer">
431 <primary sortas="b-llvm-bcanalyzer">llvm-bcanalyzer</primary>
432 </indexterm>
433 </listitem>
434 </varlistentry>
435
436 <varlistentry id="llvm-config">
437 <term><command>llvm-config</command></term>
438 <listitem>
439 <para>
440 Prints <application>LLVM</application> compilation options.
441 </para>
442 <indexterm zone="llvm llvm-config">
443 <primary sortas="b-llvm-config">llvm-config</primary>
444 </indexterm>
445 </listitem>
446 </varlistentry>
447
448 <varlistentry id="llvm-cov">
449 <term><command>llvm-cov</command></term>
450 <listitem>
451 <para>
452 is used to emit coverage information.
453 </para>
454 <indexterm zone="llvm llvm-cov">
455 <primary sortas="b-llvm-cov">llvm-cov</primary>
456 </indexterm>
457 </listitem>
458 </varlistentry>
459
460 <varlistentry id="llvm-cxxdump">
461 <term><command>llvm-cxxdump</command></term>
462 <listitem>
463 <para>
464 is used for C++ ABI Data Dumper.
465 </para>
466 <indexterm zone="llvm llvm-cxxdump">
467 <primary sortas="b-llvm-cxxdump">llvm-cxxdump</primary>
468 </indexterm>
469 </listitem>
470 </varlistentry>
471
472 <varlistentry id="llvm-diff">
473 <term><command>llvm-diff</command></term>
474 <listitem>
475 <para>
476 is the <application>LLVM</application> structural
477 '<command>diff</command>'.
478 </para>
479 <indexterm zone="llvm llvm-diff">
480 <primary sortas="b-llvm-diff">llvm-diff</primary>
481 </indexterm>
482 </listitem>
483 </varlistentry>
484
485 <varlistentry id="llvm-dis">
486 <term><command>llvm-dis</command></term>
487 <listitem>
488 <para>
489 is the <application>LLVM</application> disassembler.
490 </para>
491 <indexterm zone="llvm llvm-dis">
492 <primary sortas="b-llvm-dis">llvm-dis</primary>
493 </indexterm>
494 </listitem>
495 </varlistentry>
496
497 <varlistentry id="llvm-dsymutil">
498 <term><command>llvm-dsymutil</command></term>
499 <listitem>
500 <para>
501 tool used to manipulate archived DWARF debug symbol files,
502 compatible with the Darwin command <command>dsymutil</command>.
503 </para>
504 <indexterm zone="llvm llvm-dsymutil">
505 <primary sortas="b-llvm-dsymutil">llvm-dsymutil</primary>
506 </indexterm>
507 </listitem>
508 </varlistentry>
509
510 <varlistentry id="llvm-extract">
511 <term><command>llvm-extract</command></term>
512 <listitem>
513 <para>
514 is used to extract a function from an
515 <application>LLVM</application> module.
516 </para>
517 <indexterm zone="llvm llvm-extract">
518 <primary sortas="b-llvm-extract">llvm-extract</primary>
519 </indexterm>
520 </listitem>
521 </varlistentry>
522
523 <varlistentry id="llvm-link">
524 <term><command>llvm-link</command></term>
525 <listitem>
526 <para>
527 is the <application>LLVM</application> linker.
528 </para>
529 <indexterm zone="llvm llvm-link">
530 <primary sortas="b-llvm-link">llvm-link</primary>
531 </indexterm>
532 </listitem>
533 </varlistentry>
534
535 <varlistentry id="llvm-nm">
536 <term><command>llvm-nm</command></term>
537 <listitem>
538 <para>
539 is used to list <application>LLVM</application> bitcode
540 and object file's symbol table.
541 </para>
542 <indexterm zone="llvm llvm-nm">
543 <primary sortas="b-llvm-nm">llvm-nm</primary>
544 </indexterm>
545 </listitem>
546 </varlistentry>
547
548 <varlistentry id="llvm-pdbdump">
549 <term><command>llvm-pdbdump</command></term>
550 <listitem>
551 <para>
552 is used as PDB Dumper.
553 </para>
554 <indexterm zone="llvm llvm-pdbdump">
555 <primary sortas="b-llvm-pdbdump">llvm-pdbdump</primary>
556 </indexterm>
557 </listitem>
558 </varlistentry>
559<!--
560 <varlistentry id="llvm-prof">
561 <term><command>llvm-prof</command></term>
562 <listitem>
563 <para>
564 is used to print execution profile of
565 <application>LLVM</application> program.
566 </para>
567 <indexterm zone="llvm llvm-prof">
568 <primary sortas="b-llvm-prof">llvm-prof</primary>
569 </indexterm>
570 </listitem>
571 </varlistentry>-->
572
573 <varlistentry id="llvm-ranlib">
574 <term><command>llvm-ranlib</command></term>
575 <listitem>
576 <para>
577 is used to generate index for <application>LLVM</application>
578 archive.
579 </para>
580 <indexterm zone="llvm llvm-ranlib">
581 <primary sortas="b-llvm-ranlib">llvm-ranlib</primary>
582 </indexterm>
583 </listitem>
584 </varlistentry>
585
586 <varlistentry id="llvm-stress">
587 <term><command>llvm-stress</command></term>
588 <listitem>
589 <para>
590 is used to generate random
591 <filename class="extension">.ll</filename> files.
592 </para>
593 <indexterm zone="llvm llvm-stress">
594 <primary sortas="b-llvm-stress">llvm-stress</primary>
595 </indexterm>
596 </listitem>
597 </varlistentry>
598
599 <varlistentry id="llvm-tblgen">
600 <term><command>llvm-tblgen</command></term>
601 <listitem>
602 <para>
603 is the <application>LLVM</application> Target Description
604 To C++ Code Generator.
605 </para>
606 <indexterm zone="llvm llvm-tblgen">
607 <primary sortas="b-llvm-tblgen">llvm-tblgen</primary>
608 </indexterm>
609 </listitem>
610 </varlistentry>
611
612 <varlistentry id="obj2yaml">
613 <term><command>obj2yaml</command></term>
614 <listitem>
615 <para>
616 takes an object file,and produces a YAML representation of the
617 file.
618 </para>
619 <indexterm zone="llvm obj2yaml">
620 <primary sortas="b-obj2yaml">obj2yaml</primary>
621 </indexterm>
622 </listitem>
623 </varlistentry>
624
625 <varlistentry id="opt">
626 <term><command>opt</command></term>
627 <listitem>
628 <para>
629 is the <application>LLVM</application> optimizer.
630 </para>
631 <indexterm zone="llvm opt">
632 <primary sortas="b-opt">opt</primary>
633 </indexterm>
634 </listitem>
635 </varlistentry>
636
637 <varlistentry id="scan-build">
638 <term><command>scan-build</command></term>
639 <listitem>
640 <para>
641 is a <application>Perl</application> script that invokes the
642 <application>Clang</application> static analyzer.
643 </para>
644 <indexterm zone="llvm scan-build">
645 <primary sortas="b-scan-build">scan-build</primary>
646 </indexterm>
647 </listitem>
648 </varlistentry>
649
650 <varlistentry id="yaml2obj">
651 <term><command>yaml2obj</command></term>
652 <listitem>
653 <para>
654 takes a YAML representation of an object file and converts it
655 to an binary file.
656 </para>
657 <indexterm zone="llvm yaml2obj">
658 <primary sortas="b-yaml2obj">yaml2obj</primary>
659 </indexterm>
660 </listitem>
661 </varlistentry>
662
663 <varlistentry id="libllvm">
664 <term><filename class="libraryfile">libLLVM-&llvm-version;.so</filename></term>
665 <listitem>
666 <para>
667 contains the <application>LLVM</application> API functions.
668 </para>
669 <indexterm zone="llvm libllvm">
670 <primary sortas="c-libllvm">libLLVM-&llvm-version;.so</primary>
671 </indexterm>
672 </listitem>
673 </varlistentry>
674<!--
675 <varlistentry id="libprofile_rt">
676 <term><filename class="libraryfile">libprofile_rt.so</filename></term>
677 <listitem>
678 <para>
679 is the C, C++ and Objective-C runtime library for
680 <application>Clang</application>.
681 </para>
682 <indexterm zone="llvm libprofile_rt">
683 <primary sortas="c-libprofile_rt">libprofile_rt.so</primary>
684 </indexterm>
685 </listitem>
686 </varlistentry>-->
687
688 </variablelist>
689
690 </sect2>
691
692</sect1>
Note: See TracBrowser for help on using the repository browser.