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