OK3568 4.19.206 Compatibility Method for 32-bit Applications

Document classification: □ Top secret □ Secret □ Internal information ■ Open

Revision History

Date

Version

Revision History

04/08/2022

V1.0

Initial Version

Compatibility Method for 32-bit Applications

The 3568 is a 64-bit processor, and the cross-compiler provided is also 64-bit. Therefore, if you intend to compile 32-bit applications, you must already have your own cross-compilation toolchains.

gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf

Taking cross-compilation tools as an example, this describes how to use a 32-bit cross-compiler to compile 32-bit applications for running on the 3568 platform.

The 3568 kernel, as shipped by default, already supports EL0, so no additional kernel configuration is required.

Currently, the only missing component is the 32-bit runtime library. Follow these steps to set it up:

Package the lib directory under the libc directory in the cross-compilation tool chain

	gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/libc

Manually create a /lib32 folder in the root directory of the development board.

cp ./* /lib32/ -rf					//Place the packaged library file in the development board root directory/lib32 as the runtime library.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib32 //Add an environment variable to add lib32 to the lookup path	
ln -s /lib32/ld-linux-armhf.so.3 /lib 						//Create a soft connection

Image

Use ld-linux- armhf. so. 3 –list as the ldd command to detect the library files required by test. It is found that all the library files exist. Execute the test executable file successfully.

Image

In the development environment, check that the test is 32-bit ELF

Image

Note: The glibc version used in the cross-compilation tool chain found by yourself must meet the glibc version required by the application, otherwise it cannot run normally.

Tip: You can also manually specify the location of libraries in/lib/ld-linux-armhf. So. 3 –library-path/lib32 –list/home/forlinx/test.