Cross-compilation tool chain

Source: Internet
Author: User

GCC Fortunately said, make all-host very smooth, tools are made out, but All-target compilation is not successful, even LIBGCC are not made out, do not know why these GCC bottom library needs target C library. The installation of these tools has been able to properly compile the kernel, although do not know why the last compiled kernel in the virtual machine can not run.


Finally, refer to the LFS command option, as far as possible without compiling the library, and finally succeeded.


The following is compiled glibc, start even configure are not, the newspaper does not support forced unwind. Open log, it wants to use the target compiler to compile a test program, target GCC can not find the runtime library CRTI.O and so on. I'm not just to build a C Coucay compiled glibc, what is the assumption that I already have a complete library. Later again, reference lfs,configure set a few options, do not let configure to test such functionality. Finally successful configure. LFS is a good thing.


Compile, Error:

In file included from: /sysdeps/unix/sysv/linux/x86_64/sysdep.h:25:0,
From <stdin>:1:
.. /nptl/sysdeps/x86_64/tls.h:23:48:fatal error:asm/prctl.h:no such file or directory
Compilation terminated.

The kernel header file was installed by my own make headers_install. The specified directory at installation does not need to be specified to the include level, but the parameters passed to GLIBC are assigned to the include level.

As for this problem, I forgot to export the target header file instead of the host header file when I installed the header file, to target configuration and arch= $target to correctly export the target header file.


Come again, and make a mistake.

.. /sysdeps/unix/sysv/linux/msgsnd.c:in function ' __libc_msgsnd ':
.. /sysdeps/unix/sysv/linux/msgsnd.c:37:1: Error: ' __NR_IPC ' undeclared (first use of this function)
.. /sysdeps/unix/sysv/linux/msgsnd.c:37:1: Note:each Undeclared identifier is reported only once for each function it appear s in


This looks like my kernel header file is too new, the location of Uapi seems to have undergone a change. The glibc I used was the December 12 version, and I had to cut it to a relatively recent version of 3.6.


Again, also error, reported undefined reference to ' __stack_chk_guard ', really toss ah. Looks like stack Protecor related issues, online said to compile GCC to join LIBSSP support in, is LFs said to turn off this. Indeed, to open this switch after the compilation of GCC error, because no then there is no C library, is also a cyclic dependency. LFS actually mentions this problem, its solution is to change the GCC configuration file, let the built-in LIBGCC.A provide the function of stack protector. But why to change the configuration file. Why not use this feature when configuring GLIBC. Search online, sure enough, you can add libc_cv_ssp= ' no ' when configuring glibc.


Come again, finally succeeded. The time to compile the glibc was longer than that of GCC, which took 3 and a half, and it took 2 and a half minutes to make GCC.




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.