Installation and Verification of x210 Cross-compilation Tool Chain

Keywords: PHP Linux sudo Linker

I am using the board of s5pv210 directly here. According to the method of Mr. Zhu's lecture, install the cross-compilation tool chain according to the installation package provided by the government (also installed with source code, this is a high quality, temporarily press the table)

arm-2009q3.tar.bz2
Put this installation package mv in the new arm directory under / usr/local / directory
tar -jxvf /usr/local/arm/
After unzipping, a new directory arm-2009q3 will be generated in the current directory
Inside the bin directory, ls sees all the tools in the cross-compile chain as follows
arm-none-linux-gnueabi-addr2line #Call stack information for locator crash during debugging
arm-none-linux-gnueabi-gprof #Very useful debugging tool
arm-none-linux-gnueabi-ar #Tools for generating static libraries
arm-none-linux-gnueabi-ld #linker
arm-none-linux-gnueabi-objdump #Disassembly
arm-none-linux-gnueabi-cpp #C Preprocessor
arm-none-linux-gnueabi-gdb #Very useful debugging tool
arm-none-linux-gnueabi-as #What is this?
arm-none-linux-gnueabi-nm #Symbol Viewing
arm-none-linux-gnueabi-objcopy #objcopy is used to copy the contents of one target file to another file.
The destination file can be output in a format different from the source file, that is, format conversion (.elf to.bin)
arm-none-linux-gnueabi-c++ #What is this C++?
arm-none-linux-gnueabi-c++filt
arm-none-linux-gnueabi-ranlib
arm-none-linux-gnueabi-g++
arm-none-linux-gnueabi-readelf
arm-none-linux-gnueabi-gcc
arm-none-linux-gnueabi-size
arm-none-linux-gnueabi-gcc-4.4.1
arm-none-linux-gnueabi-sprite
arm-none-linux-gnueabi-gcov
arm-none-linux-gnueabi-strings
arm-none-linux-gnueabi-strip
arm-none-linux-gnueabi-gdbtui

How do I verify that the installation was successful?
./arm-none-linux-gnueabi-gcc -v
Found a stack of printed messages, and finally
gcc version 4.4.1 (Sourcery G++ Lite 2009q3-67) This means we have successfully installed

Then let's add this directory to the system's environment variables
vi ~/.bashrc
Then add at the end
export PATH=$PATH:/usr/local/arm/arm-2009q3/bin
Note that this will only work if you exit the current console and enter again
Then create symbolic links for these tools
There is a script, just copy it directly to / usr/local/arm/arm-2009q3/bin
=========================================================
In fact, the above steps can be accomplished with a script. In order to save some time in setting up the environment in the future, I have written a one-click installation script envsetup.sh here.
#!/bin/bash

function create_link(){
    echo "creating soft link ..."
    sudo ln arm-none-linux-gnueabi-addr2line -s arm-linux-addr2line
    sudo ln arm-none-linux-gnueabi-ar -s arm-linux-ar
    sudo ln arm-none-linux-gnueabi-as -s arm-linux-as
    sudo ln arm-none-linux-gnueabi-c++ -s arm-linux-c++
    sudo ln arm-none-linux-gnueabi-c++filt -s arm-linux-c++filt
    sudo ln arm-none-linux-gnueabi-cpp -s arm-linux-cpp
    sudo ln arm-none-linux-gnueabi-g++ -s arm-linux-g++
    sudo ln arm-none-linux-gnueabi-gcc -s arm-linux-gcc
    sudo ln arm-none-linux-gnueabi-gcc-4.4.1 -s arm-linux-gcc-4.4.1
    sudo ln arm-none-linux-gnueabi-gcov -s arm-linux-gcov
    sudo ln arm-none-linux-gnueabi-gdb -s arm-linux-gdb
    sudo ln arm-none-linux-gnueabi-gdbtui -s arm-linux-gdbtui
    sudo ln arm-none-linux-gnueabi-gprof -s arm-linux-gprof
    sudo ln arm-none-linux-gnueabi-ld -s arm-linux-ld
    sudo ln arm-none-linux-gnueabi-nm -s arm-linux-nm
    sudo ln arm-none-linux-gnueabi-objcopy -s arm-linux-objcopy
    sudo ln arm-none-linux-gnueabi-objdump -s arm-linux-objdump
    sudo ln arm-none-linux-gnueabi-ranlib -s arm-linux-ranlib
    sudo ln arm-none-linux-gnueabi-readelf -s arm-linux-readelf
    sudo ln arm-none-linux-gnueabi-size -s arm-linux-size
    sudo ln arm-none-linux-gnueabi-sprite -s arm-linux-sprite
    sudo ln arm-none-linux-gnueabi-strings -s arm-linux-strings
    sudo ln arm-none-linux-gnueabi-strip -s arm-linux-strip
}

DIR=$(pwd)
echo "--------------------------------------"
echo "Before install make sure one thing that:"
echo "your PC is x86 arch based machine and"
echo "you want programs running on arm arch"
echo "--------------------------------------"

# judge whether the tool chain exists
if [ ! -e arm-2009q3.tar.bz2 ]; then
    echo "arm-2009q3.tar.bz2 not found"
    return 1
fi
# mv to a default path
if [ -e /usr/local/arm ]; then
    sudo cp arm-2009q3.tar.bz2 /usr/local/arm/arm-2009q3.tar.bz2
else
    echo "mkdir /usr/local/arm"
    sudo mkdir /usr/local/arm
    sudo cp arm-2009q3.tar.bz2 /usr/local/arm/arm-2009q3.tar.bz2
fi
# unzip the arm-20093.tar.bz2
cd  /usr/local/arm
if [ ! -e arm-2009q3 ]; then
    echo "unzip the arm-20093.tar.bz2"
    sudo tar -jxf arm-2009q3.tar.bz2
fi
# new short name for these tools
cd  /usr/local/arm/arm-2009q3/bin
create_link
echo "validating ..."
./arm-linux-gcc -v | grep "gcc version 4.4.1"
if [ $? -eq 0 ]; then
    echo "validation ok!"    
else
    echo "validation failed"
    # get back
    cd $DIR
    unset DIR
    return 1
fi

# add path to sys env
sed -i '$a export PATH=$PATH:/usr/local/arm/arm-2009q3/bin' ~/.bashrc
if [ $? -eq 0 ]; then
    echo "export to sys env ok!"
else 
    echo "export to sys env failed"
fi
# get back
cd $DIR
unset DIR
echo "arm-linux compile chain env set done!"

Place the package in the same directory as the script when you use it and execute. envsetup.sh

 

 

 

 
 
 
 

Posted by ludjer on Fri, 02 Aug 2019 11:56:27 -0700