Make Mipsel-linux Cross compile tool 2__linux

Source: Internet
Author: User
Tags mkdir

6 Compiling static GCC
Because there is no MIPS GLIBC library can be used, can only compile one of the simplest gcc, with this GCC compiled glibc can then compile a complete gcc. GLIBC is a shared library, and GCC cannot support glibc, so this gcc is also called "Static GCC", and from another point of view, GCC is a simple gcc for generating subsequent completed GCC. Therefore, it is also known as "Bootstrap gcc".
If you just want to compile the Linux core code, complete this step.
(a) decompression to obtain the source code.
Cd/home/crosstool/tmp
Tar Xvfz. /gcc-3.2.tar.gz
(b) Complete configuration and compilation. At this point, set up a directory mipsel-linux-static to work. In the following work, you will create another directory in the same location for the full version of GCC compilation;--prefix uses the same settings as the previous steps to make the tool installation work together;--disable-shared says you can't use Glibc;--with- Headers is important, it points out that when compiling, you want to use the header file that you prepared before
CD gcc-3.2
mkdir mipsel-linux-tatic
CD mipsel-linux-static
.. /configure--target=mipsel-linux--enable-languages=c
--prefix=/usr/local/cross-gcc/mipsel-linux
--disable-shared
--with-headers=/home/crosstool/tmp/include
During the Configure process, you can see a piece of information such as output:
Copying/home/crosstool/tmp/include To/usr/local/cross--gcc/mipsel-linux/mipsel-linux/sys-include
Indicates that. The specified header file has been/home/crosstool/tmp/include
Copy to target location/usr/local/cross-gcc/mipsel-linux/mipsel-linux/sys-include use. This is important, and you will need to use this directory in later steps.
Make
Make install

7 Compiling GLIBC
Now, use the GCC and binutils generated earlier to generate a glibc library that can work on the target platform MIPS.
(a) decompression, get the source code
Cd/home/crosstool/tmp
Tar Xvfz. /glibc-2-2.5.tar.gz
(b) Completion of configuration and compilation
CD glibc-2.2.5
Patch-i.. /.. /gibc-2.2.5-mips-build-gmon.diff
If the report has files that cannot be found, just answer the correct file name and help it find it.
Tar-xzf.. /.. /glibc-linuxthreads-2.2.5.tar.gz
mkdir MIPSEL-GLIBC
CD MIPSEL-GLIBC
cflags= "-o2-g-finline-limit=10000"
.. /configure--build=i686-linux
--host=mipsel-linux
--enable-add-ons
--prefix=/usr/local/cross-gcc/mipsel-linux
--build indicates that I686-linux compiled on the glibc;--host indicates that glibc is in mipsel-linux format;--prefix is the same as the previous step.
Make
Make install install Root=/home/crosstool/tmp/glibc-2.2.5-inst
First installed in a temporary location. Pass the file over again.
(c) Transfer the generated LIB to the specified location
Pass Lib to/usr/local/cross-gcc/mipsel-linux/mipsel-linux/lib
cp-r/home/crosstool/tmp/glibc-2.2.5-inst/usr/local/cross-gcc/mipsel-linux/lib/
/usr/local/cross-gcc/mipsel-linux/mipsel-linux/
This position is the directory that the previous MIPSEL-LINUX-LD will search.
(d) Modify the path in libc.so
Vi/usr/local/cross-gcc/mipsel-linux/mipsel-linux/lib/libe.so corrects the path of two of these files

GROUP (/usr/local/cross-gcc/mipsel-linux/mipsel-linux/lib/libc.so.6
/USR/LOCAL/CROSS-GCC/MIPSEL-LINUX/MIPSEL-LINUX/LIB/LIBC_NON-SHARED.A)
(e) Transfer the generated include to the correct location
Change the name of/usr/local/cross-gcc/mipsel-linux/mipsel-linux/mipsel-linux/sys-include to include
cd/usr/local/cross-gcc/mipsel-linux/mipsel-linux/
MV Sys-include include
Upload include files to/usr/local/cross-gcc/mipsel-linux/mipsel-linux/include
cp-r-f/home/crosstool/tmp/glibc-2.2.5-inst/usr/local/cross-
gcc/mipsel-linux/include//usr/local/cross-gcc/mipsel-linux/mipsel-linux/

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.