source: chapter06/gcc-pass2.xml@ c4595c3

multilib
Last change on this file since c4595c3 was c4595c3, checked in by Thomas Trepl (Moody) <thomas@…>, 2 years ago

Fix usage of ISL in gcc

  • Property mode set to 100644
File size: 7.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
8<sect1 id="ch-tools-gcc-pass2" role="wrap" xreflabel="gcc-pass2">
9 <?dbhtml filename="gcc-pass2.html"?>
10
11 <sect1info condition="script">
12 <productname>gcc-pass2</productname>
13 <productnumber>&gcc-version;</productnumber>
14 <address>&gcc-url;</address>
15 </sect1info>
16
17 <title>GCC-&gcc-version; - Pass 2</title>
18
19 <indexterm zone="ch-tools-gcc-pass2">
20 <primary sortas="a-GCC">GCC</primary>
21 <secondary>tools, pass 2</secondary>
22 </indexterm>
23
24 <sect2 role="package">
25 <title/>
26
27 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
28 href="../chapter08/gcc.xml"
29 xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
30
31 <segmentedlist>
32 <segtitle>&buildtime;</segtitle>
33 <segtitle>&diskspace;</segtitle>
34
35 <seglistitem>
36 <seg>&gcc-tmpp2-sbu;</seg>
37 <seg>&gcc-tmpp2-du;</seg>
38 </seglistitem>
39 </segmentedlist>
40
41 </sect2>
42
43 <sect2 role="installation">
44 <title>Installation of GCC</title>
45
46 <para>As in the first build of GCC, the GMP, MPFR, and MPC packages are
47 required. Unpack the tarballs and move them into the required directory
48 names:</para>
49
50<screen><userinput remap="pre">tar -xf ../mpfr-&mpfr-version;.tar.xz
51mv -v mpfr-&mpfr-version; mpfr
52tar -xf ../gmp-&gmp-version;.tar.xz
53mv -v gmp-&gmp-version; gmp
54tar -xf ../mpc-&mpc-version;.tar.gz
55mv -v mpc-&mpc-version; mpc</userinput></screen>
56
57
58 <para arch="default">If building on x86_64, change the default directory name for 64-bit
59 libraries to <quote>lib</quote>:</para>
60
61<screen arch="default"><userinput remap="pre">case $(uname -m) in
62 x86_64)
63 sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
64 ;;
65esac</userinput></screen>
66
67 <para arch="ml_32,ml_x32,ml_all">Change the default directory name for
68 libraries:</para>
69
70<screen arch="ml_32,ml_x32,ml_all"><userinput remap="pre">sed -e '/m64=/s/lib64/lib/' \
71 -e '/m32=/s/m32=.*/m32=..\/lib32$(call if_multiarch,:i386-linux-gnu)/' \
72 -i.orig gcc/config/i386/t-linux64</userinput></screen>
73<!--
74<screen><userinput remap="pre">patch -Np1 -i ../&gcc-cross-patch;</userinput></screen>
75-->
76 <para>Create a separate build directory again:</para>
77
78<screen><userinput remap="pre">mkdir -v build
79cd build</userinput></screen>
80
81 <para>Create a symlink that allows libgcc to be built with posix threads
82 support:</para>
83
84<screen><userinput remap="pre">mkdir -pv $LFS_TGT/libgcc
85ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h</userinput></screen>
86
87 <para>Before starting to build GCC, remember to unset any environment
88 variables that override the default optimization flags.</para>
89
90 <para>Now prepare GCC for compilation:</para>
91
92<screen arch="default"><userinput remap="configure">../configure \
93 --build=$(../config.guess) \
94 --host=$LFS_TGT \
95 --prefix=/usr \
96 CC_FOR_TARGET=$LFS_TGT-gcc \
97 --with-build-sysroot=$LFS \
98 --enable-initfini-array \
99 --disable-nls \
100 --disable-multilib \
101 --disable-decimal-float \
102 --disable-libatomic \
103 --disable-libgomp \
104 --disable-libquadmath \
105 --disable-libssp \
106 --disable-libvtv \
107 --disable-libstdcxx \
108 --enable-languages=c,c++</userinput></screen>
109<screen arch="ml_32,ml_x32,ml_all"><userinput remap="configure"
110 arch="ml_32">mlist=m64,m32</userinput><userinput remap="configure"
111 arch="ml_x32">mlist=m64,mx32</userinput><userinput remap="configure"
112 arch="ml_all">mlist=m64,m32,mx32</userinput>
113<userinput remap="configure">../configure \
114 --build=$(../config.guess) \
115 --host=$LFS_TGT \
116 --prefix=/usr \
117 CC_FOR_TARGET=$LFS_TGT-gcc \
118 --with-build-sysroot=$LFS \
119 --enable-initfini-array \
120 --disable-nls \
121 --enable-multilib --with-multilib-list=$mlist \
122 --disable-decimal-float \
123 --disable-libatomic \
124 --disable-libgomp \
125 --disable-libquadmath \
126 --disable-libssp \
127 --disable-libvtv \
128 --disable-libstdcxx \
129 --enable-languages=c,c++</userinput></screen>
130
131 <variablelist>
132 <title>The meaning of the new configure options:</title><!-- WIP -->
133
134 <varlistentry>
135 <term><parameter>-with-build-sysroot=$LFS</parameter></term>
136 <listitem>
137 <para>Normally, using <parameter>--host</parameter> ensures that
138 a cross-compiler is used for building GCC, and that compiler knows
139 that it has to look for headers and libraries in <filename
140 class="directory">$LFS</filename>. But the build system of GCC uses
141 other tools, which are not aware of this location. This switch is
142 needed to have them find the needed files in <filename
143 class="directory">$LFS</filename>, and not on the host.</para>
144 </listitem>
145 </varlistentry>
146
147 <varlistentry>
148 <term><parameter>--enable-initfini-array</parameter></term>
149 <listitem>
150 <para>This option is automatically enabled when building a native
151 compiler with a native compiler on x86. But here, we build with
152 a cross compiler, so we need to explicitly set this option.</para>
153 </listitem>
154 </varlistentry>
155
156 </variablelist>
157
158 <para>Compile the package:</para>
159
160<screen><userinput remap="make">make</userinput></screen>
161
162 <para>Install the package:</para>
163
164<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen>
165
166 <para>As a finishing touch, create a utility symlink. Many programs and scripts
167 run <command>cc</command> instead of <command>gcc</command>, which is
168 used to keep programs generic and therefore usable on all kinds of UNIX
169 systems where the GNU C compiler is not always installed. Running
170 <command>cc</command> leaves the system administrator free to decide
171 which C compiler to install:</para>
172
173<screen><userinput remap="install">ln -sv gcc $LFS/usr/bin/cc</userinput></screen>
174
175 </sect2>
176
177 <sect2 role="content">
178 <title/>
179
180 <para>Details on this package are located in
181 <xref linkend="contents-gcc" role="."/></para>
182
183 </sect2>
184
185</sect1>
Note: See TracBrowser for help on using the repository browser.