aboutsummaryrefslogtreecommitdiffstats
path: root/chapter05/adjusting.xml
blob: 473d895d9db0ff4eaed7a0a3ab3aa7ccb1e02d58 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>
<sect1 id="ch-tools-adjusting">
<title>Adjusting the Toolchain</title>
<?dbhtml filename="adjusting.html"?>

<para>Run the following command from within
the <filename class="directory">binutils-build</filename> directory:</para>

<screen><userinput>make -C ld install</userinput></screen>

<para>Amend the GCC specs file:</para>

<screen><userinput>SPECFILE=`gcc --print-file specs` &amp;&amp;
sed 's@ /lib/ld-linux.so.2@ /tools/lib/ld-linux.so.2@g' \
    $SPECFILE &gt; tempspecfile &amp;&amp;
mv -f tempspecfile $SPECFILE &amp;&amp;
unset SPECFILE</userinput></screen>

<para>Make clean-up:</para>

<screen><userinput>rm -f /tools/lib/gcc/*/*/include/{pthread.h,bits/sigthread.h}</userinput></screen>

<para>Test the tools:</para>

<screen><userinput>echo 'main(){}' &gt; dummy.c
cc dummy.c
readelf -l a.out | grep ': /tools'</userinput></screen>

<para>The output of the last command will be of the form:</para>

<screen><computeroutput>[Requesting program interpreter: /tools/lib/ld-linux.so.2]</computeroutput></screen>

<para>Remove the test files:</para>

<screen><userinput>rm dummy.c a.out</userinput></screen>


</sect1>