Gcc 4.5.1 cross compiler Build Process

Source: Internet
Author: User

1,: http://ftp.gnu.org/gnu/

Download content: gcc, binutils, glibc

2. Step: 1) binutils

2) minimize cross-compilation gcc

3) linux kernel headers

4) glibc

5) Final gcc version

3. Because the latest version of binutils (2.21) requires the use of the command-making tool, gmp, and mpfr, but cross-compilation is not required, you can directly install the x86 tool.

The configure parameter of binutils only needs to be set to target for arm-linux. Other disabling options are unnecessary.

4. Minimize the dependency on the host lib during gcc compilation, and disable shared and threads. In addition, libmudflap, multilib, libssp, libgomp, and libiberty must be disabled (except for the first option, it is an option that fails to pass the arm compilation condition ),

The configure parameter is set: -- target = arm-none-linux-gnueabi -- disable-shared -- disable-threads -- without-heades -- disable-libmudflap -- enable-versions ages = c -- disable-libmudflap -- disable-multilib -- disable-libssp -- disable-libgomp

Make all-gcc install-gcc and then make all-target-libgcc install-target-libgcc. Because libgcc depends on gcc, you need to install gcc before compiling libgcc.

5. linux kernel is usually stored in the/usr/src/kernel directory. Both fedora and archlinux (which seems to be x86 only) are provided by default. If no headers can be downloaded from kernel.org, copy it to the include directory or add the headers path in glibc compilation.

6. The pthread of nptl of glibc needs to detect unwind, c cleanup handling, and gnu89 line, and force the corresponding configure detection content to succeed.

If the gnu89 line option is not set during configure, it may pass, but an error occurs during make. CFLAGS + =-fno-stack-protector you can also add gnu89-line options

Because there is no config-name.h file, you create one based on the uname-a results.

The makefile file of manmul has a small problem. The hidden rule lines that indicate the error will be handled separately.

Add <tls. h> for lowlevellock. h

Replace 0 of the sed statement about _ begin in the makefile file of elf .*

Add hidden_def (_ sigsetjmp) to the end of sysdeps/arm/fpu/setjmp. S file)

8. Compile the final version of gcc

The configure parameter is set to -- target = arm-none-linux-gnueabi -- enable-shared -- enable-threads -- enable-nls -- enable-classes ages = c, c ++

With regard to nls support, there seems to be no difference between disabling and not disabling. Generally, nls is disabled.

Note: It is generally necessary to perform bold operations. Other operations may vary depending on the environment.

The problem usually occurs in the glibc compilation process, and the rest are still relatively smooth.

Whether the difference between arm-none-linux-gnueabi and arm-linux provides eabi support depends on the systems provided by the mini6410 Development Board. Otherwise, a segment error is reported.

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.