[7152faa] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[673b0d8] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[6a82dd9] | 7 |
|
---|
[81fd230] | 8 | <sect1 id="ch-system-gcc" role="wrap">
|
---|
[6a82dd9] | 9 | <?dbhtml filename="gcc.html"?>
|
---|
| 10 |
|
---|
[e747759] | 11 | <sect1info condition="script">
|
---|
| 12 | <productname>gcc</productname>
|
---|
| 13 | <productnumber>&gcc-version;</productnumber>
|
---|
| 14 | <address>&gcc-url;</address>
|
---|
| 15 | </sect1info>
|
---|
| 16 |
|
---|
[6a82dd9] | 17 | <title>GCC-&gcc-version;</title>
|
---|
| 18 |
|
---|
| 19 | <indexterm zone="ch-system-gcc">
|
---|
| 20 | <primary sortas="a-GCC">GCC</primary>
|
---|
| 21 | </indexterm>
|
---|
| 22 |
|
---|
| 23 | <sect2 role="package">
|
---|
| 24 | <title/>
|
---|
[6370fa6] | 25 |
|
---|
[6a82dd9] | 26 | <para>The GCC package contains the GNU compiler collection, which includes
|
---|
| 27 | the C and C++ compilers.</para>
|
---|
[673b0d8] | 28 |
|
---|
[6a82dd9] | 29 | <segmentedlist>
|
---|
| 30 | <segtitle>&buildtime;</segtitle>
|
---|
| 31 | <segtitle>&diskspace;</segtitle>
|
---|
[5888299] | 32 |
|
---|
[6a82dd9] | 33 | <seglistitem>
|
---|
[fb386e0] | 34 | <seg>&gcc-fin-sbu;</seg>
|
---|
| 35 | <seg>&gcc-fin-du;</seg>
|
---|
[6a82dd9] | 36 | </seglistitem>
|
---|
| 37 | </segmentedlist>
|
---|
[3554fa3a] | 38 |
|
---|
[6a82dd9] | 39 | </sect2>
|
---|
| 40 |
|
---|
| 41 | <sect2 role="installation">
|
---|
| 42 | <title>Installation of GCC</title>
|
---|
[4ac095c7] | 43 |
|
---|
[7481894] | 44 | <para>Set the default directory name for
|
---|
| 45 | 64-bit libraries to <quote>lib</quote>:</para>
|
---|
[be3d9f3] | 46 |
|
---|
[ecce62c] | 47 | <screen><userinput remap="pre">sed -e 's/lib64/lib/' \
|
---|
| 48 | -i.orig gcc/config/loongarch/{t-linux,linux.h}</userinput></screen>
|
---|
[be3d9f3] | 49 |
|
---|
[f1dd547] | 50 | <para>The GCC documentation recommends building GCC in a dedicated build directory:</para>
|
---|
[73aedd1d] | 51 |
|
---|
[f1dd547] | 52 | <screen><userinput remap="pre">mkdir -v build
|
---|
| 53 | cd build</userinput></screen>
|
---|
[73aedd1d] | 54 |
|
---|
[6a82dd9] | 55 | <para>Prepare GCC for compilation:</para>
|
---|
[73aedd1d] | 56 |
|
---|
[efcb393] | 57 | <screen><userinput remap="configure">../configure --prefix=/usr \
|
---|
| 58 | LD=ld \
|
---|
[f1dd547] | 59 | --enable-languages=c,c++ \
|
---|
[0611f706] | 60 | --enable-default-pie \
|
---|
| 61 | --enable-default-ssp \
|
---|
[340e17a] | 62 | --enable-host-pie \
|
---|
[f1dd547] | 63 | --disable-multilib \
|
---|
| 64 | --disable-bootstrap \
|
---|
[53363494] | 65 | --disable-fixincludes \
|
---|
[f1dd547] | 66 | --with-system-zlib</userinput></screen>
|
---|
[73aedd1d] | 67 |
|
---|
[30f3041] | 68 | <para>GCC supports seven different computer languages, but the
|
---|
| 69 | prerequisites for most of them have not yet been installed. See the
|
---|
[6a156bab] | 70 | <ulink url="&blfs-book;general/gcc.html">BLFS Book GCC page</ulink>
|
---|
[93756f6] | 71 | for instructions on how to build all of GCC's supported languages.</para>
|
---|
[182d5d3] | 72 |
|
---|
[ae4d45a] | 73 | <variablelist>
|
---|
[a89ab79] | 74 | <title>The meaning of the new configure parameters:</title>
|
---|
| 75 |
|
---|
| 76 | <varlistentry>
|
---|
| 77 | <term><parameter>LD=ld</parameter></term>
|
---|
| 78 | <listitem>
|
---|
[30f3041] | 79 | <para>This parameter makes the configure script use the ld program installed
|
---|
| 80 | by the Binutils package built earlier in this chapter, rather than
|
---|
[a89ab79] | 81 | the cross-built version which would otherwise be used.</para>
|
---|
| 82 | </listitem>
|
---|
| 83 | </varlistentry>
|
---|
[cde2ae7] | 84 |
|
---|
[9781ec5] | 85 | <varlistentry>
|
---|
| 86 | <term><parameter>--disable-fixincludes</parameter></term>
|
---|
| 87 | <listitem>
|
---|
| 88 | <para>By default, during the installation of GCC some system
|
---|
| 89 | headers would be <quote>fixed</quote> to be used with GCC. This
|
---|
[fb5f62b] | 90 | is not necessary for a modern Linux system, and potentially
|
---|
[9781ec5] | 91 | harmful if a package is reinstalled after installing GCC. This
|
---|
| 92 | switch prevents GCC from <quote>fixing</quote> the headers.</para>
|
---|
| 93 | </listitem>
|
---|
| 94 | </varlistentry>
|
---|
| 95 |
|
---|
[ae4d45a] | 96 | <varlistentry>
|
---|
| 97 | <term><parameter>--with-system-zlib</parameter></term>
|
---|
| 98 | <listitem>
|
---|
| 99 | <para>This switch tells GCC to link to the system installed copy of
|
---|
[30f3041] | 100 | the Zlib library, rather than its own internal copy.</para>
|
---|
[ae4d45a] | 101 | </listitem>
|
---|
| 102 | </varlistentry>
|
---|
| 103 | </variablelist>
|
---|
| 104 |
|
---|
[c10a327] | 105 | <note>
|
---|
| 106 | <anchor id="pie-ssp-info" xreflabel="note on PIE and SSP"/>
|
---|
[1bade3f] | 107 | <para>
|
---|
[30f3041] | 108 | PIE (position-independent executables) are
|
---|
[e502de1] | 109 | binary programs that can be loaded anywhere in memory. Without PIE,
|
---|
| 110 | the security feature named ASLR (Address Space Layout Randomization)
|
---|
[30f3041] | 111 | can be applied for the shared libraries, but not for the executables
|
---|
| 112 | themselves. Enabling PIE allows ASLR for the executables in addition to
|
---|
[e502de1] | 113 | the shared libraries, and mitigates some attacks based on fixed
|
---|
| 114 | addresses of sensitive code or data in the executables.
|
---|
[1bade3f] | 115 | </para>
|
---|
| 116 | <para>
|
---|
| 117 | SSP (Stack Smashing Protection) is a technique to ensure
|
---|
[30f3041] | 118 | that the parameter stack is not corrupted. Stack corruption can,
|
---|
| 119 | for example, alter the return address of a subroutine,
|
---|
| 120 | thus transferring control to some dangerous code
|
---|
[e502de1] | 121 | (existing in the program or shared libraries, or injected by the
|
---|
[30f3041] | 122 | attacker somehow).
|
---|
[1bade3f] | 123 | </para>
|
---|
| 124 | </note>
|
---|
| 125 |
|
---|
[6a82dd9] | 126 | <para>Compile the package:</para>
|
---|
[73aedd1d] | 127 |
|
---|
[0445a3d] | 128 | <screen><userinput remap="make">make</userinput></screen>
|
---|
[73aedd1d] | 129 |
|
---|
[6a82dd9] | 130 | <important>
|
---|
| 131 | <para>In this section, the test suite for GCC is considered
|
---|
[30f3041] | 132 | important, but it takes a long time. First-time builders are
|
---|
| 133 | encouraged to run the test suite. The time to run the tests can be
|
---|
[340e17a] | 134 | reduced significantly by adding -jx to the <command>make -k check</command>
|
---|
| 135 | command below, where x is the number of CPU cores on your system.</para>
|
---|
[6a82dd9] | 136 | </important>
|
---|
[81fd230] | 137 |
|
---|
[2ca7fca7] | 138 | <para>GCC may need more stack space compiling some extremely complex
|
---|
| 139 | code patterns. As a precaution for the host distros with a tight stack
|
---|
| 140 | limit, explicitly set the stack size hard limit to infinite.
|
---|
| 141 | On most host distros (and the final LFS system) the hard limit is
|
---|
[2b76c89] | 142 | infinite by default, but there is no harm done by setting it explicitly.
|
---|
| 143 | It's not necessary to change the stack size soft limit because GCC will
|
---|
[2ca7fca7] | 144 | automatically set it to an appropriate value, as long as the value does
|
---|
| 145 | not exceed the hard limit:</para>
|
---|
| 146 |
|
---|
| 147 | <screen><userinput remap="test">ulimit -s -H unlimited</userinput></screen>
|
---|
[4e48f56e] | 148 |
|
---|
[340e17a] | 149 | <para>Now remove/fix several known test failures:</para>
|
---|
| 150 |
|
---|
[560c147] | 151 | <screen><userinput remap="test">sed -e '/cpython/d' -i ../gcc/testsuite/gcc.dg/plugin/plugin.exp</userinput></screen>
|
---|
[340e17a] | 152 |
|
---|
[76db8d6] | 153 | <para>Test the results as a non-privileged user, but do not stop at errors:</para>
|
---|
| 154 |
|
---|
[9c73d911] | 155 | <screen><userinput remap="test">chown -R tester .
|
---|
[ae7f075] | 156 | su tester -c "PATH=$PATH make -k check"</userinput></screen>
|
---|
[73aedd1d] | 157 |
|
---|
[30f3041] | 158 | <para>To extract a summary of the test suite results, run:</para>
|
---|
[9278974d] | 159 |
|
---|
[f1dd547] | 160 | <screen><userinput remap="test">../contrib/test_summary</userinput></screen>
|
---|
[9278974d] | 161 |
|
---|
[30f3041] | 162 | <para>To filter out only the summaries, pipe the output through
|
---|
[9278974d] | 163 | <userinput>grep -A7 Summ</userinput>.</para>
|
---|
| 164 |
|
---|
| 165 | <para>Results can be compared with those located at <ulink
|
---|
[98e7ac4] | 166 | url="&test-results;"/> and
|
---|
[b30de8f] | 167 | <ulink url="https://gcc.gnu.org/ml/gcc-testresults/"/>.</para>
|
---|
[340e17a] | 168 | <!--
|
---|
[f40b2e7] | 169 | <para>
|
---|
[5f2ba8c] | 170 | Eight gcc tests (out of over 185,000):
|
---|
[340e17a] | 171 | <!- - https://gcc.gnu.org/PR106375 - -><filename>pr56837.c</filename>
|
---|
[5f2ba8c] | 172 | and seven tests in the <filename class='directory'>analyzer</filename>
|
---|
| 173 | directory are known to fail.
|
---|
[28614cdd] | 174 |
|
---|
[340e17a] | 175 | <!- - https://gcc.gnu.org/PR109353 - ->
|
---|
[5f2ba8c] | 176 | One libstdc++ test (out of over 15000), <filename>copy.cc</filename>, is
|
---|
| 177 | known to fail.
|
---|
[28614cdd] | 178 |
|
---|
[5f2ba8c] | 179 | For g++, 21 tests (out of approximately 250,000): 14
|
---|
| 180 | <quote>AddressSanitizer*</quote>
|
---|
| 181 | tests and 7 <filename>interception-malloc-test-1.C</filename> tests, are
|
---|
| 182 | known to fail.
|
---|
[f40b2e7] | 183 |
|
---|
[6d4ba5f] | 184 | Additionally, several tests in the
|
---|
| 185 | <filename class='directory'>vect</filename> directory are known to fail
|
---|
| 186 | if the hardware does not support AVX.</para>
|
---|
[340e17a] | 187 | -->
|
---|
[560c147] | 188 |
|
---|
| 189 | <!-- gen-vect-*: Likely https://gcc.gnu.org/PR113418
|
---|
| 190 | pr108357.c: https://gcc.gnu.org/PR108357#c5
|
---|
| 191 | update-threading.c: https://gcc.gnu.org/PR110628
|
---|
| 192 | vect-117.c: https://gcc.gnu.org/PR113685
|
---|
| 193 | pr64076: Binutils bug (ld crashes), needs a triage -->
|
---|
| 194 | <para>The tests named
|
---|
| 195 | <filename>gen-vect-11b.c</filename>,
|
---|
| 196 | <filename>gen-vect-11c.c</filename>,
|
---|
| 197 | <filename>gen-vect-26.c</filename>,
|
---|
| 198 | <filename>gen-vect-28.c</filename>,
|
---|
| 199 | <filename>pr64076</filename>,
|
---|
| 200 | <filename>pr108357.c</filename>,
|
---|
| 201 | <filename>update-threading.c</filename>,
|
---|
| 202 | and <filename>vect-117.c</filename> are known to fail.</para>
|
---|
| 203 |
|
---|
[340e17a] | 204 | <para>A few unexpected failures cannot always be avoided. In some cases
|
---|
| 205 | test failures depend on the specific hardware of the system.<!--The GCC developers
|
---|
| 206 | are usually aware of these issues, but have not resolved them yet.-->
|
---|
[9278974d] | 207 | Unless the test results are vastly different from those at the above URL,
|
---|
| 208 | it is safe to continue.</para>
|
---|
[73aedd1d] | 209 |
|
---|
[bd08757] | 210 | <para>Install the package:</para>
|
---|
[73aedd1d] | 211 |
|
---|
[bd08757] | 212 | <screen><userinput remap="install">make install</userinput></screen>
|
---|
[73aedd1d] | 213 |
|
---|
[e6db175] | 214 | <para>The GCC build directory is owned by <systemitem class="username">
|
---|
[30f3041] | 215 | tester</systemitem> now, and the ownership of the installed header
|
---|
| 216 | directory (and its content) is incorrect. Change the ownership to the
|
---|
[e6db175] | 217 | <systemitem class="username">root</systemitem> user and group:</para>
|
---|
| 218 |
|
---|
| 219 | <screen><userinput remap="install">chown -v -R root:root \
|
---|
[9c43803] | 220 | /usr/lib/gcc/$(gcc -dumpmachine)/&gcc-version;/include{,-fixed}</userinput></screen>
|
---|
[e6db175] | 221 |
|
---|
[60b23a6f] | 222 | <para>Create a symlink required by the <ulink
|
---|
[b30de8f] | 223 | url="https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s09.html">FHS</ulink>
|
---|
[60b23a6f] | 224 | for "historical" reasons.</para>
|
---|
[73aedd1d] | 225 |
|
---|
[9c3ce2a] | 226 | <screen><userinput remap="install">ln -svr /usr/bin/cpp /usr/lib</userinput></screen>
|
---|
[0fe3bb0] | 227 |
|
---|
[6a82dd9] | 228 | <para>Many packages use the name <command>cc</command> to call the C
|
---|
[0fe3bb0] | 229 | compiler. We've already created <command>cc</command> as a symlink in
|
---|
| 230 | <xref linkend='ch-tools-gcc-pass2'/>, create its man page as a symlink
|
---|
| 231 | as well:</para>
|
---|
| 232 |
|
---|
| 233 | <screen><userinput remap="install">ln -sv gcc.1 /usr/share/man/man1/cc.1</userinput></screen>
|
---|
[1ba726f] | 234 |
|
---|
[6206f72] | 235 | <para>Add a compatibility symlink to enable building programs with
|
---|
[d672ab7] | 236 | Link Time Optimization (LTO):</para>
|
---|
[6206f72] | 237 |
|
---|
[f36db31] | 238 | <screen><userinput remap="install">ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so \
|
---|
[040ecb6] | 239 | /usr/lib/bfd-plugins/</userinput></screen>
|
---|
[6206f72] | 240 |
|
---|
[09f1daf] | 241 | <para>Now that our final toolchain is in place, it is important to again ensure
|
---|
| 242 | that compiling and linking will work as expected. We do this by performing
|
---|
[6a156bab] | 243 | some sanity checks:</para>
|
---|
[09f1daf] | 244 |
|
---|
[a4f63e4] | 245 | <screen><userinput>echo 'int main(){}' > dummy.c
|
---|
| 246 | cc dummy.c -v -Wl,--verbose &> dummy.log
|
---|
| 247 | readelf -l a.out | grep ': /lib'</userinput></screen>
|
---|
[09f1daf] | 248 |
|
---|
[a4f63e4] | 249 | <para>There should be no errors,
|
---|
| 250 | and the output of the last command will be (allowing for
|
---|
| 251 | platform-specific differences in the dynamic linker name):</para>
|
---|
[09f1daf] | 252 |
|
---|
[8ec5b53] | 253 | <screen><computeroutput>[Requesting program interpreter: /lib64/ld-linux-loongarch-lp64d.so.1]</computeroutput></screen>
|
---|
[09f1daf] | 254 |
|
---|
[30f3041] | 255 | <para>Now make sure that we're set up to use the correct start files:</para>
|
---|
[09f1daf] | 256 |
|
---|
[0d487e0] | 257 | <screen><userinput>grep -E -o '/usr/lib.*/S?crt[1in].*succeeded' dummy.log</userinput></screen>
|
---|
[09f1daf] | 258 |
|
---|
[a4f63e4] | 259 | <para>The output of the last command should be:</para>
|
---|
[09f1daf] | 260 |
|
---|
[ed434750] | 261 | <screen><computeroutput>/usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/Scrt1.o succeeded
|
---|
| 262 | /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded
|
---|
| 263 | /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded</computeroutput></screen>
|
---|
[09f1daf] | 264 |
|
---|
[6a156bab] | 265 | <para>Depending on your machine architecture, the above may differ slightly.
|
---|
| 266 | The difference will be the name of the directory
|
---|
[be3d9f3] | 267 | after <filename class="directory">/usr/lib/gcc</filename>. The important
|
---|
| 268 | thing to look for here is that <command>gcc</command> has found all three
|
---|
[5f7456b] | 269 | <filename>crt*.o</filename> files under the
|
---|
| 270 | <filename class="directory">/usr/lib</filename> directory.</para>
|
---|
[6e88633] | 271 |
|
---|
[a4f63e4] | 272 | <para>Verify that the compiler is searching for the correct header
|
---|
| 273 | files:</para>
|
---|
[09f1daf] | 274 |
|
---|
[041c8f67] | 275 | <screen><userinput>grep -B4 '^ /usr/include' dummy.log</userinput></screen>
|
---|
[e9a652b] | 276 |
|
---|
[a4f63e4] | 277 | <para>This command should return the following output:</para>
|
---|
[09f1daf] | 278 |
|
---|
[e9a652b] | 279 | <screen><computeroutput>#include <...> search starts here:
|
---|
[ed434750] | 280 | /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/include
|
---|
[c528e3a] | 281 | /usr/local/include
|
---|
[ed434750] | 282 | /usr/lib/gcc/loongarch64-unknown-linux-gnu/&gcc-version;/include-fixed
|
---|
[e9a652b] | 283 | /usr/include</computeroutput></screen>
|
---|
| 284 |
|
---|
[6a156bab] | 285 | <para>Again, the directory named after your target triplet may be
|
---|
| 286 | different than the above, depending on your system architecture.</para>
|
---|
[3f39abf3] | 287 |
|
---|
[a4f63e4] | 288 | <para>Next, verify that the new linker is being used with the correct search paths:</para>
|
---|
[09f1daf] | 289 |
|
---|
[a4f63e4] | 290 | <screen><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen>
|
---|
[09f1daf] | 291 |
|
---|
[a4f63e4] | 292 | <para>References to paths that have components with '-linux-gnu' should
|
---|
| 293 | be ignored, but otherwise the output of the last command should be:</para>
|
---|
[09f1daf] | 294 |
|
---|
[ed434750] | 295 | <screen><computeroutput>SEARCH_DIR("/usr/loongarch64-unknown-linux-gnu/lib64")
|
---|
[98e7ac4] | 296 | SEARCH_DIR("/usr/local/lib64")
|
---|
| 297 | SEARCH_DIR("/lib64")
|
---|
| 298 | SEARCH_DIR("/usr/lib64")
|
---|
[ed434750] | 299 | SEARCH_DIR("/usr/loongarch64-unknown-linux-gnu/lib")
|
---|
[e9a652b] | 300 | SEARCH_DIR("/usr/local/lib")
|
---|
| 301 | SEARCH_DIR("/lib")
|
---|
[6e88633] | 302 | SEARCH_DIR("/usr/lib");</computeroutput></screen>
|
---|
[ed434750] | 303 | <!--
|
---|
[30f3041] | 304 | <para>A 32-bit system may use a few other directories. For example, here
|
---|
[98e7ac4] | 305 | is the output from an i686 machine:</para>
|
---|
[6e88633] | 306 |
|
---|
[98e7ac4] | 307 | <screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32")
|
---|
| 308 | SEARCH_DIR("/usr/local/lib32")
|
---|
| 309 | SEARCH_DIR("/lib32")
|
---|
| 310 | SEARCH_DIR("/usr/lib32")
|
---|
| 311 | SEARCH_DIR("/usr/i686-pc-linux-gnu/lib")
|
---|
[6e88633] | 312 | SEARCH_DIR("/usr/local/lib")
|
---|
| 313 | SEARCH_DIR("/lib")
|
---|
[e9a652b] | 314 | SEARCH_DIR("/usr/lib");</computeroutput></screen>
|
---|
[ed434750] | 315 | -->
|
---|
[a4f63e4] | 316 | <para>Next make sure that we're using the correct libc:</para>
|
---|
[09f1daf] | 317 |
|
---|
[a4f63e4] | 318 | <screen><userinput>grep "/lib.*/libc.so.6 " dummy.log</userinput></screen>
|
---|
[09f1daf] | 319 |
|
---|
[a4f63e4] | 320 | <para>The output of the last command should be:</para>
|
---|
[09f1daf] | 321 |
|
---|
[a4f63e4] | 322 | <screen><computeroutput>attempt to open /usr/lib/libc.so.6 succeeded</computeroutput></screen>
|
---|
[09f1daf] | 323 |
|
---|
[a4f63e4] | 324 | <para>Make sure GCC is using the correct dynamic linker:</para>
|
---|
[09f1daf] | 325 |
|
---|
[a4f63e4] | 326 | <screen><userinput>grep found dummy.log</userinput></screen>
|
---|
[09f1daf] | 327 |
|
---|
[a4f63e4] | 328 | <para>The output of the last command should be (allowing for
|
---|
| 329 | platform-specific differences in dynamic linker name):</para>
|
---|
[09f1daf] | 330 |
|
---|
[8ec5b53] | 331 | <screen><computeroutput>found ld-linux-loongarch-lp64d.so.1 at /usr/lib/ld-linux-loongarch-lp64d.so.1</computeroutput></screen>
|
---|
[09f1daf] | 332 |
|
---|
[a4f63e4] | 333 | <para>If the output does not appear as shown above or is not received
|
---|
| 334 | at all, then something is seriously wrong. Investigate and retrace the
|
---|
| 335 | steps to find out where the problem is and correct it. <!--The most likely
|
---|
| 336 | reason is that something went wrong with the specs file adjustment.--> Any
|
---|
[30f3041] | 337 | issues should be resolved before continuing with the process.</para>
|
---|
[6a82dd9] | 338 |
|
---|
[a4f63e4] | 339 | <para>Once everything is working correctly, clean up the test files:</para>
|
---|
[e9a652b] | 340 |
|
---|
[a4f63e4] | 341 | <screen><userinput>rm -v dummy.c a.out dummy.log</userinput></screen>
|
---|
[e9a652b] | 342 |
|
---|
[970a126] | 343 | <para>Finally, move a misplaced file:</para>
|
---|
[39ec01c] | 344 |
|
---|
[970a126] | 345 | <screen><userinput remap="install">mkdir -pv /usr/share/gdb/auto-load/usr/lib
|
---|
| 346 | mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib</userinput></screen>
|
---|
[39ec01c] | 347 |
|
---|
[6a82dd9] | 348 | </sect2>
|
---|
| 349 |
|
---|
| 350 | <sect2 id="contents-gcc" role="content">
|
---|
| 351 | <title>Contents of GCC</title>
|
---|
| 352 |
|
---|
| 353 | <segmentedlist>
|
---|
| 354 | <segtitle>Installed programs</segtitle>
|
---|
| 355 | <segtitle>Installed libraries</segtitle>
|
---|
[fe05b08] | 356 | <segtitle>Installed directories</segtitle>
|
---|
[6a82dd9] | 357 |
|
---|
| 358 | <seglistitem>
|
---|
[2ca8941] | 359 | <seg>c++, cc (link to gcc), cpp, g++, gcc,
|
---|
[e5b4b3f] | 360 | gcc-ar, gcc-nm, gcc-ranlib, gcov, gcov-dump, gcov-tool,
|
---|
| 361 | and lto-dump</seg>
|
---|
[e0901b3] | 362 |
|
---|
[78cc3be] | 363 | <seg>libasan.{a,so}, libatomic.{a,so}, libcc1.so, libgcc.a, libgcc_eh.a,
|
---|
[465ada7] | 364 | libgcc_s.so, libgcov.a, libgomp.{a,so}, libhwasan.{a,so}, libitm.{a,so},
|
---|
[78cc3be] | 365 | liblsan.{a,so}, liblto_plugin.so,
|
---|
| 366 | libquadmath.{a,so}, libssp.{a,so}, libssp_nonshared.a,
|
---|
[465ada7] | 367 | libstdc++.{a,so}, libstdc++exp.a, libstdc++fs.a, libsupc++.a, libtsan.{a,so},
|
---|
[78cc3be] | 368 | and libubsan.{a,so}</seg>
|
---|
[2ca8941] | 369 |
|
---|
[d672ab7] | 370 | <seg>/usr/include/c++, /usr/lib/gcc, /usr/libexec/gcc, and
|
---|
[4e8a532] | 371 | /usr/share/gcc-&gcc-version;</seg>
|
---|
[6a82dd9] | 372 | </seglistitem>
|
---|
| 373 | </segmentedlist>
|
---|
| 374 |
|
---|
| 375 | <variablelist>
|
---|
| 376 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 377 | <?dbfo list-presentation="list"?>
|
---|
| 378 | <?dbhtml list-presentation="table"?>
|
---|
| 379 |
|
---|
[75128571] | 380 | <varlistentry id="c">
|
---|
| 381 | <term><command>c++</command></term>
|
---|
| 382 | <listitem>
|
---|
| 383 | <para>The C++ compiler</para>
|
---|
| 384 | <indexterm zone="ch-system-gcc c">
|
---|
| 385 | <primary sortas="b-c++">c++</primary>
|
---|
| 386 | </indexterm>
|
---|
| 387 | </listitem>
|
---|
| 388 | </varlistentry>
|
---|
| 389 |
|
---|
[6a82dd9] | 390 | <varlistentry id="cc">
|
---|
| 391 | <term><command>cc</command></term>
|
---|
| 392 | <listitem>
|
---|
| 393 | <para>The C compiler</para>
|
---|
| 394 | <indexterm zone="ch-system-gcc cc">
|
---|
| 395 | <primary sortas="b-cc">cc</primary>
|
---|
| 396 | </indexterm>
|
---|
| 397 | </listitem>
|
---|
| 398 | </varlistentry>
|
---|
| 399 |
|
---|
| 400 | <varlistentry id="cpp">
|
---|
| 401 | <term><command>cpp</command></term>
|
---|
| 402 | <listitem>
|
---|
| 403 | <para>The C preprocessor; it is used by the compiler to expand the
|
---|
[30f3041] | 404 | #include, #define, and similar directives in the source files</para>
|
---|
[6a82dd9] | 405 | <indexterm zone="ch-system-gcc cpp">
|
---|
| 406 | <primary sortas="b-cpp">cpp</primary>
|
---|
| 407 | </indexterm>
|
---|
| 408 | </listitem>
|
---|
| 409 | </varlistentry>
|
---|
| 410 |
|
---|
| 411 | <varlistentry id="g">
|
---|
| 412 | <term><command>g++</command></term>
|
---|
| 413 | <listitem>
|
---|
| 414 | <para>The C++ compiler</para>
|
---|
| 415 | <indexterm zone="ch-system-gcc g">
|
---|
| 416 | <primary sortas="b-g++">g++</primary>
|
---|
| 417 | </indexterm>
|
---|
| 418 | </listitem>
|
---|
| 419 | </varlistentry>
|
---|
| 420 |
|
---|
| 421 | <varlistentry id="gcc">
|
---|
| 422 | <term><command>gcc</command></term>
|
---|
| 423 | <listitem>
|
---|
| 424 | <para>The C compiler</para>
|
---|
| 425 | <indexterm zone="ch-system-gcc gcc">
|
---|
| 426 | <primary sortas="b-gcc">gcc</primary>
|
---|
| 427 | </indexterm>
|
---|
| 428 | </listitem>
|
---|
| 429 | </varlistentry>
|
---|
| 430 |
|
---|
[e0901b3] | 431 | <varlistentry id="gcc-ar">
|
---|
| 432 | <term><command>gcc-ar</command></term>
|
---|
| 433 | <listitem>
|
---|
| 434 | <para>A wrapper around <command>ar</command> that adds a
|
---|
[afba93b] | 435 | plugin to the command line. This program is only used
|
---|
[edbeeb5] | 436 | to add "link time optimization" and is not useful with the
|
---|
[30f3041] | 437 | default build options.</para>
|
---|
[e0901b3] | 438 | <indexterm zone="ch-system-gcc gcc-ar">
|
---|
| 439 | <primary sortas="b-gcc-ar">gc-ar</primary>
|
---|
| 440 | </indexterm>
|
---|
| 441 | </listitem>
|
---|
| 442 | </varlistentry>
|
---|
| 443 |
|
---|
| 444 | <varlistentry id="gcc-nm">
|
---|
| 445 | <term><command>gcc-nm</command></term>
|
---|
| 446 | <listitem>
|
---|
| 447 | <para>A wrapper around <command>nm</command> that adds a
|
---|
[afba93b] | 448 | plugin to the command line. This program is only used
|
---|
[a885478] | 449 | to add "link time optimization" and is not useful with the
|
---|
[30f3041] | 450 | default build options.</para>
|
---|
[e0901b3] | 451 | <indexterm zone="ch-system-gcc gcc-nm">
|
---|
| 452 | <primary sortas="b-gcc-nm">gc-nm</primary>
|
---|
| 453 | </indexterm>
|
---|
| 454 | </listitem>
|
---|
| 455 | </varlistentry>
|
---|
| 456 |
|
---|
| 457 | <varlistentry id="gcc-ranlib">
|
---|
| 458 | <term><command>gcc-ranlib</command></term>
|
---|
| 459 | <listitem>
|
---|
| 460 | <para>A wrapper around <command>ranlib</command> that adds a
|
---|
[afba93b] | 461 | plugin to the command line. This program is only used
|
---|
[a885478] | 462 | to add "link time optimization" and is not useful with the
|
---|
[30f3041] | 463 | default build options.</para>
|
---|
[e0901b3] | 464 | <indexterm zone="ch-system-gcc gcc-ranlib">
|
---|
| 465 | <primary sortas="b-gcc-ranlib">gc-ranlib</primary>
|
---|
| 466 | </indexterm>
|
---|
| 467 | </listitem>
|
---|
| 468 | </varlistentry>
|
---|
[6a82dd9] | 469 |
|
---|
| 470 | <varlistentry id="gcov">
|
---|
| 471 | <term><command>gcov</command></term>
|
---|
| 472 | <listitem>
|
---|
| 473 | <para>A coverage testing tool; it is used to analyze programs to
|
---|
[30f3041] | 474 | determine where optimizations will have the greatest effect</para>
|
---|
[6a82dd9] | 475 | <indexterm zone="ch-system-gcc gcov">
|
---|
| 476 | <primary sortas="b-gcov">gcov</primary>
|
---|
| 477 | </indexterm>
|
---|
[4783efe] | 478 | </listitem>
|
---|
| 479 | </varlistentry>
|
---|
| 480 |
|
---|
[78cc3be] | 481 | <varlistentry id="gcov-dump">
|
---|
| 482 | <term><command>gcov-dump</command></term>
|
---|
| 483 | <listitem>
|
---|
| 484 | <para>Offline gcda and gcno profile dump tool</para>
|
---|
| 485 | <indexterm zone="ch-system-gcc gcov-dump">
|
---|
| 486 | <primary sortas="b-gcov-dump">gcov-dump</primary>
|
---|
| 487 | </indexterm>
|
---|
| 488 | </listitem>
|
---|
| 489 | </varlistentry>
|
---|
| 490 |
|
---|
| 491 | <varlistentry id="gcov-tool">
|
---|
| 492 | <term><command>gcov-tool</command></term>
|
---|
| 493 | <listitem>
|
---|
| 494 | <para>Offline gcda profile processing tool</para>
|
---|
| 495 | <indexterm zone="ch-system-gcc gcov-tool">
|
---|
| 496 | <primary sortas="b-gcov-tool">gcov-tool</primary>
|
---|
| 497 | </indexterm>
|
---|
| 498 | </listitem>
|
---|
| 499 | </varlistentry>
|
---|
| 500 |
|
---|
[e5b4b3f] | 501 | <varlistentry id="lto-dump">
|
---|
| 502 | <term><command>lto-dump</command></term>
|
---|
| 503 | <listitem>
|
---|
| 504 | <para>Tool for dumping object files produced by GCC with LTO
|
---|
| 505 | enabled</para>
|
---|
| 506 | <indexterm zone="ch-system-gcc lto-dump">
|
---|
| 507 | <primary sortas="b-lto-dump">lto-dump</primary>
|
---|
| 508 | </indexterm>
|
---|
| 509 | </listitem>
|
---|
| 510 | </varlistentry>
|
---|
| 511 |
|
---|
[4783efe] | 512 | <varlistentry id="libasan">
|
---|
[78cc3be] | 513 | <term><filename class="libraryfile">libasan</filename></term>
|
---|
[4783efe] | 514 | <listitem>
|
---|
| 515 | <para>The Address Sanitizer runtime library</para>
|
---|
| 516 | <indexterm zone="ch-system-gcc libasan">
|
---|
| 517 | <primary sortas="b-libasan">libasan</primary>
|
---|
| 518 | </indexterm>
|
---|
[6a82dd9] | 519 | </listitem>
|
---|
| 520 | </varlistentry>
|
---|
| 521 |
|
---|
[78cc3be] | 522 | <varlistentry id="libatomic">
|
---|
| 523 | <term><filename class="libraryfile">libatomic</filename></term>
|
---|
| 524 | <listitem>
|
---|
| 525 | <para>GCC atomic built-in runtime library</para>
|
---|
| 526 | <indexterm zone="ch-system-gcc libatomic">
|
---|
| 527 | <primary sortas="b-libatomic">libatomic</primary>
|
---|
| 528 | </indexterm>
|
---|
| 529 | </listitem>
|
---|
| 530 | </varlistentry>
|
---|
| 531 |
|
---|
| 532 | <varlistentry id="libcc1">
|
---|
| 533 | <term><filename class="libraryfile">libcc1</filename></term>
|
---|
| 534 | <listitem>
|
---|
[46b5c6b] | 535 | <para>A library that allows GDB to make use of GCC</para>
|
---|
[78cc3be] | 536 | <indexterm zone="ch-system-gcc libcc1">
|
---|
| 537 | <primary sortas="b-libcc1">libcc1</primary>
|
---|
| 538 | </indexterm>
|
---|
| 539 | </listitem>
|
---|
| 540 | </varlistentry>
|
---|
| 541 |
|
---|
[6a82dd9] | 542 | <varlistentry id="libgcc">
|
---|
| 543 | <term><filename class="libraryfile">libgcc</filename></term>
|
---|
| 544 | <listitem>
|
---|
| 545 | <para>Contains run-time support for <command>gcc</command></para>
|
---|
| 546 | <indexterm zone="ch-system-gcc libgcc">
|
---|
[afba93b] | 547 | <primary sortas="c-libgcc">libgcc</primary>
|
---|
[6a82dd9] | 548 | </indexterm>
|
---|
| 549 | </listitem>
|
---|
| 550 | </varlistentry>
|
---|
| 551 |
|
---|
[90aae6b] | 552 | <varlistentry id="libgcov">
|
---|
| 553 | <term><filename class="libraryfile">libgcov</filename></term>
|
---|
| 554 | <listitem>
|
---|
[30f3041] | 555 | <para>This library is linked into a program when GCC is instructed
|
---|
[90aae6b] | 556 | to enable profiling</para>
|
---|
| 557 | <indexterm zone="ch-system-gcc libgcov">
|
---|
| 558 | <primary sortas="c-libgcov">libgcov</primary>
|
---|
| 559 | </indexterm>
|
---|
| 560 | </listitem>
|
---|
| 561 | </varlistentry>
|
---|
| 562 |
|
---|
| 563 | <varlistentry id="libgomp">
|
---|
| 564 | <term><filename class="libraryfile">libgomp</filename></term>
|
---|
| 565 | <listitem>
|
---|
| 566 | <para>GNU implementation of the OpenMP API for multi-platform
|
---|
| 567 | shared-memory parallel programming in C/C++ and Fortran</para>
|
---|
| 568 | <indexterm zone="ch-system-gcc libgomp">
|
---|
| 569 | <primary sortas="c-libgomp">libgomp</primary>
|
---|
| 570 | </indexterm>
|
---|
| 571 | </listitem>
|
---|
| 572 | </varlistentry>
|
---|
| 573 |
|
---|
[465ada7] | 574 | <varlistentry id="libhwasan">
|
---|
| 575 | <term><filename class="libraryfile">libhwasan</filename></term>
|
---|
| 576 | <listitem>
|
---|
| 577 | <para>The Hardware-assisted Address Sanitizer runtime library</para>
|
---|
| 578 | <indexterm zone="ch-system-gcc libhwasan">
|
---|
| 579 | <primary sortas="c-libhwasan">libhwasan</primary>
|
---|
| 580 | </indexterm>
|
---|
| 581 | </listitem>
|
---|
| 582 | </varlistentry>
|
---|
| 583 |
|
---|
[e5b4b3f] | 584 | <varlistentry id="libitm">
|
---|
| 585 | <term><filename class="libraryfile">libitm</filename></term>
|
---|
| 586 | <listitem>
|
---|
| 587 | <para>The GNU transactional memory library</para>
|
---|
| 588 | <indexterm zone="ch-system-gcc libitm">
|
---|
| 589 | <primary sortas="c-libitm">libitm</primary>
|
---|
| 590 | </indexterm>
|
---|
| 591 | </listitem>
|
---|
| 592 | </varlistentry>
|
---|
| 593 |
|
---|
[78cc3be] | 594 | <varlistentry id="liblsan">
|
---|
| 595 | <term><filename class="libraryfile">liblsan</filename></term>
|
---|
[b755562] | 596 | <listitem>
|
---|
[78cc3be] | 597 | <para>The Leak Sanitizer runtime library</para>
|
---|
| 598 | <indexterm zone="ch-system-gcc liblsan">
|
---|
| 599 | <primary sortas="c-liblsan">liblsan</primary>
|
---|
[b755562] | 600 | </indexterm>
|
---|
| 601 | </listitem>
|
---|
| 602 | </varlistentry>
|
---|
| 603 |
|
---|
[3119ddc] | 604 | <varlistentry id="liblto_plugin">
|
---|
| 605 | <term><filename class="libraryfile">liblto_plugin</filename></term>
|
---|
| 606 | <listitem>
|
---|
[30f3041] | 607 | <para>GCC's LTO plugin allows Binutils to process object files
|
---|
[e5b4b3f] | 608 | produced by GCC with LTO enabled</para>
|
---|
[3119ddc] | 609 | <indexterm zone="ch-system-gcc liblto_plugin">
|
---|
[afba93b] | 610 | <primary sortas="c-liblto_plugin">liblto_plugin</primary>
|
---|
[3119ddc] | 611 | </indexterm>
|
---|
| 612 | </listitem>
|
---|
| 613 | </varlistentry>
|
---|
[7bb9fda] | 614 |
|
---|
[3119ddc] | 615 | <varlistentry id="libquadmath">
|
---|
| 616 | <term><filename class="libraryfile">libquadmath</filename></term>
|
---|
| 617 | <listitem>
|
---|
| 618 | <para>GCC Quad Precision Math Library API</para>
|
---|
| 619 | <indexterm zone="ch-system-gcc libquadmath">
|
---|
[afba93b] | 620 | <primary sortas="c-libquadmath">libquadmath</primary>
|
---|
[3119ddc] | 621 | </indexterm>
|
---|
| 622 | </listitem>
|
---|
| 623 | </varlistentry>
|
---|
| 624 |
|
---|
[2791a8e] | 625 | <varlistentry id="libssp">
|
---|
| 626 | <term><filename class="libraryfile">libssp</filename></term>
|
---|
| 627 | <listitem>
|
---|
| 628 | <para>Contains routines supporting GCC's stack-smashing protection
|
---|
[30f3041] | 629 | functionality. Normally it is not used, because Glibc also provides
|
---|
| 630 | those routines.</para>
|
---|
[2791a8e] | 631 | <indexterm zone="ch-system-gcc libssp">
|
---|
[afba93b] | 632 | <primary sortas="c-libssp">libssp</primary>
|
---|
[2791a8e] | 633 | </indexterm>
|
---|
| 634 | </listitem>
|
---|
| 635 | </varlistentry>
|
---|
| 636 |
|
---|
[6a82dd9] | 637 | <varlistentry id="libstdc">
|
---|
| 638 | <term><filename class="libraryfile">libstdc++</filename></term>
|
---|
| 639 | <listitem>
|
---|
| 640 | <para>The standard C++ library</para>
|
---|
| 641 | <indexterm zone="ch-system-gcc libstdc">
|
---|
| 642 | <primary sortas="c-libstdc++">libstdc++</primary>
|
---|
| 643 | </indexterm>
|
---|
| 644 | </listitem>
|
---|
| 645 | </varlistentry>
|
---|
| 646 |
|
---|
[465ada7] | 647 | <varlistentry id="libstdcexp">
|
---|
| 648 | <term><filename class="libraryfile">libstdc++exp</filename></term>
|
---|
| 649 | <listitem>
|
---|
| 650 | <para>Experimental C++ Contracts library</para>
|
---|
| 651 | <indexterm zone="ch-system-gcc libstdcexp">
|
---|
| 652 | <primary sortas="c-libstdc++exp">libstdc++exp</primary>
|
---|
| 653 | </indexterm>
|
---|
| 654 | </listitem>
|
---|
| 655 | </varlistentry>
|
---|
| 656 |
|
---|
[78cc3be] | 657 | <varlistentry id="libstdcfs">
|
---|
| 658 | <term><filename class="libraryfile">libstdc++fs</filename></term>
|
---|
| 659 | <listitem>
|
---|
| 660 | <para>ISO/IEC TS 18822:2015 Filesystem library</para>
|
---|
| 661 | <indexterm zone="ch-system-gcc libstdcfs">
|
---|
| 662 | <primary sortas="c-libstdc++fs">libstdc++fs</primary>
|
---|
| 663 | </indexterm>
|
---|
| 664 | </listitem>
|
---|
| 665 | </varlistentry>
|
---|
| 666 |
|
---|
[6a82dd9] | 667 | <varlistentry id="libsupc">
|
---|
| 668 | <term><filename class="libraryfile">libsupc++</filename></term>
|
---|
| 669 | <listitem>
|
---|
| 670 | <para>Provides supporting routines for the C++ programming
|
---|
| 671 | language</para>
|
---|
| 672 | <indexterm zone="ch-system-gcc libsupc">
|
---|
| 673 | <primary sortas="c-libsupc++">libsupc++</primary>
|
---|
| 674 | </indexterm>
|
---|
| 675 | </listitem>
|
---|
| 676 | </varlistentry>
|
---|
| 677 |
|
---|
[f6b1d91] | 678 | <varlistentry id="libtsan">
|
---|
| 679 | <term><filename class="libraryfile">libtsan</filename></term>
|
---|
| 680 | <listitem>
|
---|
| 681 | <para>The Thread Sanitizer runtime library</para>
|
---|
| 682 | <indexterm zone="ch-system-gcc libtsan">
|
---|
| 683 | <primary sortas="c-libtsan">libtsan</primary>
|
---|
| 684 | </indexterm>
|
---|
| 685 | </listitem>
|
---|
| 686 | </varlistentry>
|
---|
| 687 |
|
---|
[78cc3be] | 688 | <varlistentry id="libubsan">
|
---|
| 689 | <term><filename class="libraryfile">libubsan</filename></term>
|
---|
| 690 | <listitem>
|
---|
| 691 | <para>The Undefined Behavior Sanitizer runtime library</para>
|
---|
| 692 | <indexterm zone="ch-system-gcc libubsan">
|
---|
| 693 | <primary sortas="c-libubsan">libubsan</primary>
|
---|
| 694 | </indexterm>
|
---|
| 695 | </listitem>
|
---|
| 696 | </varlistentry>
|
---|
| 697 |
|
---|
[6a82dd9] | 698 | </variablelist>
|
---|
| 699 |
|
---|
| 700 | </sect2>
|
---|
[673b0d8] | 701 |
|
---|
| 702 | </sect1>
|
---|