Lazarus and Free Pascal on WSL2

From Lazarus wiki
Revision as of 06:20, 8 July 2019 by Skalogryz (talk | contribs) (Created page with "'''Can a linux FPC-generated 'hello world' be run unmodified on WSL-2 ?''' ;to be done: presume yes. FPC did install from a repository. '''Can the linux version of FPC be i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Can a linux FPC-generated 'hello world' be run unmodified on WSL-2 ?

to be done
presume yes. FPC did install from a repository.


Can the linux version of FPC be installed and run unmodified on WSL2 ?

In particular: the program and compiler issue direct kernel calls.
We need to know if this is working, or if a LIBC linked version of the Linux binaries is needed.
Yes
The easiest way is to install through the repository.
Direct Kernel calls work fine under WSL2.


Can a windows executable execute a WSL2 program, in particular, the compiler.

If yes, this must be demonstrated this using a Win32 FPC program.
If not, document what the problems are.
Yes
There's wslwrap (Win32 FPC program) application provided that's executing WSL2 program.


Can the Lazarus IDE execute the WSL2 linux compiler ?

Yes
The only tested approach is a quick substitute of the compiler executable, that runs WSL2 linux compiler.


Can a windows executable execute & debug a WSL2 program using WSL2 gdb ?

(This is assuming that a WSL2 version of gdb exists. If not, document this.).
In particular, can Lazarus use the WSL2 gdb if such exists.
Yes, possible with limitations
Gdb does present in WSL2 and needs to be installed additionally
While it's possible to run WSL2 gdb (and it's surely possible to configure Lazarus to install Gdb)
There are some possible issues with WSL2 pipe redirection, thus some glitches are possible. The official repository has a number of issues related to those problems.


Can the FPC windows 64-bit compiler cross-compile a -Tlinux program using WSL 2. If yes, how ?

to be done; Cross-compiler is not supposed to be using WSL2, it is supposed to be using WSL2. Is it possible to make "cross-compiler" that's using WSL2 linux FPC...

See Also