Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2020-09

Fpc make questions...

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bo Berglund

I am not very informed about how make works when building fpc installations, I have just used commands I have gathered online and it has worked...

Now I would like to know:
1) Does make clean inside the fpc source dir erase ALL of the binaries produced by an earlier build inside that source tree?

2) If so, does these two versions of "make all" build for ARMv7 and ARMv6 respecitively:
make all FPC=/home/pi/dev/ppcarm OPT="-dFPC_ARMHF" make all FPC=/home/pi/dev/ppcarm OPT="-dFPC_ARMHF -CpARMV6 -OpARMV6"

3) Does the following command overwrite existing files from an earlier attempt so the CPU target can be replaced?
For ARMv7:
make install OPT="-dFPC_ARMHF" PREFIX=/home/pi
FPC="/home/pi/dev/ppcarm"
For ARMv6:
make install OPT="-dFPC_ARMHF -CpARMV6 -OpARMV6" PREFIX=/home/pi FPC="/home/pi/dev/ppcarm"

4) Do I also need to switch the seed compiler /home/pi/dev/ppcarm (3.0.4) between v6 and v7 or can any of the two work to build correctly fpc itself?

The reason I am asking is that I need to switch my system from building ARMv7 binaries to build ARMv6 binaries and I don't want to start over from scratch on this RPi, which I have used for some time...

Hopefully

make clean
make all
make install

with the proper options will do the trick....
TIA..

Bo Berglund Developer in Sweden

Reply by email

Tomas Hajny
to Bo Berglund
Bo Berglund wrote 7 lines
I am not very informed about how make works when building fpc installations, I have just used commands I have gathered online and it has worked... Now I would like to know: 1) Does make clean inside the fpc source dir erase ALL of the binaries produced by an earlier build inside that source tree?

Yes, as long as the same target is involved. If you want to clean for results of possible cross-compilations as well, use 'make distclean'.

2) If so, does these two versions of "make all" build for ARMv7 and ARMv6 respecitively: make all FPC=/home/pi/dev/ppcarm OPT="-dFPC_ARMHF" make all FPC=/home/pi/dev/ppcarm OPT="-dFPC_ARMHF -CpARMV6 -OpARMV6"

I know nothing about ARM thus I can't answer this one.

Show quoted text 8 lines
3) Does the following command overwrite existing files from an earlier attempt so the CPU target can be replaced? For ARMv7: make install OPT="-dFPC_ARMHF" PREFIX=/home/pi FPC="/home/pi/dev/ppcarm" For ARMv6: make install OPT="-dFPC_ARMHF -CpARMV6 -OpARMV6" PREFIX=/home/pi FPC="/home/pi/dev/ppcarm"

If you perform 'make all' before running 'make install', then you probably don't need the OPT=... parameter for 'make install'.

4) Do I also need to switch the seed compiler /home/pi/dev/ppcarm (3.0.4) between v6 and v7 or can any of the two work to build correctly fpc itself?

No - as long as the seed compiler works on your machine and is supported by the makefiles (i.e. isn't too old), you can use the same seed compiler. Preferably, you should use a seed compiler from the last official release for your platform.

Show quoted text 13 lines
The reason I am asking is that I need to switch my system from building ARMv7 binaries to build ARMv6 binaries and I don't want to start over from scratch on this RPi, which I have used for some time... Hopefully make clean make all make install with the proper options will do the trick.... TIA..

They should.

Tomas

_______________________________________________ fpc-pascal maillist - https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Bo Berglund
to Tomas Hajny
Tomas Hajny wrote 24 lines
> 3) Does the following command overwrite existing files from an earlier > attempt so the CPU target can be replaced? > For ARMv7: > make install OPT="-dFPC_ARMHF" PREFIX=/home/pi > FPC="/home/pi/dev/ppcarm" > For ARMv6: > make install OPT="-dFPC_ARMHF -CpARMV6 -OpARMV6" PREFIX=/home/pi > FPC="/home/pi/dev/ppcarm" If you perform 'make all' before running 'make install', then you probably don't need the OPT=... parameter for 'make install'. > Hopefully > > make clean > make all > make install > > with the proper options will do the trick.... > TIA.. They should.

Thanks, it is reassuring!

Regarding the install I only specify the home dir as the target (PREFIX) and make install creates subdirs below that where it stuffs files.
If I knew the locations affected I could just rm -r them before running make install. But I don't, so this is why I ask.

I did not mention why I need to go from ARMv7 to ARMv6, but it is because I found that binaries generated by my ARMv7 installation will not run on all Raspberries. On RPiZero I get an instant exception, whereas if it was compiled on the RPiZero itself ir runs fine. On the Zero I installed using the v6 switch because that device is an ARMv6. And that binary runs on *all* RPi I have tested on.

That is why I want my main RPi dev box to be converted to use ARMv6 instruction set.

Final question:
Lazarus is built (and rebuilt numerous times) using the ARMv7 compiler. Do I need to rebuild Lazarus (and all the installed packages) too if I switch to a different fpc compiler?

Bo Berglund Developer in Sweden

Reply by email

Bo Berglund
to Tomas Hajny: Yes, as long as the same target is involved. If you want to clean for results of possible…
Tomas Hajny wrote 10 lines
> Hopefully > > make clean > make all > make install > > with the proper options will do the trick.... > TIA.. They should.

Progress update:
----------------
I proceeded to create a script that rebuilds fpc using the info obtained here.
I applied it on the rpi4-dev machine where fpc was installed as ARMv7. Took 10 minutes to complete the three steps.
Then I built the test application and copied it over to the PiZero where it did work just fine! No more exceptions!

So I can confirm that this rebuild method works.

Bo Berglund Developer in Sweden

Reply by email