Project

General

Profile

DeprecatedNative64BitBuild » History » Version 10

Paul Kocialkowski, 02/05/2012 03:20 PM

1 9 Paul Kocialkowski
h1. Replicant Native 64 Bit Build
2 1 Paul Kocialkowski
3 10 Paul Kocialkowski
*This page is not ready to be used yet!*
4 1 Paul Kocialkowski
5
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).
6
7
*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.* 
8
9
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. 
10
11
h2. Required tools
12
13 10 Paul Kocialkowski
Before building, you must make sure:
14
* You have installed the [[BuildDependencies]], except the ones for 64b, that we want to avoid here
15
* You have downloaded Replicant sources: [[GettingReplicantSources]]
16 1 Paul Kocialkowski
17 9 Paul Kocialkowski
h2. Building the toolchain
18
19
h3. Downloading the files
20 1 Paul Kocialkowski
21 9 Paul Kocialkowski
First, you'll need to download binutils, gcc-core, gcc-g++, gmp and mpfr:
22 2 Paul Kocialkowski
23
<pre>
24 9 Paul Kocialkowski
mkdir replicant-toolchain
25 2 Paul Kocialkowski
cd replicant-toolchain
26
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
27 1 Paul Kocialkowski
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-core-4.4.3.tar.bz2
28
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-g++-4.4.3.tar.bz2
29
wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.bz2
30
wget http://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.bz2
31
tar -xf binutils-2.21.tar.bz2
32 2 Paul Kocialkowski
tar -xf gcc-core-4.4.3.tar.bz2
33 1 Paul Kocialkowski
tar -xf gcc-g++-4.4.3.tar.bz2
34
tar -xf gmp-4.3.2.tar.bz2
35
tar -xf mpfr-3.0.1.tar.bz2
36
mv gmp-4.3.2 gcc-4.4.3/
37
mv mpfr-3.0.1 gcc-4.4.3/
38 10 Paul Kocialkowski
</pre>
39 1 Paul Kocialkowski
40 3 Paul Kocialkowski
Now, you have to build binutils and gcc for the arm-eabi target.
41
42
h3. Building binutils
43 9 Paul Kocialkowski
44
<pre>
45 1 Paul Kocialkowski
cd binutils-2.21
46
./configure --target=arm-eabi --prefix=/usr/local
47
make
48 9 Paul Kocialkowski
# make install
49 10 Paul Kocialkowski
</pre>
50 1 Paul Kocialkowski
51
h3. Building gcc
52 9 Paul Kocialkowski
53
<pre>
54 1 Paul Kocialkowski
cd ../gcc-4.4.3
55
mkdir build
56
cd build
57 3 Paul Kocialkowski
../configure --target=arm-eabi --prefix=/usr/local --with-mpfr=../mpfr-3.0.1/ --with-gmp=../gmp-4.3.2/ --enable-shared
58 9 Paul Kocialkowski
make
59
# make install
60 10 Paul Kocialkowski
</pre>
61 9 Paul Kocialkowski
62
h2. Modifying the files for 64b
63
64 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:
65
66 9 Paul Kocialkowski
h3. build/core/combo/
67
68
<pre>
69 6 Paul Kocialkowski
sed "s/-m32/-m64/g" -i HOST_linux-x86.mk
70
sed "s/-m32/-m64/g" -i TARGET_linux-x86.mk
71 9 Paul Kocialkowski
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
72 7 Paul Kocialkowski
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
73 10 Paul Kocialkowski
</pre>
74 9 Paul Kocialkowski
75
h3. external/qemu/
76
77
<pre>
78 1 Paul Kocialkowski
sed "s/-m32/-m64/g" -i Makefile.android
79 10 Paul Kocialkowski
</pre>