Project

General

Profile

Replicant Native 64 Bit Build

This page is not ready to be used yet!

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).

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.

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.

Required tools

Before building, you must make sure:

Building the toolchain

Downloading the files

First, you'll need to download binutils, gcc-core, gcc-g++, gmp and mpfr:

mkdir replicant-toolchain
cd replicant-toolchain
wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-core-4.4.3.tar.bz2
wget http://ftp.gnu.org/gnu/gcc/gcc-4.4.3/gcc-g++-4.4.3.tar.bz2
wget http://ftp.gnu.org/gnu/gmp/gmp-4.3.2.tar.bz2
wget http://ftp.gnu.org/gnu/mpfr/mpfr-3.0.1.tar.bz2
tar -xf binutils-2.21.tar.bz2
tar -xf gcc-core-4.4.3.tar.bz2
tar -xf gcc-g++-4.4.3.tar.bz2
tar -xf gmp-4.3.2.tar.bz2
tar -xf mpfr-3.0.1.tar.bz2
mv gmp-4.3.2 gcc-4.4.3/
mv mpfr-3.0.1 gcc-4.4.3/

Now, you have to build binutils and gcc for the arm-eabi target.

Building binutils

cd binutils-2.21
./configure --target=arm-eabi --prefix=/usr/local
make
# make install

Building gcc

cd ../gcc-4.4.3
mkdir build
cd build
../configure --target=arm-eabi --prefix=/usr/local --with-mpfr=../mpfr-3.0.1/ --with-gmp=../gmp-4.3.2/ --enable-shared
make
# make install

Modifying the files for 64b

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:

build/core/combo/

sed "s/-m32/-m64/g" -i HOST_linux-x86.mk
sed "s/-m32/-m64/g" -i TARGET_linux-x86.mk
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
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

external/qemu/

sed "s/-m32/-m64/g" -i Makefile.android