Recent

Author Topic: Statically add dependencies into binary  (Read 2257 times)

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Statically add dependencies into binary
« on: May 12, 2023, 02:29:21 pm »
Hello.

How to add static libraries to use it as dependencies?

For example, a simple fpc test app using X11 has that dependencies:

Code: Bash  [Select][+][-]
  1. ~> ldd testX11
  2.         linux-vdso.so.1 (0x00007ffc275f0000)
  3.         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fad6c866000)
  4.         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fad6c600000)
  5.         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fad6c861000)
  6.         libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fad6c4c2000)
  7.         librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fad6c85c000)
  8.         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fad6c3d9000)
  9.         /lib64/ld-linux-x86-64.so.2 (0x00007fad6c88e000)
  10.         libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fad6c830000)
  11.         libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fad6c82a000)
  12.         libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fad6c822000)
  13.         libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fad6c80d000)
  14.         libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fad6c3cc000)
  15.  

What fpc parameter should be used to add those library static into the binary and to force to use it?

( Yes I know it is not regular, but for the fun and for exploration.   :-X)

Thanks.

Fre;D
« Last Edit: May 12, 2023, 03:44:10 pm by Fred vS »
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

Fred vS

  • Hero Member
  • *****
  • Posts: 3168
    • StrumPract is the musicians best friend
Re: Statically add dependencies into binary
« Reply #1 on: May 12, 2023, 03:43:27 pm »
No, it is stupid.
Sorry for the noise.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018