View previous topic :: View next topic |
Author |
Message |
antonellocaroli Guru

Joined: 11 Aug 2016 Posts: 394
|
Posted: Sat Dec 28, 2019 9:22 am Post subject: compile stage4 on Rpi4 for Rpi3 - 32bit |
|
|
You can compile a stage4-32bit on Rpi4 for Rpi3?
using in make.conf CFLAGS="-O2 -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard"
???
other thing:
weird thing I realized on rpi3 march=native from this result, isn't it wrong?
Code: | gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1
/usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/9.2.0/cc1 -E -quiet -v /dev/null -o /dev/null -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -marm -march=armv8-a+crc+simd
|
|
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47055 Location: 56N 3W
|
Posted: Sat Dec 28, 2019 12:23 pm Post subject: |
|
|
antonellocaroli,
Lets clarify the problem before I try to answer.
Both the Pi3 and P4 can run in 32 bit or 64 bit mode.
ARM CPUs can switch modes as required so its possible to run 32 bit code on an otherwise 64 bit system.
The other way round does not work as a 64 bit kernel is required to support 64 bit code.
There is no intention to implement multilib on armv8, so its not possible to mix 64 bit and 32 bit code in the same install without keeping them separate yourself, eg a 32 bit chroot on a 64 bit system.
I think the answer to your question is yes but ... _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
antonellocaroli Guru

Joined: 11 Aug 2016 Posts: 394
|
Posted: Sat Dec 28, 2019 12:44 pm Post subject: |
|
|
so I should probably use
CFLAGS="-march=native -O2 -pipe".
since it is on both rpi3 and rpi4
the result is the same by checking with
Code: | gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1
/usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/9.2.0/cc1 -E -quiet -v /dev/null -o /dev/null -mfloat-abi=hard -mfpu=vfpv3-d16 -mtls-dialect=gnu -marm -march=armv8-a+crc+simd |
??? |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47055 Location: 56N 3W
|
Posted: Sat Dec 28, 2019 1:02 pm Post subject: |
|
|
antonellocaroli,
Its still net clear.
You have a Raspberry Pi4 that you wish to use as a build system for a 32 bit Pi3.
What install is on the Raspberry Pi4?
Is it 64 bit or 32 bit?
The Raspberry Pi3 will run a 32 bit install and you will build on the Pi4 for it.
Given that on both systems you get the same output from Code: | gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1 |
They will run the same userspace code.
Howewer ..
Code: | /usr/libexec/gcc/armv7a-unknown-linux-gnueabihf/ | if correct for the P3.
The Pi4 is an armv7l CPU.
armv7a will run on both CPU though. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
antonellocaroli Guru

Joined: 11 Aug 2016 Posts: 394
|
Posted: Sat Dec 28, 2019 1:20 pm Post subject: |
|
|
on pi4 now runs an installation made on pi3 using in the make.conf
Code: |
CFLAGS="-march=native -O2 -pipe"
CHOST="armv7a-unknown-linux-gnueabihf"
|
I just want to use pi4 to upgrade the system, like gcc etc...
and then switch the system to pi3 again. |
|
Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 47055 Location: 56N 3W
|
Posted: Sat Dec 28, 2019 1:38 pm Post subject: |
|
|
antonellocaroli,
Thats fine. The same userspace code will run on both systems.
The kernels and device trees are the only changes. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
 |
|