Project

General

Profile

DeprecatedNative64BitBuild » History » Version 9

Paul Kocialkowski, 05/24/2011 06:04 PM

1 1 Paul Kocialkowski
2 9 Paul Kocialkowski
h1. Replicant Native 64 Bit Build
3
4
5
<pre>
6
<code class="div">
7 1 Paul Kocialkowski
This page is not ready to be used yet!
8 9 Paul Kocialkowski
</code></pre>
9 1 Paul Kocialkowski
10
This page explains how to configure a 64b native build. The goal is to build Replicant without the need of 32b compatibility libs and to produce 64b host binaries (adb, fastboot, emulator, etc).
11
12 9 Paul Kocialkowski
*Note: This is a quite experimental and long process. Although you don't risk any damage to your computer while trying to set this up, you should better already have basic knowledge about building gcc, dealing with Makefiles and other related stuff, since some errors may append.* 
13 1 Paul Kocialkowski
14
Note for the whole page: when a line is prefixed with #, that means that you have to run the command as root. Don't copy the # on the shell. 
15
16 5 Paul Kocialkowski
17 9 Paul Kocialkowski
h2. Required tools
18
19
20 1 Paul Kocialkowski
Make sure you have all the basic tools for building:
21 9 Paul Kocialkowski
* gcc
22
* make
23
* binutils
24
* …
25
Installing all the required packages of the [[BuildDream]] page is a good idea. Remember to avoid installing the packages of the *Additional requirements for amd64* section since the goal of this page is to avoid the use of these packages. 
26 5 Paul Kocialkowski
27 2 Paul Kocialkowski
28 9 Paul Kocialkowski
h2. Building the toolchain
29 1 Paul Kocialkowski
30 9 Paul Kocialkowski
31
32
h3. Downloading the files
33
34
35 2 Paul Kocialkowski
First, you'll need to download binutils, gcc-core, gcc-g++, gmp and mpfr:
36
37 9 Paul Kocialkowski
<pre>
38 2 Paul Kocialkowski
mkdir replicant-toolchain
39
cd replicant-toolchain
40 1 Paul Kocialkowski
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
41
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-core-4.4.3.tar.bz2
42
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-g++-4.4.3.tar.bz2
43
wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.bz2
44 2 Paul Kocialkowski
wget http://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.bz2
45 1 Paul Kocialkowski
tar -xf binutils-2.21.tar.bz2
46 3 Paul Kocialkowski
tar -xf gcc-core-4.4.3.tar.bz2
47 1 Paul Kocialkowski
tar -xf gcc-g++-4.4.3.tar.bz2
48
tar -xf gmp-4.3.2.tar.bz2
49
tar -xf mpfr-3.0.1.tar.bz2
50
mv gmp-4.3.2 gcc-4.4.3/
51
mv mpfr-3.0.1 gcc-4.4.3/
52 9 Paul Kocialkowski
</code></pre>
53 4 Paul Kocialkowski
54 3 Paul Kocialkowski
Now, you have to build binutils and gcc for the arm-eabi target.
55
56
57 9 Paul Kocialkowski
h3. Building binutils
58
59
60
<pre>
61 1 Paul Kocialkowski
cd binutils-2.21
62
./configure --target=arm-eabi --prefix=/usr/local
63 4 Paul Kocialkowski
make
64 1 Paul Kocialkowski
# make install
65 9 Paul Kocialkowski
</code></pre>
66 1 Paul Kocialkowski
67
68 9 Paul Kocialkowski
h3. Building gcc
69
70
71
<pre>
72 1 Paul Kocialkowski
cd ../gcc-4.4.3
73
mkdir build
74
cd build
75
../configure --target=arm-eabi --prefix=/usr/local --with-mpfr=../mpfr-3.0.1/ --with-gmp=../gmp-4.3.2/ --enable-shared
76
make
77 3 Paul Kocialkowski
# make install
78 9 Paul Kocialkowski
</code></pre>
79 3 Paul Kocialkowski
80 9 Paul Kocialkowski
<pre>
81 2 Paul Kocialkowski
82 6 Paul Kocialkowski
83 9 Paul Kocialkowski
h2. Modifying the files for 64b
84
85
86 6 Paul Kocialkowski
Now that your toolchain is in place, you need to configure your build for 64b. Here is the list of the modifications you should do:
87
88
89 9 Paul Kocialkowski
h3. build/core/combo/
90
91
92
<pre>
93 6 Paul Kocialkowski
sed "s/-m32/-m64/g" -i HOST_linux-x86.mk
94
sed "s/-m32/-m64/g" -i TARGET_linux-x86.mk
95
sed "s|prebuilt/\$(HOST_PREBUILT_TAG)/toolchain/i686-unknown-linux-gnu-4.2.1/bin/i686-unknown-linux-gnu-|/usr/local/bin/arm-eabi-|g" -i TARGET_linux-x86.mk
96
sed "s|prebuilt/\$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin/arm-eabi-|/usr/local/bin/arm-eabi-|g" -i TARGET_linux-arm.mk
97 9 Paul Kocialkowski
</code></pre>
98 7 Paul Kocialkowski
99
100 9 Paul Kocialkowski
h3. external/qemu/
101
102
103
<pre>
104 1 Paul Kocialkowski
sed "s/-m32/-m64/g" -i Makefile.android
105 9 Paul Kocialkowski
</code></pre>