cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nanson
Explorer
Explorer
358 Views
Registered: ‎08-31-2017

Setting of C/C++ compiler flags for compile code on Xilinx Zynq UltraScale+ MPSoC ZCU104

Hi,

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.

0 Kudos
2 Replies
rfs613
Scholar
Scholar
342 Views
Registered: ‎05-28-2013

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.

0 Kudos
nanson
Explorer
Explorer
320 Views
Registered: ‎08-31-2017

@rfs613  Thank you for the comment.

I did a check and it seems that -mfloat-abi=hard -mfpu=vfpv3-d16 -mthumb are no longer supported by aarch64.

0 Kudos