Salutations...
IMHO (please correct me if I'm wrong) from what I understand it seems that when linking...
... dynamically a dependency that requires a library (eg. musl/glibc) the result is... efficient (saves memory).
... statically anything else the result is... faster (improves performance).
"Best Regards"...
Posted by 73.150.85.78 via http://webwarper.net
This is added while posting a message to avoid misusing the service
Compiling (static vs dynamic linking)...
Compiling (static vs dynamic linking)...
Last edited by fullmoonremix on 29 May 2016, 10:16, edited 1 time in total.
- ncmprhnsbl
- DEV Team
- Posts: 3938
- Joined: 20 Mar 2012, 03:42
- Distribution: v5.0-64bit
- Location: australia
- Contact:
Re: Compiling (static vs dynamic linking)...
pretty much
just to expand a little:
just to expand a little:
examples: blender from blender.org or an .AppImage or something from portable apps or more loosely a porteus module containing needed libs/depsStatic linking is the result of the linker copying all library routines used in the program
into the executable image. This may require more disk space and memory than dynamic
linking, but is both faster and more portable, since it does not require the presence of
the library on the system where it is run.
examples: packages from distro reposDynamic linking is accomplished by placing the name of a sharable library in the executable
image. Actual linking with the library routines does not occur until the image is run, when
both the executable and the library are placed in memory. An advantage of dynamic linking
is that multiple programs can share a single copy of the library.
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44
Re: Compiling (static vs dynamic linking)...
Application A depends on Library X, Y and Z
Assume there are some security fixes in Library X
Under static linking, user needs to recompile, rebuild, remake Application A to have updated fixes
Under dynamic linking,
user only needs to recompile, rebuild, remake Library X and any application that depends on Library X will have fixes updated
Assume there are some security fixes in Library X
Under static linking, user needs to recompile, rebuild, remake Application A to have updated fixes
Under dynamic linking,
user only needs to recompile, rebuild, remake Library X and any application that depends on Library X will have fixes updated