Migration and configuration of uClibc Library Based on oSIP open-source database PartySIP server [2]

Source: Internet
Author: User

Migration and configuration of uClibc Library Based on oSIP open-source database PartySIP server [2]

 

I. Introduction to uClibc

UClibc is a small C standard library for Embedded Linux systems. Initially, uClibc was developed to support uClinux, a Linux version that does not require memory management units, so it is suitable for microcontroller systems. UClibc is much smaller than the gnu c Library (glibc), which is generally used in Linux distributions. glibc aims to support all the C standards of the largest range of hardware and kernel platforms, uClibc focuses on Embedded Linux. many functions can be selected based on space requirements. UClibc runs on standard and MMU-free Linux systems and supports i386, x86 64, ARM (big/little endian), AVR32, Blackfin, h8300, m68k, MIPS (big/little endian), PowerPC, SuperH (big/little endian), iSCSI, and v850 processors.

 

Ii. uClibc download and version Selection

This is because PartySIP requires at least a uClib-0.9.30.x version or later to be supported and is not supported below this version. This is because the getifaddrs library function is required in PartySIP, which is not supported by uClibc of earlier versions. This blog post focuses on the uClibc of earlier versions. To port uClibc, first comeHttp://www.uclibc.orgDownload the latest uClibc library from the website, as shown in:

You can directly download the latest version for use. However, it is recommended that you download the latest version for embedded system development. This is because the latest version may have some bugs, it is not tested yet, and earlier versions won't or will have fewer bugs, isn't it? ClickDowndloadClick the hyperlink to go To the download page, as shown below:

In this example, we select uclibc-0.9.32.1.tar.bz2 as the basic C library of the PartySIP system. Let's take a look at the following functions in the ppl directory in the open source code of PartySIP that will use getifaddrs, as shown below:

The selected code calls the getifaddrs function in the C library of uClibc. The path is as follows:

 

3: uClibc-0.9.32.1 configuration and compilation

To compile the uClibc-0.9.32.1, you must first configure the uClibc compilation environment and some configuration items that must be configured. You can enter the configuration interface configuration by running the make menuconfig command, as shown in:

After you press enter, you will see the following interface, select your target platform, and select the ARM platform here, as shown below:

Go to Target Architecture Features and Options for further configuration. My specific configuration is as follows:

Note that the target platform I selected is ARM926T. You need to configure it based on your specific platform and check whether your target platform supports FPU, if not[] Target CPU has a floating point unit (FPU)Cancel the operation. Otherwise, an ILL error occurs when FPU operations are used later, that is, an invalid command system error. You also need to set[*] Enable full C99 math library supportIt is very important to select it. GoGeneral Library SettingsConfigure as follows:

After you press enter, you can see the following configuration. We need to select pthread support. This is required. The configuration selected here is as follows:

Thread support (older (stable) version of linuxthreads)I chose a relatively conservative version here, that is, a relatively old stable thread version. GoNetworking supportTo configure the network support function. It is very important to select the following Configuration:

Only these two configurations can be selected to support the getifaddrs library function. My configuration for this part is as follows:

IPV6 is enabled because IPV6 is required for PartySIP. Next, you need to enable the following configuration in String and Stdio Support, as shown below:

Next, you need to open the following configuration in Big and Tall, as shown in the selected section:

Finally, configure the cross-compilation toolchain and configure it in uClibc Development and Debugging support, as shown below:

Of course, there is another configuration option to be configured, but this requires different configuration for different cross-compilation tools, which will not be described in detail here. As follows:

Here I will select the default configuration !! Finally, it is compilation and installation. The compilation command is: make. The installation command is: make install. You can also directly use: make; make install to compile and install it, as shown below:

If your cross-compilation tool is too old and too low, you need to modify the uClibc code and add a macro definition, as shown below:

# Define _ user

The specific path is as follows:

Is the selected features. h file. The specific modifications are as follows:

Here, we will explain in detail how to configure and compile uClibc, as well as how to modify some methods of the Cross-compilation tool for earlier versions.

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.