APPENDIX E

image

ARM Compile Options

For ARM platform compiles, the following site makes compiler option recommendations: http://elinux.org/RPi_Software.

The site states the following:

  • The gcc compiler flags that produce the most optimal code for the Raspberry Pi are as follows:
    • -Ofast -mfpu=vfp -mfloat -abi=hard -march=armv6zk  -mtune=arm1176jzf-s
  • For some programs, -Ofast may produce compile errors. In these cases, -O3 or -O2 should be used instead.
  • -mcpu=arm1176jzf-s can be used in place of -march=armv6zk -mtune=arm1176jzf-s.

Get Mastering the Raspberry Pi now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.