Does FPC require glibc?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Does FPC require glibc?

Free Pascal - General mailing list
Empty Message

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Does FPC require glibc?

Free Pascal - General mailing list
Nozz via fpc-pascal <[hidden email]> schrieb am Mo., 6. Mai 2019, 22:18:
Empty Message

Depends on what you're using (and the platform). E.g. the compiler itself runs without glibc on Linux, but if you need to use threads for example that changes. Also if you link against libraries like GTK or Qt you also indirectly link to glibc and the RTL's initialization code will change due to this. 
On some targets (e.g. macOS) using the C library is a must. 

Regards, 
Sven

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Does FPC require glibc?

Free Pascal - General mailing list
On Monday, May 6, 2019 10:48 PM, Sven Barth <[hidden email]> wrote:

Nozz via fpc-pascal <[hidden email]> schrieb am Mo., 6. Mai 2019, 22:18:
Empty Message

Depends on what you're using (and the platform). E.g. the compiler itself runs without glibc on Linux, but if you need to use threads for example that changes. Also if you link against libraries like GTK or Qt you also indirectly link to glibc and the RTL's initialization code will change due to this. 
On some targets (e.g. macOS) using the C library is a must. 

Regards, 
Sven

Thanks, if I want to compile a program for Alpine Linux (musl libc instead of glibc) , is my best option to compile FPC&Lazarus from source?
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Does FPC require glibc?

Free Pascal - General mailing list
Am 07.05.2019 um 00:16 schrieb Nozz via fpc-pascal:
On Monday, May 6, 2019 10:48 PM, Sven Barth [hidden email] wrote:

Nozz via fpc-pascal <[hidden email]> schrieb am Mo., 6. Mai 2019, 22:18:
Empty Message

Depends on what you're using (and the platform). E.g. the compiler itself runs without glibc on Linux, but if you need to use threads for example that changes. Also if you link against libraries like GTK or Qt you also indirectly link to glibc and the RTL's initialization code will change due to this. 
On some targets (e.g. macOS) using the C library is a must. 

Regards, 
Sven

Thanks, if I want to compile a program for Alpine Linux (musl libc instead of glibc) , is my best option to compile FPC&Lazarus from source?
As a first step you could simply test whether the existing binaries work, cause the C library is entered as "libc.so.6" into the ELF file. If it doesn't start and complains about a missing library then you should recompile both from source.

Regards,
Sven

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Does FPC require glibc?

Michael Van Canneyt
In reply to this post by Free Pascal - General mailing list


On Mon, 6 May 2019, Nozz via fpc-pascal wrote:

> On Monday, May 6, 2019 10:48 PM, Sven Barth <[hidden email]> wrote:
>
>> Nozz via fpc-pascal <[hidden email]> schrieb am Mo., 6. Mai 2019, 22:18:
>>
>>> Empty Message
>>
>> Depends on what you're using (and the platform). E.g. the compiler itself runs without glibc on Linux, but if you need to use threads for example that changes. Also if you link against libraries like GTK or Qt you also indirectly link to glibc and the RTL's initialization code will change due to this.
>> On some targets (e.g. macOS) using the C library is a must.
>>
>> Regards,
>> Sven
>
> Thanks, if I want to compile a program for Alpine Linux (musl libc instead of glibc) , is my best option to compile FPC&Lazarus from source?

That should not be necessary.

The programs that need the C library use the system installed C library.
If this is libc instead of glibc, then that will be used, there is no
explicit reference to gnu libc.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Does FPC require glibc?

Free Pascal - General mailing list
Michael Van Canneyt <[hidden email]> schrieb am Di., 7. Mai 2019, 08:32:


On Mon, 6 May 2019, Nozz via fpc-pascal wrote:

> On Monday, May 6, 2019 10:48 PM, Sven Barth <[hidden email]> wrote:
>
>> Nozz via fpc-pascal <[hidden email]> schrieb am Mo., 6. Mai 2019, 22:18:
>>
>>> Empty Message
>>
>> Depends on what you're using (and the platform). E.g. the compiler itself runs without glibc on Linux, but if you need to use threads for example that changes. Also if you link against libraries like GTK or Qt you also indirectly link to glibc and the RTL's initialization code will change due to this.
>> On some targets (e.g. macOS) using the C library is a must.
>>
>> Regards,
>> Sven
>
> Thanks, if I want to compile a program for Alpine Linux (musl libc instead of glibc) , is my best option to compile FPC&Lazarus from source?

That should not be necessary.

The programs that need the C library use the system installed C library.
If this is libc instead of glibc, then that will be used, there is no
explicit reference to gnu libc.

It depends whether the musl libc also leads to the inclusion of "libc.so.6" in the ELF files. If yes, then all should be good (except if not all calls are available, but then recompilation wouldn't help either), if not everything needs to be rebuild so that the correct C library is entered in the ELF. 

Regards, 
Sven 

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Does FPC require glibc?

Marco van de Voort-3

Op 5/7/2019 om 11:14 AM schreef Sven Barth via fpc-pascal:
> It depends whether the musl libc also leads to the inclusion of
> "libc.so.6" in the ELF files. If yes, then all should be good (except
> if not all calls are available, but then recompilation wouldn't help
> either), if not everything needs to be rebuild so that the correct C
> library is entered in the ELF.
The symbols used in the startup code and threadvar errno are other
things that come to mind as possible problems.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal