Difficulties in using Crosstool to create a cross-compilation tool in Ubuntu

Source: Internet
Author: User
Tags truncated
Using crosstool in Ubuntu to build a arm-linux-gcc-3.4.1 (arm-softfloat-linux-gnu-) to address softfloat problems, the following error message is always prompted. /Lib_arm/_ udivsi3.S: 67: relocationtruncatedtofit: R_A

Use crosstool in Ubuntu to create a cross-compilation tool
(Arm-softfloat-linux-gnu -)
To solve the softfloat Problem

When you compile a arm-linux-gcc-3.4.1 with a arm-linux-2.95.3 and U-BOOT-1.1.6 cross-compilation tool, the following similar error message is always prompted.
/Lib_arm/_ udivsi3.S: 67: relocation truncated to fit: R_ARM_PLT32 _ div0
Lib_arm/_ umodsi3.S: 79: relocation truncated to fit: R_ARM_PLT32 _ div0
I searched the internet and found that there were still many such problems. The solution provided by netizens is:
1) Remove the soft-float compilation Option
2) rebuild the cross-compilation tool
I tried it and found that this problem still cannot be solved after soft-float is removed. Follow the methods of vxworks and Erya to recreate cross tools. The steps are as follows:
1) log in as root
2) create a directory/opt/crosstool/and modify its owner. This crosstool cannot be installed as root, but must be installed as username. The installation process reads and writes the directory, so you need to modify the owner.
3) log in with User username
4) Create the/home/username/downloads directory to automatically download gcc, binutilty, and glibc from the Internet. If you have already downloaded these software packages, put them in this directory, so that you do not need to automatically download them from the Internet.
5) slave
6) cd/opt/crosstool tar xzvf crosstool-0.43.tar.gz
7) enter the crosstool-0.43 directory and execute the sh demo-arm-softfloat.sh

The author of the original article said that this would be a success, but the Ubuntu colleagues found that the program was downloaded for several hours and after being edited for more than ten minutes, the following error suddenly occurred:
In file already ded from version. c: 33:
/Home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/build-glibc/csu/version-info.h: 2: 1: missing terminating "character
/Home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/build-glibc/csu/version-info.h: 3: 1: missing terminating "character
Make [2]: *** [/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/build-glibc/csu/version. o] Error 1
Make [2]: Leaving directory '/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/csu'
Make [1]: *** [csu/subdir_lib] Error 2
Make [1]: Leaving directory '/home/skorpio/crosstool-0.43/build/powerpc-405-linux-gnu/gcc-4.1.0-glibc-2.3.6/glibc-2.3.6'
Make: *** [lib] Error 2

View version. h and you will find a conversion syntax error.
I thought it was the original author's negligence. I manually modified version. h and then re-compiled it. The result is still the same error. Check that version. h has returned to the status before my modification.
The file is automatically generated.
So why?
After searching for a large amount of information on the Internet, I found that it was originally a ghost of ubuntu.

In Ubuntu 6.10, the default system shell,/bin/sh, was changed to dash (the Debian almqualified Shell); previusly it had been bash (the GNU Bourne-Again Shell ). the same change will affect users of Ubuntu 6.06 LTS upgrading directly to Ubuntu 8.04 LTS. this document explains this change and what you shoshould do if you encounter problems.

The default login shell remains bash.

(From ubuntu wiki Co., https://wiki.ubuntu.com/DashAsBinSh)

You can execute
Echo $ SHELL
Or
Ls-la/bin/sh
If it is bash, there is no problem. If it is dash, correction is required.

To fix this issue, follow the instructions on the WIKI to modify the first line in the demo-arm-softfloat.sh
Set
#! /Bin/sh
Changed
#! /Bin/bash
After more than ten minutes of compilation, it still failed.

So I decided to use the method of profiteering:
Sudo mv/bin/sh. old
Sudo ln-sf bash/bin/sh

After a long wait, a new crosstool chains is generated. Modify the Makefile file for the U-BOOT and specify the cross tool.
Make distclean
Make smdk2410_config
Make all
Finally, the compilation is successful.

Related Article

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.