Project

General

Profile

Actions

DeprecatedNative64BitBuild » History » Revision 7

« Previous | Revision 7/10 (diff) | Next »
Paul Kocialkowski, 04/20/2011 10:47 AM


= Replicant Native 64 Bit Build =

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

Make sure you have all the basic tools for building: * gcc * make * binutils * …
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.

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
  1. 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
  1. make install
    }}}

You should now have a {{{ /usr/local/arm-eabi/ }}} folder and binaries prefixed by {{{ arm-eabi- }}} in the /usr/local/bin/ folder.

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
}}}

Updated by Paul Kocialkowski almost 13 years ago · 7 revisions

Also available in: PDF HTML TXT