Closed kwilsonpdx closed 10 years ago
Aren't you using the STM32F4? Why would you have the epic FPU turned off?
Aren't you using the STM32F4? Why would you have the epic FPU turned off?
PSAS development is a Traveling Carnival Of Wonder.
(I'll open an issue about turning the FPU ON)
For clarity the options have been broken out into sections:
The following are brought in by setting USE_LINK_GC to yes which seems to imply they're for link time garbage collection. On flight-rnh it reduced binaries by about 12% and I didn't need memstreams.c
-fno-common While investigating I found the linker flag which I'm probably not understanding but it seems like it might do a similar thing :--gc-sections. It has no noticeable effect though.
We're explicitly not using -flto, -Ofast, and other major opt flags that interfere with debugging. Once development has neared completion on a project these can be considered for a build for flight target, but the resulting binaries will still need to be verified that optimization hasn't broken anything.
We can't use -std=c99 or -Wpedantic because ChibiOS makes heavy use of GCCs extensions to asm. -std=gnu99 should be used instead.
-ggdb - like -g but with extra info for gdb specifically
-Wa,-alms=build/lst/
-mcpu=cortex-m4 -mno-thumb-interwork
-DCORTEX_USE_FPU=FALSE - When set to true mfloat-abi should be set to hard instead of softp like it is now -DTHUMB_PRESENT -DTHUMB_NO_INTERWORKING
-MD -MP -MF .dep/build.d
TODO: Investigate what features newlib offers
There are a large number of warning flags that for one reason or another aren't enabled by -Wall and -Wextra. This is a preliminary list of those that might be of interest. With some of them ChibiOS generates a large number of warnings so they're only really useful as a one off thing.
There's always more flags to explore, but for the upcoming flight I think we're largely satisfied with the review that's already taken place. We can re-open this later.
It may be a valuable exercise to have a group review of all the complier and linker flags we have chosen to use for STM32 flight-_ applications.
Here is an example of some of the flags we are currently using during compile:
arm-none-eabi-gcc -c -mcpu=cortex-m4 -O2 -ggdb -fomit-frame-pointer -falign-functions=16 -Wno-main -ffunction-sections -fdata-sections -fno-common -Wall -Wextra -Wstrict-prototypes -Wa,-alms=build/lst/utils_hal.lst -DCORTEX_USE_FPU=FALSE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/utils_hal.o.d -mthumb -DTHUMB ...