Recent

Author Topic: fpcupdeluxe and the Pico  (Read 12432 times)

dbannon

  • Hero Member
  • *****
  • Posts: 3294
    • tomboy-ng, a rewrite of the classic Tomboy
Re: fpcupdeluxe and the Pico
« Reply #30 on: March 08, 2024, 11:19:33 am »
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1793
Re: fpcupdeluxe and the Pico
« Reply #31 on: March 08, 2024, 11:27:24 am »
This wiki entry is good, but the whole (complex) process of setting up a Pico-environment is not for the faint-hearted.
The pico-button of fpcupdeluxe should take care of all of these implementation details. I hope it still does.

MiR

  • Sr. Member
  • ****
  • Posts: 275
Re: fpcupdeluxe and the Pico
« Reply #32 on: March 08, 2024, 11:30:28 am »
Instead of this:

cp rtl/embedded/arm/* "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/rtl/.
   
better do that:

mkdir -p "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/rtl/.
cp rtl/embedded/arm/* "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/rtl/.

this is compatible with what fpcupdeluxe does, and more important, it allows you to use different subarchs, I for example work with armv6m, armv7m at the same time... (And that is the reason why it is done that way in fpcupdeluxe)


And fully agree to DonAlfredo, it is not for the fait at heart and people should not later complain to him (or to me) when things do not work with fpcupdeluxe, different archs and my pico fpc code....
Michael
« Last Edit: March 08, 2024, 11:32:44 am by MiR »

MiR

  • Sr. Member
  • ****
  • Posts: 275
Re: fpcupdeluxe and the Pico
« Reply #33 on: March 08, 2024, 11:33:33 am »
..and you should also put system.ppu to "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/

and you also need to add those paths to fpc.cfg...

Lots of things to do instead of the press of one button....

dbannon

  • Hero Member
  • *****
  • Posts: 3294
    • tomboy-ng, a rewrite of the classic Tomboy
Re: fpcupdeluxe and the Pico
« Reply #34 on: March 08, 2024, 12:54:08 pm »
....
mkdir -p "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/rtl/.
cp rtl/embedded/arm/* "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/rtl/.
Trouble is that at that stage, the fpc makefile has already put  "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/rtl/ there and populated it with some files. So we would end up with both -
  • "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/rtl/files
  • "$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/rtl/files

I could move the makefile ones but if a previous install has already put another architecture there, thats not going to work ! I think what you say makes a lot of sense but if it involves altering the makefile, thats a whole new ball game. Similarly, unless the compiler thinks to look in units/$CPU-$OS/$SUBARCH/$ABI/rtl its going to need alteration to the fpc.cfg file. It might do, it does try hard to find the right files. I'll run some tests.

But I also note that the "make crossinstall" is given both the ABI and the SUBARCH but chooses not to use them when installing the first batch of files.

Quote
And fully agree to DonAlfredo, it is not for the fait at heart and people should not later complain to him (or to me) when things do not work with fpcupdeluxe, different archs and my pico fpc code....
Yep, I agree too. Absolutely. But I also think its important that how it actually works is documented somewhere too. And DonAlfredo does a lot of work on fpcupdeluxe, I'd rather not add to his burden.

Davo

Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1793
Re: fpcupdeluxe and the Pico
« Reply #35 on: March 08, 2024, 01:07:45 pm »
Quote
But I also think its important that how it actually works is documented somewhere too.
That would be good. Documentation is available, but these details (regarding subarch) are not.
You might take a look at the Makefile commands that are visible when building the cross-compiler. Also, the fpcupdeluxe sources will show some.
A very important setting is : INSTALL_UNITDIR. This is how the magic of separating subarchs and ABI's is handled. Again, its not easy. But needed for correct handling of different setups.

MiR

  • Sr. Member
  • ****
  • Posts: 275
Re: fpcupdeluxe and the Pico
« Reply #36 on: March 08, 2024, 01:35:57 pm »
I guess the best is that before publishing the page you check that all files of your build are in the same subdirectories as they are in a build by fpcupdeluxe. (And that your fpc.cfg contains the same settings for the relevant entries)
Then the risk of breaking anything is close to zero.

If you have questions feel free to ask, it has been ages since I last did a fpc build outside of fpcupdeluxe but memory will very likely come back as I did manual builds for years before finally DonAlfredo was kind enough to lift this burden off my shoulders......

TRon

  • Hero Member
  • *****
  • Posts: 4148
Re: fpcupdeluxe and the Pico
« Reply #37 on: March 08, 2024, 08:54:26 pm »
Pressing the Pico button does:
So, you can execute these steps by yourselves, with the working Lazarus hash as first step.
Yes, I was aware of this but apparently dbannon did not.

His 'confusion' (?) seem to originate from the fact that once in a while trunk compiler and trunk Lazarus do not play nice with each other.

For me personally I'll just shrug when that happens and try again later. Though FPCUpDeluxe is perfectly capable of building either using their respective hash-codes so that you can select a particular moment in trunk/main for the build(s).

The trick is finding a combination that works and besides that as mentioned before, when a new compiler release arrives, this discussion is more or less moot as support for the pico is then available (currently pico is only supported in trunk).

That said, it is always a good idea to know how something can be build and describe the process so thank you very much for your entries in the wiki dbannon
Today is tomorrow's yesterday.

Thaddy

  • Hero Member
  • *****
  • Posts: 16653
  • Kallstadt seems a good place to evict Trump to.
Re: fpcupdeluxe and the Pico
« Reply #38 on: March 08, 2024, 09:14:22 pm »
which happened recently to the effect that multiple people were trying to resolve that asap.
and they fixed it. there is a risk in using trunk! it is not a release. Do not use trunk versions if you do not know what you are doing. Use stable or maybe fixes.
But I am sure they don't want the Trumps back...

TRon

  • Hero Member
  • *****
  • Posts: 4148
Re: fpcupdeluxe and the Pico
« Reply #39 on: March 08, 2024, 09:19:17 pm »
That would be good. Documentation is available, but these details (regarding subarch) are not.
You might take a look at the Makefile commands that are visible when building the cross-compiler. Also, the fpcupdeluxe sources will show some.
A very important setting is : INSTALL_UNITDIR. This is how the magic of separating subarchs and ABI's is handled. Again, its not easy. But needed for correct handling of different setups.
Also, in case you haven't already, take note of this
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3294
    • tomboy-ng, a rewrite of the classic Tomboy
Re: fpcupdeluxe and the Pico
« Reply #40 on: March 09, 2024, 12:28:05 am »
.....
Yes, I was aware of this but apparently dbannon did not.

His 'confusion' (?) seem to originate from the fact that once in a while trunk compiler and trunk Lazarus do not play nice with each other.

TRon, can I respectfully and in the name of friendship, ask you to stop telling everyone what I think ?
In the unlikely event that someone else is interested in whats happening inside my brain, they would be better informed by looking at my posts.
Thanks.

David
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4148
Re: fpcupdeluxe and the Pico
« Reply #41 on: March 09, 2024, 12:40:19 am »
Quote
His 'confusion' (?) seem to originate from the fact that once in a while trunk compiler and trunk Lazarus do not play nice with each other.
TRon, can I respectfully and in the name of friendship, ask you to stop telling everyone what I think ?
Yes, that is no problem at all.

It was by all means not meant to provide an insight to your thinking. That is why I enclosed the confusion part into quotes and added the question mark. I meant no disrespect.
Today is tomorrow's yesterday.

dbannon

  • Hero Member
  • *****
  • Posts: 3294
    • tomboy-ng, a rewrite of the classic Tomboy
Re: fpcupdeluxe and the Pico
« Reply #42 on: March 09, 2024, 03:44:02 am »
OK, I have established, in this situation, that fpc, with an unmodified fpc.cfg, does not look in the dir Michael suggested -   
Code: [Select]
"$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/eabi/rtl/filesbut it does look in
Code: [Select]
"$FPC_DIR"/lib/fpc/3.3.1/units/arm-embedded/armv6m/files  # note: minus the eabi/rtl

Michael knows far (far, far) more than I about embedded, but I suggest that does solve the problem he is worried about ?  'armv6m' is enough to distinguish which cpu we are talking about ? As I understand it, armv6m implies ABI=eabi ? Dropping the 'rtl' is a pity but for obvious reasons, 'rtl' means something quite different in the embedded world (IMHO).

Of course, that approach would still involve changes to the Makefile, its the one who creates the original abbreviated subdir as demonstrated here (its obviously not a full list) -

Code: [Select]
==== This is after running make crossinstall but before the other, tidy up things  =====

testFPC/FPC/fpc-3.3.1/lib/fpc/3.3.1/units/arm-embedded/rtl contains 63 files
 
-rw-r--r-- 1 dbannon dbannon   23296 Mar  9 11:37 charset.o
-rw-r--r-- 1 dbannon dbannon   18101 Mar  9 11:37 charset.ppu
-rw-r--r-- 1 dbannon dbannon  844608 Mar  9 11:37 classes.o
-rw-r--r-- 1 dbannon dbannon  954543 Mar  9 11:37 classes.ppu
....
-rw-r--r-- 1 dbannon dbannon  802772 Mar  9 11:37 system.o
-rw-r--r-- 1 dbannon dbannon  969333 Mar  9 11:37 system.ppu
....
-rw-r--r-- 1 dbannon dbannon    2020 Mar  9 11:37 uuchar.o
-rw-r--r-- 1 dbannon dbannon    1515 Mar  9 11:37 uuchar.ppu

==== However, we have missed these files, back in SRC ========

testFPC/FPC/SRC/fpc-3.3.1/fpc/rtl/embedded/arm/ contains 48 files

-rw-r--r-- 1 dbannon dbannon   3566 Nov 24 14:46 allwinner_a20.pp
-rw-r--r-- 1 dbannon dbannon  33207 Nov 24 14:46 at91sam7x256.pp
-rw-r--r-- 1 dbannon dbannon   2105 Nov 24 14:46 cortexm0.pp
....
-rw-r--r-- 1 dbannon dbannon   4531 Nov 24 14:46 raspi2.pp
-rw-r--r-- 1 dbannon dbannon  21574 Nov 24 14:46 rp2040.pp
....
-rw-r--r-- 1 dbannon dbannon  89634 Nov 24 14:46 stm32f756.pp
-rw-r--r-- 1 dbannon dbannon  26138 Nov 24 14:46 xmc4500.pp

WRT suggestions it should work like fpcupdeluxe, I still don't know what fpcupdeluxe does here, new error when compiling Lazarus and I don't see how I can just install a Pico FPC. Dare I mention, again, this is expected sometimes when you use main ? 

Code: [Select]
(3104) Compiling lazutf8.pas
(3104) Compiling lazutilsstrconsts.pas
(3104) Compiling uitypes.pas
/home/dbannon/fpcupdeluxe/lazarus/components/lazutils/uitypes.pas(105,14) Error: (3285) Expected another 2 array elements
/home/dbannon/fpcupdeluxe/lazarus/components/lazutils/uitypes.pas(93,58) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /home/dbannon/fpcupdeluxe/fpc/bin/x86_64-linux/ppcx64 returned an error exitcode
fpcupdeluxe: ERROR: Lazarus Native Installer (BuildModuleCustom: Lazbuild): make returned exit status #512.


That leaves me with an incomplete fpc cross compiler, presumably because it does Lazarus before the cross compiler.

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

TRon

  • Hero Member
  • *****
  • Posts: 4148
Re: fpcupdeluxe and the Pico
« Reply #43 on: March 09, 2024, 06:50:05 am »
OK, I have established, in this situation, that fpc, with an unmodified fpc.cfg, does not look in the dir Michael suggested -   
And it never will unless either a) the compiler is configured correctly (as should be done) or b) provide the correct unit path to the compiler on the command-line

Quote
Of course, that approach would still involve changes to the Makefile, its the one who creates the original abbreviated subdir as demonstrated here (its obviously not a full list) -
Asked and answered by MiR. It does not require changes to the makefile

Quote
WRT suggestions it should work like fpcupdeluxe, I still don't know what fpcupdeluxe does here, new error when compiling Lazarus and I don't see how I can just install a Pico FPC. Dare I mention, again, this is expected sometimes when you use main ? 
I not had the time to try recompile trunk/trunk again so yes you might have ran into a similar situation. Trunk is a moving target the last few weeks and I can only guess it will be unstable for a while.
« Last Edit: March 09, 2024, 06:58:48 am by TRon »
Today is tomorrow's yesterday.

DonAlfredo

  • Hero Member
  • *****
  • Posts: 1793
Re: fpcupdeluxe and the Pico
« Reply #44 on: March 09, 2024, 08:01:48 am »
As stated before, you can use the single step method to have a look at how fpcupdeluxe does its "magic".
  • Install (only) FPC trunk/main.
  • Install arm-embedded cross-compiler.
No changes of Makefile are needed.
Have a look at (last part of) fpc.cfg to see how macros are used to point FPC to the correct unit paths.

 

TinyPortal © 2005-2018