Project

General

Profile

DeprecatedNative64BitBuild » History » Version 7

Paul Kocialkowski, 04/20/2011 10:47 AM

1 2 Paul Kocialkowski
= Replicant Native 64 Bit Build =
2
3 1 Paul Kocialkowski
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).
4
5
'''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.''' 
6 2 Paul Kocialkowski
7 3 Paul Kocialkowski
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. 
8
9 2 Paul Kocialkowski
== Required tools ==
10
11 5 Paul Kocialkowski
Make sure you have all the basic tools for building:
12
 * gcc
13
 * make
14
 * binutils
15
 * …
16
Installing all the required packages of the [wiki: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. 
17 2 Paul Kocialkowski
18
== Building the toolchain ==
19 1 Paul Kocialkowski
20 4 Paul Kocialkowski
=== Downloading the files ===
21
22 3 Paul Kocialkowski
First, you'll need to download binutils, gcc-core, gcc-g++, gmp and mpfr:
23 2 Paul Kocialkowski
24
{{{
25
mkdir replicant-toolchain
26
cd replicant-toolchain
27
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
28
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-core-4.4.3.tar.bz2
29
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-g++-4.4.3.tar.bz2
30
wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.bz2
31
wget http://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.bz2
32
tar -xf binutils-2.21.tar.bz2
33
tar -xf gcc-core-4.4.3.tar.bz2
34
tar -xf gcc-g++-4.4.3.tar.bz2
35
tar -xf gmp-4.3.2.tar.bz2
36 1 Paul Kocialkowski
tar -xf mpfr-3.0.1.tar.bz2
37 3 Paul Kocialkowski
mv gmp-4.3.2 gcc-4.4.3/
38
mv mpfr-3.0.1 gcc-4.4.3/
39
}}}
40 1 Paul Kocialkowski
41 4 Paul Kocialkowski
Now, you have to build binutils and gcc for the arm-eabi target.
42
43
=== Building binutils ===
44
45 3 Paul Kocialkowski
{{{
46
cd binutils-2.21
47
./configure --target=arm-eabi --prefix=/usr/local
48
make
49 1 Paul Kocialkowski
# make install
50 4 Paul Kocialkowski
}}}
51
52
=== Building gcc ===
53
54
{{{
55 3 Paul Kocialkowski
cd ../gcc-4.4.3
56
mkdir build
57
cd build
58
../configure --target=arm-eabi --prefix=/usr/local --with-mpfr=../mpfr-3.0.1/ --with-gmp=../gmp-4.3.2/ --enable-shared
59
make
60
# make install
61 2 Paul Kocialkowski
}}}
62 6 Paul Kocialkowski
63
You should now have a {{{ /usr/local/arm-eabi/ }}} folder and binaries prefixed by {{{ arm-eabi- }}} in the /usr/local/bin/ folder.
64
65
== Modifying the files for 64b ==
66
67
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:
68
69
=== build/core/combo/ ===
70
71
{{{
72
sed "s/-m32/-m64/g" -i HOST_linux-x86.mk
73
sed "s/-m32/-m64/g" -i TARGET_linux-x86.mk
74
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
75
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
76
}}}
77 7 Paul Kocialkowski
78
=== external/qemu/ ===
79
80
{{{
81
sed "s/-m32/-m64/g" -i Makefile.android
82
}}}