Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-08

Linux Binary without "dynamically linked"?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jalal

This is more of a FPC question, but I know FPC gurus visit here...

The file program on Debian shows my Linux command line binary like this:

ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped

Is it possible to have full static linking? If so, how do I get a binary with full static linking? Is there an option that can be used on the fpc command line?

I realize the benefits of dynamic linking, but there are some situations where static linking would make life simpler, particularly for deployment to machines I do not control.

Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080825/488c36f7/attachment.html

Reply by email

Jalal

Perhaps I wrote too soon. I see this option for fpc:

-Xt??????? link with static libraries (-static is passed to linker)

I will try that.

--- On Mon, 8/25/08, Jalal wrote:

Earlier message 19 lines
From: Jalal Subject: Linux Binary without "dynamically linked"? To: Date: Monday, August 25, 2008, 4:32 PM This is more of a FPC question, but I know FPC gurus visit here... The file program on Debian shows my Linux command line binary like this: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped Is it possible to have full static linking? If so, how do I get a binary with full static linking? Is there an option that can be used on the fpc command line? I realize the benefits of dynamic linking, but there are some situations where static linking would make life simpler, particularly for deployment to machines I do not control. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080825/d0505dc3/attachment.html

Reply by email

Aleš Katona
to Jalal: This is more of a FPC question, but I know FPC gurus visit here... The file program on…

D?a Po, 2008-08-25 o 13:32 -0700, Jalal nap?sal:

Show quoted text 19 lines
This is more of a FPC question, but I know FPC gurus visit here... The file program on Debian shows my Linux command line binary like this: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped Is it possible to have full static linking? If so, how do I get a binary with full static linking? Is there an option that can be used on the fpc command line? I realize the benefits of dynamic linking, but there are some situations where static linking would make life simpler, particularly for deployment to machines I do not control. Thanks! _

You must be using some unit which uses external C libraries. Try just a hello world program and see what you get then.

All units which link to external C libs (mysql, SDL etc.) will cause dynamic linking, but the RTL is staticly (smart even) linked so no need to worry about that.

Ales

Reply by email