What file is la in linux

WBOY
Release: 2022-05-09 16:15:35
Original
4071 people have browsed it

In Linux, la is a library file compiled using libtool. It is a text file that records information related to dynamic libraries and static libraries with the same name; this file is the only file saved between platforms through libtool. libtool is a general library support script that only deals with libtool files with suffixes of lo and la.

What file is la in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is la file in linux

la: The library file compiled using libtool is actually a text file that records information about dynamic libraries and static libraries with the same name

How libtool works

libtool is a universal library support script that hides the complexity of using dynamic libraries in a unified and portable interface; using libtool’s standard methods, it can be used on different platforms Create and call dynamic libraries. It can be considered that libtool is an abstraction of gcc, which wraps gcc (or other compilers). Users do not need to know the details. They only need to tell libtool which libraries need to be compiled, and libtool will handle the library dependencies and other details. libtool only deals with libtool files with suffixes of lo and la.

Extended knowledge:

What are the differences between so, o, lo, a, and la files under Linux?

  • o: Compiled target file

  • a: Static library, in fact, it is a package of several o files

  • so: Dynamic link library (shared library)

  • lo: The target file compiled using libtool actually adds some information to the o file

One of the main functions of libtool is to solve the library dependency problem in the process of compiling large software; it takes on the heavy maintenance work of library dependencies, thus freeing up programmers' human resources. . libtool provides a unified interface, hiding details such as differences in library names between different platforms, generating an abstract high-level library libxx.la with the suffix name la (actually a text file), and assigning the library's dependencies to other libraries. All are written in the file of the la. dependency_libs in this file records all the libraries that the library depends on (some of which are added in the form of .la files); libdir points out the installation location of the library; library_names records the name of the shared library; old_library records the name of the static library .

When the compilation process reaches the link stage, if there is the following command:

$libtool --mode=link gcc -o myprog -rpath /usr/lib –L/usr/lib –la
Copy after login

libtool will go to the /usr/lib path to find liba.la, and then read the actual shared library from it The name (recorded in library_names, such as liba.so) and path (recorded in lib_dir, such as libdir='/usr/lib'), return parameters such as /usr/lib/liba.so to the triggered gcc command line.

If liba.so depends on the library /usr/lib/libb.so, there will be dependency_libs='-L/usr/lib -lb' or dependency_libs='/usr/ in liba.la lib/libb.la' line, if it is the former, it will directly pass "-L/usr/lib -lb" as a parameter to the gcc command line; if it is the latter, libtool will pass it from /usr/lib/libb Read the actual library name and path of libb.so in .la, and then combine it into the parameter "/usr/lib/libb.so" and pass it to the gcc command line.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of What file is la in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template