Recent

Author Topic: What is the difference between fpc and ppcx64 ?  (Read 1468 times)

lazer

  • Full Member
  • ***
  • Posts: 215
What is the difference between fpc and ppcx64 ?
« on: October 20, 2022, 03:25:30 pm »
Hi,

I just did a build of fresh pull of FPC main  using my distro's fpc.

Code: Pascal  [Select][+][-]
  1. export FPCVER="3.3.1"
  2. make all
  3. make install INSTALL_PREFIX=/usr
  4.  
  5. ls -ail /usr/lib/fpc/3.3.1
  6. total 4668
  7. 1462708 drwxr-xr-x. 5 root root    4096 Oct 20 15:08 .
  8. 1442640 drwxr-xr-x. 6 root root    4096 Oct 20 15:08 ..
  9. 1732256 drwxr-xr-x. 3 root root    4096 Oct 20 15:08 fpmkinst
  10. 1462711 drwxr-xr-x. 2 root root    4096 Oct 20 15:08 msg
  11. 1462709 -rwxr-xr-x. 1 root root 4747696 Oct 20 15:08 ppcx64
  12. 1462710 -rwxr-xr-x. 1 root root    3446 Oct 20 15:08 samplecfg
  13. 1462760 drwxr-xr-x. 3 root root    4096 Oct 20 15:08 units
  14.  
  15. ls -ail `which fpc` `which ppcx64`
  16. 1451555 -rwxr-xr-x. 1 root root 547472 Oct 20 15:08 /bin/fpc
  17. 1456515 lrwxrwxrwx. 1 root root     25 Sep 21  2021 /bin/ppcx64 -> ../lib64/fpc/3.2.2/ppcx64
  18.  
  19.  

We see this installed as requested in /usr/lib  but also created /bin/fpc which is an executable, not a link and has a different size.

What is the difference between fpc and ppcx64 and why does install two different compilers?

TIA

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: What is the difference between fpc and ppcx64 ?
« Reply #1 on: October 20, 2022, 03:30:02 pm »
fpc is a frontend binary that calls architecture dependent backends. The x86_64 backend is called ppcx64, the 32-bit x86 ppc386 etc.

The lib vs lib64 is a afaik distribution dependent thing. Some always reserve "lib" for the "main architecture" and name the secondary one lib32 or lib64, some always have lib (for 32-bit) and lib64 for 64-bit.  Moreover as 32-bit is phased out distributions might change scheme, since nothing in the Linux world is really nailed down.

To work around, you can tell  "make install" what to use as prefix by passing INSTALL_PREFIX= e.g.

Code: Pascal  [Select][+][-]
  1.  make install INSTALL_PREFIX=/usr/lib64

lazer

  • Full Member
  • ***
  • Posts: 215
Re: What is the difference between fpc and ppcx64 ?
« Reply #2 on: October 20, 2022, 03:41:45 pm »
Thanks but won't that end up in /usr/lib64/lib/  ? That's the prefix, not the install dir.

Thanks for the explanation. Why is this "front-end" bigger than the actual compiler ? :?


marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: What is the difference between fpc and ppcx64 ?
« Reply #3 on: October 20, 2022, 03:48:02 pm »
Thanks but won't that end up in /usr/lib64/lib/  ? That's the prefix, not the install dir.

Correct.   It should be INSTALL_LIBDIR it seems.

Quote
Thanks for the explanation. Why is this "front-end" bigger than the actual compiler ? :?

ppcx64 is 4.7 MB, fpc is 0.547 so nearly ten times smaller. Did you miss a digit ?

lazer

  • Full Member
  • ***
  • Posts: 215
Re: What is the difference between fpc and ppcx64 ?
« Reply #4 on: October 20, 2022, 04:08:08 pm »
OK we'll call that a draw on the silly mistakes !  :D

Thanks for the explanations.
« Last Edit: October 21, 2022, 10:01:12 am by lazer »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: What is the difference between fpc and ppcx64 ?
« Reply #5 on: October 20, 2022, 10:30:41 pm »
OK we'll call that a draw on the silly mistakes !  :D

Thanks for the explanations.

I'm not sure of the developers' position on this, but my experience is that the fpc wrapper is backward-compatible (i.e. works reliably with versions of ppc* significantly older than itself) and that it's fairly happy if ppcx64 etc. is symlinked to e.g. ppcx64-3.2.2 which is itself symlinked to /usr/local/lib/fpc/3.2.2/ppcx64. This is also compatible with the fpc -V option, although whether that works reliably is patchy.

Apart from fpc, fp and fpcres all the binaries that would normally have gone into /usr/local/bin are actually in e.g. /usr/local/bin/fpc.d/3.2.2

Both the above are with the caveat that I adopted that convention a significant number of years ago, and more recent "official" alternatives might be more reliable.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: What is the difference between fpc and ppcx64 ?
« Reply #6 on: October 20, 2022, 10:45:03 pm »
OK we'll call that a draw on the silly mistakes !  :D

Thanks for the explanations.

I'm not sure of the developers' position on this, but my experience is that the fpc wrapper is backward-compatible (i.e. works reliably with versions of ppc* significantly older than itself) and that it's fairly happy if ppcx64 etc. is symlinked to e.g. ppcx64-3.2.2 which is itself symlinked to /usr/local/lib/fpc/3.2.2/ppcx64. This is also compatible with the fpc -V option, although whether that works reliably is patchy.

No guarantee on it, but using an older "fpc" binary isn't the riskiest thing to do.  I've used -V myself for years, and never found much problems with it (it simply appends the argument to the formed (-P) binary name )
 
Quote
Apart from fpc, fp and fpcres all the binaries that would normally have gone into /usr/local/bin are actually in e.g. /usr/local/bin/fpc.d/3.2.2

Both the above are with the caveat that I adopted that convention a significant number of years ago, and more recent "official" alternatives might be more reliable.

fp contains the ppc* compiler so that policy is on shaky grounds philosophically.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: What is the difference between fpc and ppcx64 ?
« Reply #7 on: October 21, 2022, 08:59:06 am »
No guarantee on it, but using an older "fpc" binary isn't the riskiest thing to do.  I've used -V myself for years, and never found much problems with it (it simply appends the argument to the formed (-P) binary name )

In practice I copy over the newest, hence my comment about it being backward compatible.
 
Quote
fp contains the ppc* compiler so that policy is on shaky grounds philosophically.

Thanks, I hadn't spotted that. In practical terms I tend not to use it.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: What is the difference between fpc and ppcx64 ?
« Reply #8 on: October 21, 2022, 09:55:35 am »
Also fpcres might be safer on the longer term, but currently still mutates heavily and might contain bugfixes important to lazarus.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: What is the difference between fpc and ppcx64 ?
« Reply #9 on: October 21, 2022, 09:59:46 am »
Also fpcres might be safer on the longer term, but currently still mutates heavily and might contain bugfixes important to lazarus.

Yes, and as I said that's one of the few binaries I copy over.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

 

TinyPortal © 2005-2018