09-17-2020 12:37 PM - edited 09-17-2020 12:51 PM
Previously, I used PYNQ-Z1 which equips with dual-core Cortex-A9 processor and Ubuntu 18.04. In the .bashrc, I used the following setting for compile flags.
export CXXFLAGS="$CXXFLAGS -fdiagnostics-color -Wno-psabi -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -fPIC"
export CFLAGS="$CFLAGS -fdiagnostics-color -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb -fPIC"
However, we change the platform to Xilinx Zynq UltraScale+ MPSoC ZCU104 with quad-core ARM Cortex-A53 applications processor plus the same Ubuntu 18.04 PYNQ image. For the setting of compile flags in .bashcr, should I make any changes?
Also, I saw Raspberry Pi 3 which is Cortex-A53 uses the following compile arguments:
|Raspberry Pi 3||-mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits|
Is it OK to set on the ZCU-104?
Thank you very much.
09-17-2020 02:01 PM
This is somewhat of a complicated issue. You need to consider:
1) the capabilities of the hardware. It is not enough to know "Cortex-A53". This CPU core can be found many devices, with different features enabled in the core, and paired with different types of floating point co-processor. Determining exactly what you have takes some effort.
2) you also need to consider how the rest of your system was compiled, in particular, any shared libraries such as libc (glibc) and perhaps libstdc++. The code you compile will depend on (some) of these libraries, which exist in binary form on your rootfs. You need to match the compilation settings (esp floating point, even if you are not using it in your code). Otherwise your programs will likely fault upon execution.
I don't mean to dissuade you from trying to optimize compiler settings Just be prepared to have to dig through a lot of hoops to understand the plethora of options.