Build cross-compilation chain arm-linux-gnueabihf-

Source: Internet
Author: User
Tags gmp

<title>Build cross-compilation chain arm-linux-gnueabihf-</title>

Finally...... It worked....

First of all thank http://preshing.com/20141119/how-to-build-a-gcc-cross-compiler/

Add a reference URL to the insurance point, the previous look at this has not been successful ... Now understand ...:

Http://wiki.osdev.org/GCC_Cross-Compiler


Need to download the following package, in exchange for other versions, have failed ... I'm drunk, too.

wget http://ftpmirror.gnu.org/binutils/binutils-2.24.tar.gz

wget http://ftpmirror.gnu.org/gcc/gcc-4.9.2/gcc-4.9.2.tar.gz

wget Https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.79.tar.xz

? wgetHttp://ftpmirror.gnu.org/glibc/glibc-2.20.tar.xz

wget HTTP://FTPMIRROR.GNU.ORG/MPFR/MPFR-3.1.2.TAR.XZ

wget HTTP://FTPMIRROR.GNU.ORG/GMP/GMP-6.0.0A.TAR.XZ

wget http://ftpmirror.gnu.org/mpc/mpc-1.0.2.tar.gz

wget ftp://gcc.gnu.org/pub/gcc/infrastructure/isl-0.12.2.tar.bz2

wget ftp://gcc.gnu.org/pub/gcc/infrastructure/cloog-0.18.1.tar.gz



Build Steps

Unzip all the compressed packages first:

for f in *.tar*; Do tar XF $f; Done

(Rose knowledge ...)


Put the Mpfr,gmp,mpc,isl,cloog in the GCC directory:

CD gcc-4.9.2

Ln-s. /mpfr-3.1.2 MPFR

Ln-s. /mpc-1.0.2 MPC

Ln-s. /isl-0.12.2 ISL

Ln-s. /cloog-0.18.1 Cloog

Cd..


Then create a cross-compile root directory:

sudo mkdir-p/opt/cross

sudo chown-r 777/opt/cross


Declaring environment variables:

Export Prefix=/opt/cross

Export Path=/opt/cross/bin: $PATH

Export TARGET=ARM-LINUX-GNUEABIHF


OK, start the main step

=========================================

Step 1: Build Binutils

mkdir build-binutils

CD Build-binutils

.. /binutils-2.24/configure--prefix= $PREFIX--target= $TARGET--disable-multilib

Make-j8

sudo make install

Cd..


Step 2: Linux Kernel Headers

CD linux-3.4.79

sudo make arch=arm install_hdr_path=/opt/cross/$TARGET Headers_install

Cd..


Step 3: C + + Compilers

mkdir BUILD-GCC

CD BUILD-GCC

.. /gcc-4.9.2/configure--prefix= $PREFIX--target= $TARGET--enable-languages=c,c++--disable-multilib

Make-j8 ALL-GCC

sudo make INSTALL-GCC

Cd..


Step 4: Standard C Library Headers and Startup Files

Mkdir-p BUILD-GLIBC

CD BUILD-GLIBC

.. /glibc-2.20/configure--prefix=/opt/cross/$TARGET--build= $MACHTYPE--host= $TARGET--target= $TARGET--with-headers= /opt/cross/$TARGET/include--disable-multilib libc_cv_forced_unwind=yes

sudo make Install-bootstrap-headers=yes install-headers

sudo make-j8 csu/subdir_lib

sudo install csu/crt1.o csu/crti.o csu/crtn.o/opt/cross/$TARGET/lib

sudo $TARGET-gcc-nostdlib-nostartfiles-shared-x c/dev/null-o/opt/cross/$TARGET/lib/libc.so

sudo touch/opt/cross/$TARGET/include/gnu/stubs.h

Cd..


Step 5: Compiler Support Library

CD BUILD-GCC

sudo make-j8 ALL-TARGET-LIBGCC

sudo make INSTALL-TARGET-LIBGCC

Cd..


Step 6: Standard C Library

CD BUILD-GLIBC

sudo make-j8

sudo make install

Cd..


Step 7: Standard C + + Library

CD BUILD-GCC

sudo make-j8

sudo make install

Cd..




From for notes (Wiz)

Build cross-compilation chain arm-linux-gnueabihf-

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.