source: general/prog/rust.xml@ d6e81e8

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 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 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 d6e81e8 was d6e81e8, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Spacing

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

  • Property mode set to 100644
File size: 9.6 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 rust-download-http "https://static.rust-lang.org/dist/rustc-&rust-version;-src.tar.gz">
8 <!ENTITY rust-download-ftp "">
9 <!ENTITY rust-md5sum "c11d94d9e62f71838b20058f0797357a">
10 <!ENTITY rust-size "28 MB">
11 <!ENTITY rust-buildsize "1.5 GB (208 MB installed) plus 118MB for cargo files">
12 <!ENTITY rust-time "14 SBU (with 4 processors)">
13]>
14
15<sect1 id="rust" xreflabel="rustc-&rust-version;">
16 <?dbhtml filename="rust.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Rustc-&rust-version;</title>
24
25 <indexterm zone="rust">
26 <primary sortas="a-rust">Rust</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Rust</title>
31
32 <para>
33 The <application>Rust</application> programming language is designed
34 to be a safe, concurrent, practical language.
35 </para>
36
37 <para>
38 As with many other programming languages, rustc (the rust compiler)
39 needs a binary from which to bootstrap. It will download a stage0 binary,
40 and several cargo files (these are actually .tar.gz source archives) at
41 the start of the build, so you cannot compile it without an internet
42 connection.
43 </para>
44
45 <para>
46 The current <application>rustbuild</application> build-system will use
47 all available processors, although it does not scale well and often falls
48 back to just using one core while waiting for a library to compile.
49 </para>
50
51 <para>
52 At the moment <application>Rust</application> does not provide any
53 guarantees of a stable ABI, and it is likely that the next few versions
54 of <application>firefox</application> will each require the latest version
55 of <application>Rust</application>.
56 </para>
57
58 &lfs80_checked;
59
60 <bridgehead renderas="sect3">Package Information</bridgehead>
61 <itemizedlist spacing="compact">
62 <listitem>
63 <para>
64 Download (HTTP): <ulink url="&rust-download-http;"/>
65 </para>
66 </listitem>
67 <listitem>
68 <para>
69 Download (FTP): <ulink url="&rust-download-ftp;"/>
70 </para>
71 </listitem>
72 <listitem>
73 <para>
74 Download MD5 sum: &rust-md5sum;
75 </para>
76 </listitem>
77 <listitem>
78 <para>
79 Download size: &rust-size;
80 </para>
81 </listitem>
82 <listitem>
83 <para>
84 Estimated disk space required: &rust-buildsize;
85 </para>
86 </listitem>
87 <listitem>
88 <para>
89 Estimated build time: &rust-time;
90 </para>
91 </listitem>
92 </itemizedlist>
93
94 <bridgehead renderas="sect3">Rust Dependencies</bridgehead>
95
96 <bridgehead renderas="sect4">Required</bridgehead>
97 <para role="required">
98 <xref linkend="curl"/>,
99 <xref linkend="cmake"/> (if not using the recommended <xref linkend="llvm-old"/>),
100 <xref linkend="python2"/>
101 </para>
102
103 <bridgehead renderas="sect4">Recommended</bridgehead>
104 <para role="recommended">
105 <!-- acceptable versions of llvm are listed in the tests
106 of LLVM_VERSION in configure, currently 3.{7-9}* -->
107 <xref linkend="llvm-old"/>
108 </para>
109
110 <bridgehead renderas="sect4">Optional</bridgehead>
111 <para role="optional">
112 <xref linkend="gdb"/> (often required for the testsuite, but some of the
113 gdb tests may still fail),
114 <xref linkend="ninja"/>
115 </para>
116
117 <para condition="html" role="usernotes">
118 User Notes: <ulink url="&blfs-wiki;/rust"/>
119 </para>
120 </sect2>
121
122 <sect2 role="installation">
123 <title>Installation of Rust</title>
124
125 <para>
126 Install <application>Rust</application> by running the following
127 commands:
128 </para>
129
130<screen><userinput>./configure --prefix=/usr \
131 --docdir=/usr/share/doc/rustc-&rust-version; \
132 --llvm-root=/opt/llvm3 --enable-llvm-link-shared &amp;&amp;
133./x.py build</userinput></screen>
134
135 <para>
136 The testsuite in this package selects random subsets of the
137 possible tests. There is no correlation between how long a
138 particular run of the testsuite takes, and how many tests
139 were run. On occasion, the chosen tests will run in much
140 less than 1.0 SBU, on other occasions they may take more
141 than 20 SBU. Although it is normal to run the testsuite for
142 a compiler, in this case that is very hard to recommend.
143 </para>
144
145 <para>
146 Nevertheless, if you insist on running the tests issue
147 <command>./x.py test</command>: as with the build, that will
148 use all available CPUs.
149 </para>
150
151 <para>
152 Now, as the <systemitem class="username">root</systemitem> user:
153 </para>
154
155<screen role="root"><userinput>test -f /usr/lib/libLLVM-3.9.so ||
156 ln -sv /opt/llvm3/lib/libLLVM-3.9.so /usr/lib &amp;&amp;
157
158./x.py dist --install</userinput></screen>
159 </sect2>
160
161 <sect2 role="commands">
162 <title>Command Explanations</title>
163
164 <para>
165 <command>--llvm-root=/opt/llvm3 --enable-llvm-link-shared</command>:
166 This tells rust to use the system verison of llvm3 installed in
167 <filename class="directory">/opt/llvm3</filename>, linking to the
168 shared libraries.
169 </para>
170
171 <para>
172 <option>--enable-dist-host-only</option>: If you did not install a
173 system version of <xref linkend="llvm-old"/>, use this alternative command
174 to build the shipped static version of llvm. It will
175 <emphasis>compile</emphasis> for all the available linux cross-compilers
176 (Aarch64, MIPS, PowerPC, SystemZ, etc) but with this switch it will only
177 <emphasis>install</emphasis> for the host architecture.
178 </para>
179
180 <para>
181 <option>RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"</option>: use this if
182 you need to link against a version of LLVM-3 which was compiled against
183 <xref linkend="libffi"/>.
184 </para>
185
186 <para>
187 <command>ln -sv /opt/llvm3/lib/libLLVM-3.9.so /usr/lib</command>:
188 Although the <emphasis>build</emphasis> of <application>Rust</application>
189 finds the shared library in
190 <filename class="directory">/opt/llvm3/lib</filename>, several of the steps
191 run by the <application>rustbuild</application>
192 <emphasis>installer</emphasis> do not find
193 <filename>libLLVM-3.9.so</filename>. This conditional symlink fixes that,
194 and works even if <filename>libLLVM-3.9.{0,1}</filename> has already been
195 installed in <filename class="directory">/usr</filename>.
196 <emphasis>Omit this command if you did not install a system version of
197 <xref linkend="llvm-old"/></emphasis>.
198 </para>
199 </sect2>
200
201 <sect2 role="content">
202 <title>Contents</title>
203
204 <segmentedlist>
205 <segtitle>Installed Program(s)</segtitle>
206 <segtitle>Installed Librar(y,ies)</segtitle>
207 <segtitle>Installed Director(y,ies)</segtitle>
208
209 <seglistitem>
210 <seg>
211 rust-gdb, rust-lldb, rustc, rustdoc.
212 </seg>
213 <seg>
214 Many libraries (libarena, libflate, libfmt_macros, libgetopts,
215 libgraphviz, liblog, libproc_macro, librustc*, libserialize,
216 libstd, libsyntax, libterm, libtest), all containing a hash in
217 their names.
218 </seg>
219 <seg>
220 ~/.cargo,
221 /usr/lib/rustlib,
222 /usr/share/doc/rustc-&rust-version;.
223 </seg>
224 </seglistitem>
225 </segmentedlist>
226
227 <variablelist>
228 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
229 <?dbfo list-presentation="list"?>
230 <?dbhtml list-presentation="table"?>
231
232 <varlistentry id="rust-gdb">
233 <term><command>rust-gdb</command></term>
234 <listitem>
235 <para>
236 is a Python wrapper script for gdb.
237 </para>
238 <indexterm zone="rust rust-gdb">
239 <primary sortas="b-rust-gdb">rust-gdb</primary>
240 </indexterm>
241 </listitem>
242 </varlistentry>
243
244 <varlistentry id="rust-lldb">
245 <term><command>rust-lldb</command></term>
246 <listitem>
247 <para>
248 is a Python wrapper script for LLDB (the LLVM debugger).
249 </para>
250 <indexterm zone="rust rust-lldb">
251 <primary sortas="b-rust-lldb">rust=lldb</primary>
252 </indexterm>
253 </listitem>
254 </varlistentry>
255
256 <varlistentry id="rustc">
257 <term><command>rustc</command></term>
258 <listitem>
259 <para>
260 is the rust compiler.
261 </para>
262 <indexterm zone="rust rustc">
263 <primary sortas="b-rustc">rustc</primary>
264 </indexterm>
265 </listitem>
266 </varlistentry>
267
268 <varlistentry id="rustdoc">
269 <term><command>rustdoc</command></term>
270 <listitem>
271 <para>
272 generates documentation from rust source code.
273 </para>
274 <indexterm zone="rust rustdoc">
275 <primary sortas="b-rustdoc">rustdoc</primary>
276 </indexterm>
277 </listitem>
278 </varlistentry>
279
280 <varlistentry id="libstd">
281 <term><filename class="libraryfile">libstd-&lt;16-byte-hash&gt;.so</filename></term>
282 <listitem>
283 <para>
284 is the Rust Standard Library, the foundation of portable Rust software.
285 </para>
286 <indexterm zone="rust libstd">
287 <primary sortas="c-libstd">libstd-&lt;16-byte-hash&gt;.so</primary>
288 </indexterm>
289 </listitem>
290 </varlistentry>
291 </variablelist>
292 </sect2>
293</sect1>
Note: See TracBrowser for help on using the repository browser.