Skip to content

Commit

Permalink
ardupilotwaf: add -fno-math-errno to ChibiOS boards
Browse files Browse the repository at this point in the history
Allows better use of math instructions as opposed to calling library
functions to implement math like `sqrt`. This saves flash and increases
speed. ArduPilot does not use EDOM or ERANGE anyway.

Might cause issues with malloc errno:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88576 but ArduPilot does
not check for ENOMEM or use errno much anyway.
  • Loading branch information
tpwrules authored and tridge committed Jan 28, 2025
1 parent 47a17f9 commit 46e081a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Tools/ardupilotwaf/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,7 @@ def configure_env(self, cfg, env):
'-fno-builtin-vprintf',
'-fno-builtin-vfprintf',
'-fno-builtin-puts',
'-fno-math-errno',
'-mno-thumb-interwork',
'-mthumb',
'--specs=nano.specs',
Expand Down

0 comments on commit 46e081a

Please sign in to comment.