OK, here's a very quick experiment. It's not comprehensive, and you'll need to read around a bit... sorry, but I don't have much time.
I've got a "phablet" here which (I find) already has Termux installed, I did this a couple of years ago but forget the detail.
If I login locally (i.e. Termux's own "console" shell session on the Android screen) and run this
$ whoami
u0_a86
$sshd
$ netstat -an | grep 22
tcp 0 0 0.0.0.0:8022 0.0.0.0:* LISTEN
Note the unix convention that a leading $ indicates the prompt. i.e. you don't type that.
That's showing you that the user Android/Termux has set up is called u0_a86, that you can start the ssh daemon (server) and that SSH is listening on port 8022 (I can't remember how I set that up, the standard one is 22).
If you now do this
$ netstat -an | grep :8022
tcp 0 0 0.0.0.0:8022 0.0.0.0:* LISTEN
tcp 0 0 172.27.16.176:8022 172.27.16.1:33104 ESTABLISHED
tcp6 0 0 :::8022 :::* LISTEN
you can see that it's listening on the dotted quad 172.27.16.176.
Finally, use passwd to give that user a password.
Now go to a PC, I'm using Linux. There's two things you can do:
~$ ssh -p 8022 u0_a86@172.27.16.176
u0_a86@172.27.16.176's password:
X11 forwarding request failed on channel 0
Welcome to Termux!
...
$ ls
pstalk-x86_64-linux-gtk2
$ rm pstalk-x86_64-linux-gtk2
$ exit
Let me explain what you're seeing. You've got a $ prompt on the PC, you're running ssh to connect to the Android device, you're getting various login screed from Termux on the Android device and then a prompt. At the prompt you're running ls to list the files stored in that user's home directory, you see one and remove it, and then you exit the shell session.
Back on the PC, switch to a directory with a compiled program in it. Then use the sftp command to copy that program to the Android device, then quit the transfer session.
~$ sftp -P 8022 u0_a86@172.27.16.176
u0_a86@172.27.16.176's password:
Connected to u0_a86@172.27.16.176.
sftp> put pstalk-x86_64-linux-gtk2
Uploading pstalk-x86_64-linux-gtk2 to /data/data/com.termux/files/home/pstalk-x86_64-linux-gtk2
pstalk-x86_64-linux-gtk2 100% 24MB 4.8MB/s 00:05
sftp> quit
~$ ssh -p 8022 u0_a86@172.27.16.176
u0_a86@172.27.16.176's password:
X11 forwarding request failed on channel 0
Welcome to Termux!
...
$ ls -l
total 24628
-rwx------ 1 u0_a86 u0_a86 25216312 Nov 20 19:10 pstalk-x86_64-linux-gtk2
$ exit
logout
Connection to 172.27.16.176 closed.
Note a couple of things. Despite being related, the ssh and sftp clients use a different option letter to specify the port: on unix case is significant. If you're using e.g. putty or Teraterm as a client things will be different: read the docs.
Once logged in, you use exit to leave a shell session and quit to leave a transfer session (exit might also work here, depending on variant).
That's all very fast I'm afraid, but is hopefully a taste that stuff /does/ work.
As I've said elsewhere, I've had FPC running under Termux /but/ some of the libraries are packaged differently which gave problems.
(Later:)
When I previously had FPC on a tablet it was x86_64 (amd64) rather than ARM. There's a whole lot of detail I can't remember, I might have needed to do a special build to work round some path issues.
On the phablet I've currently got I can see
$ cat /proc/cpuinfo
Processor : AArch64 Processor rev 2 (aarch64)
processor : 0
BogoMIPS : 26.00
Features : fp asimd aes pmull sha1 sha2 crc32
CPU implementer : 0x41
CPU architecture: AArch64
CPU variant : 0x0
CPU part : 0xd03
CPU revision : 2
Hardware : MT6795
I've quite simply not got the time to do much more but I'm fairly confident that a cross-compiled file could be moved between systems... in any event there's people here with far more experience than I.
The one thing I would warn about is that on Linux, library symlinks are- AIUI- fully resolved at linkage time. The implication of this is that if the development libraries differ substantially from the target system there's a risk of problems: from memory the one that brought me up short in the past was libpthreads (?) which is handled in an arguably non-standard fashion on Android.
MarkMLl