[arch-general] Link against system libs
Martin Kühne
mysatyre at gmail.com
Thu Apr 6 12:37:15 UTC 2017
On Thu, Apr 6, 2017 at 2:13 PM, Wolfgang Mader
<Wolfgang_Mader at brain-frog.de> wrote:
> Arch ships with a lot of libraries of which .a and .so are stored in /usr/lib
> and beyond. These libraries are compiled by some compiler, the compiler by
> which the entire arch linux distribution packages are compiled with. By the
> way, which one is this and where can I find that information.
>
> If this compiler is a c++ one, it does its specific name mangling. Thus,
> linking against these libs should only be possible for binaries compiled with
> the same c++ compiler. However, arch ships gcc6, gcc5, and clang. Does it also
> ship libraries for all these compilers or how is it possible for binaries
> complied by these different compilers to link successfully?
All of a program's interactions with the operating system as well as
the subordinate interactions between different units of code and data
are subject to the linker and loader. The file format as well as
interaction "platform" which Arch uses is called ELF. Both GCC and
LLVM produce valid ELF binaries as well as libraries which are
normally used with Linux. The kernel build configuration offers other
formats too, though. Essentially, you can have units produced by
different compilers and even on different machines, but then go run
them together without problems because organizing the different units
at the many different layers that accumulated here is better not left
up to the compiler itself, but rather this formal definition of how
things interact with each other.
cheers!
mar77i
More information about the arch-general
mailing list