Sign in Join

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

Mailing lists / fpc-devel / 2014-11

FPC for Linux x64 compiling static ELF without using glibc ?

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Jy V

There is a question in the mailing list of OSv about providing support for statically linked ELF (compiled by the GO programming language), the guy is asking :
------------------------------------
Do you know any other language or runtime besides Go that compiles static executables (i.e., does not use glibc)?
------------------------------------

Anyone could tell me if FPC is generating some statically linked ELF executable (similar to Go) ?
If this is the case, I will post on the OSv list the answer in order to enforce future support of FPC for OSv.

Reply by email

Jonas Maebe
to Jy V
Jy V wrote 12 lines
There is a question in the mailing list of OSv about providing support for statically linked ELF (compiled by the GO programming language), the guy is asking : ------------------------------------ Do you know any other language or runtime besides Go that compiles static executables (i.e., does not use glibc)? ------------------------------------ Anyone could tell me if FPC is generating some statically linked ELF executable (similar to Go) ?

I don't know what statically linked ELF executables 'similar to Go' are, but yes, FPC by default also generates statically linked binaries on Linux.

Jonas

Reply by email

Jy V
to Jonas Maebe
Jonas Maebe wrote
I don't know what statically linked ELF executables 'similar to Go' are, but yes, FPC by default also generates statically linked binaries on Linux.

Thank you Jonas, I will forward the answer.

Reply by email

Sven Barth
to Jy V
"Jy V" wrote
On Thu, Nov 20, 2014 at 1:37 PM, Jonas Maebe
> > > I don't know what statically linked ELF executables 'similar to Go' are,

but yes, FPC by default also generates statically linked binaries on Linux.

Thank you Jonas, I will forward the answer.

One can however recompile the RTL to use the C library (though as Jonas said that is not the default). Please also note that adding additional units might result in the C library being linked in nevertheless (e.g. cmem, pthreads, etc.).

Regards,
Sven

Reply by email

Jonas Maebe
to Sven Barth
Sven Barth wrote 5 lines
One can however recompile the RTL to use the C library (though as Jonas said that is not the default). Please also note that adding additional units might result in the C library being linked in nevertheless (e.g. cmem, pthreads, etc.).

Even if you use the C library, in principle you can link statically. This is not very often tested with FPC though, and by default it indeed links dynamically to libc.

Jonas

Reply by email

Jy V
to Jonas Maebe

Jonas, Sven,

Thank you for the intel,
is there anyone willing to collect a 500 euros bounty to provide a HelloWorld console program compiled with Lazarus to run on OSv ?

Jyv.

Jonas Maebe wrote 20 lines
On 20 Nov 2014, at 14:19, Sven Barth wrote: One can however recompile the RTL to use the C library (though as Jonas > said that is not the default). Please also note that adding additional > units might result in the C library being linked in nevertheless (e.g. > cmem, pthreads, etc.). > Even if you use the C library, in principle you can link statically. This is not very often tested with FPC though, and by default it indeed links dynamically to libc. Jonas _______________________________________________ fpc-devel maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply by email