1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<!-- Copyright (C) 1988-2020 Free Software Foundation, Inc. 4 5Permission is granted to copy, distribute and/or modify this document 6under the terms of the GNU Free Documentation License, Version 1.3 or 7any later version published by the Free Software Foundation; with no 8Invariant Sections, the Front-Cover texts being (a) (see below), and 9with the Back-Cover Texts being (b) (see below). A copy of the 10license is included in the section entitled "GNU 11Free Documentation License". 12 13(a) The FSF's Front-Cover Text is: 14 15A GNU Manual 16 17(b) The FSF's Back-Cover Text is: 18 19You have freedom to copy and modify this GNU Manual, like GNU 20 software. Copies published by the Free Software Foundation raise 21 funds for GNU development. --> 22<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ --> 23<head> 24<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 25<title>Installing GCC: Final installation</title> 26 27<meta name="description" content="Installing GCC: Final installation"> 28<meta name="keywords" content="Installing GCC: Final installation"> 29<meta name="resource-type" content="document"> 30<meta name="distribution" content="global"> 31<meta name="Generator" content="makeinfo"> 32<style type="text/css"> 33<!-- 34a.summary-letter {text-decoration: none} 35blockquote.indentedblock {margin-right: 0em} 36blockquote.smallindentedblock {margin-right: 0em; font-size: smaller} 37blockquote.smallquotation {font-size: smaller} 38div.display {margin-left: 3.2em} 39div.example {margin-left: 3.2em} 40div.lisp {margin-left: 3.2em} 41div.smalldisplay {margin-left: 3.2em} 42div.smallexample {margin-left: 3.2em} 43div.smalllisp {margin-left: 3.2em} 44kbd {font-style: oblique} 45pre.display {font-family: inherit} 46pre.format {font-family: inherit} 47pre.menu-comment {font-family: serif} 48pre.menu-preformatted {font-family: serif} 49pre.smalldisplay {font-family: inherit; font-size: smaller} 50pre.smallexample {font-size: smaller} 51pre.smallformat {font-family: inherit; font-size: smaller} 52pre.smalllisp {font-size: smaller} 53span.nolinebreak {white-space: nowrap} 54span.roman {font-family: initial; font-weight: normal} 55span.sansserif {font-family: sans-serif; font-weight: normal} 56ul.no-bullet {list-style: none} 57--> 58</style> 59 60 61</head> 62 63<body lang="en"> 64<h1 class="settitle" align="center">Installing GCC: Final installation</h1> 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88<p>Now that GCC has been built (and optionally tested), you can install it with 89</p><div class="smallexample"> 90<pre class="smallexample">cd <var>objdir</var> && make install 91</pre></div> 92 93<p>We strongly recommend to install into a target directory where there is 94no previous version of GCC present. Also, the GNAT runtime should not 95be stripped, as this would break certain features of the debugger that 96depend on this debugging information (catching Ada exceptions for 97instance). 98</p> 99<p>That step completes the installation of GCC; user level binaries can 100be found in <samp><var>prefix</var>/bin</samp> where <var>prefix</var> is the value 101you specified with the <samp>--prefix</samp> to configure (or 102<samp>/usr/local</samp> by default). (If you specified <samp>--bindir</samp>, 103that directory will be used instead; otherwise, if you specified 104<samp>--exec-prefix</samp>, <samp><var>exec-prefix</var>/bin</samp> will be used.) 105Headers for the C++ library are installed in 106<samp><var>prefix</var>/include</samp>; libraries in <samp><var>libdir</var></samp> 107(normally <samp><var>prefix</var>/lib</samp>); internal parts of the compiler in 108<samp><var>libdir</var>/gcc</samp> and <samp><var>libexecdir</var>/gcc</samp>; documentation 109in info format in <samp><var>infodir</var></samp> (normally 110<samp><var>prefix</var>/info</samp>). 111</p> 112<p>When installing cross-compilers, GCC’s executables 113are not only installed into <samp><var>bindir</var></samp>, that 114is, <samp><var>exec-prefix</var>/bin</samp>, but additionally into 115<samp><var>exec-prefix</var>/<var>target-alias</var>/bin</samp>, if that directory 116exists. Typically, such <em>tooldirs</em> hold target-specific 117binutils, including assembler and linker. 118</p> 119<p>Installation into a temporary staging area or into a <code>chroot</code> 120jail can be achieved with the command 121</p> 122<div class="smallexample"> 123<pre class="smallexample">make DESTDIR=<var>path-to-rootdir</var> install 124</pre></div> 125 126<p>where <var>path-to-rootdir</var> is the absolute path of 127a directory relative to which all installation paths will be 128interpreted. Note that the directory specified by <code>DESTDIR</code> 129need not exist yet; it will be created if necessary. 130</p> 131<p>There is a subtle point with tooldirs and <code>DESTDIR</code>: 132If you relocate a cross-compiler installation with 133e.g. ‘<samp>DESTDIR=<var>rootdir</var></samp>’, then the directory 134<samp><var>rootdir</var>/<var>exec-prefix</var>/<var>target-alias</var>/bin</samp> will 135be filled with duplicated GCC executables only if it already exists, 136it will not be created otherwise. This is regarded as a feature, 137not as a bug, because it gives slightly more control to the packagers 138using the <code>DESTDIR</code> feature. 139</p> 140<p>You can install stripped programs and libraries with 141</p> 142<div class="smallexample"> 143<pre class="smallexample">make install-strip 144</pre></div> 145 146<p>If you are bootstrapping a released version of GCC then please 147quickly review the build status page for your release, available from 148<a href="http://gcc.gnu.org/buildstat.html">http://gcc.gnu.org/buildstat.html</a>. 149If your system is not listed for the version of GCC that you built, 150send a note to 151<a href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a> indicating 152that you successfully built and installed GCC. 153Include the following information: 154</p> 155<ul> 156<li> Output from running <samp><var>srcdir</var>/config.guess</samp>. Do not send 157that file itself, just the one-line output from running it. 158 159</li><li> The output of ‘<samp>gcc -v</samp>’ for your newly installed <code>gcc</code>. 160This tells us which version of GCC you built and the options you passed to 161configure. 162 163</li><li> Whether you enabled all languages or a subset of them. If you used a 164full distribution then this information is part of the configure 165options in the output of ‘<samp>gcc -v</samp>’, but if you downloaded the 166“core” compiler plus additional front ends then it isn’t apparent 167which ones you built unless you tell us about it. 168 169</li><li> If the build was for GNU/Linux, also include: 170<ul> 171<li> The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3); 172this information should be available from <samp>/etc/issue</samp>. 173 174</li><li> The version of the Linux kernel, available from ‘<samp>uname --version</samp>’ 175or ‘<samp>uname -a</samp>’. 176 177</li><li> The version of glibc you used; for RPM-based systems like Red Hat, 178Mandrake, and SuSE type ‘<samp>rpm -q glibc</samp>’ to get the glibc version, 179and on systems like Debian and Progeny use ‘<samp>dpkg -l libc6</samp>’. 180</li></ul> 181<p>For other systems, you can include similar information if you think it is 182relevant. 183</p> 184</li><li> Any other information that you think would be useful to people building 185GCC on the same configuration. The new entry in the build status list 186will include a link to the archived copy of your message. 187</li></ul> 188 189<p>We’d also like to know if the 190<a href="specific.html">host/target specific installation notes</a> 191didn’t include your host/target information or if that information is 192incomplete or out of date. Send a note to 193<a href="mailto:gcc@gcc.gnu.org">gcc@gcc.gnu.org</a> detailing how the information should be changed. 194</p> 195<p>If you find a bug, please report it following the 196<a href="../bugs/">bug reporting guidelines</a>. 197</p> 198<p>If you want to print the GCC manuals, do ‘<samp>cd <var>objdir</var>; make 199dvi</samp>’. You will need to have <code>texi2dvi</code> (version at least 4.7) 200and TeX installed. This creates a number of <samp>.dvi</samp> files in 201subdirectories of <samp><var>objdir</var></samp>; these may be converted for 202printing with programs such as <code>dvips</code>. Alternately, by using 203‘<samp>make pdf</samp>’ in place of ‘<samp>make dvi</samp>’, you can create documentation 204in the form of <samp>.pdf</samp> files; this requires <code>texi2pdf</code>, which 205is included with Texinfo version 4.8 and later. You can also 206<a href="https://shop.fsf.org/">buy printed manuals from the 207Free Software Foundation</a>, though such manuals may not be for the most 208recent version of GCC. 209</p> 210<p>If you would like to generate online HTML documentation, do ‘<samp>cd 211<var>objdir</var>; make html</samp>’ and HTML will be generated for the gcc manuals in 212<samp><var>objdir</var>/gcc/HTML</samp>. 213</p> 214<hr /> 215<p> 216<p><a href="./index.html">Return to the GCC Installation page</a> 217</p> 218 219 220 221 222 223 224 225 226</body> 227</html> 228