|
|
@@ -91,6 +91,28 @@ If you want to add extra build options, you can use these makefile variables:
|
|
|
* :ref:`develop_buildsystem_var_ldlibs`: This will add extra libraries need to be linked.
|
|
|
* :ref:`develop_buildsystem_var_libdirs`: This will add extra library directories to be searched by linker.
|
|
|
|
|
|
+.. _develop_appdev_optimize_for_codesize:
|
|
|
+
|
|
|
+Optimize For Code Size
|
|
|
+----------------------
|
|
|
+
|
|
|
+If you want to optimize your application for code size, you set ``COMMON_FLAGS``
|
|
|
+in your application Makefile like this:
|
|
|
+
|
|
|
+.. code-block:: makefile
|
|
|
+
|
|
|
+ COMMON_FLAGS := -Os
|
|
|
+
|
|
|
+If you want to optimize code size even more, you use this link time optimization(LTO) as below:
|
|
|
+
|
|
|
+.. code-block:: makefile
|
|
|
+
|
|
|
+ COMMON_FLAGS := -Os -flto
|
|
|
+
|
|
|
+see :ref:`design_app_demo_eclic` for example usage of optimize for code size.
|
|
|
+
|
|
|
+For more details about gcc optimization, please refer to `Options That Control Optimization in GCC`_.
|
|
|
+
|
|
|
.. _develop_appdev_linkscript:
|
|
|
|
|
|
Change Link Script
|
|
|
@@ -116,3 +138,6 @@ Set Local Make Options For Your Application
|
|
|
|
|
|
If you want to change the application level Make options,
|
|
|
you can add the :ref:`develop_buildsystem_makefile_local`.
|
|
|
+
|
|
|
+
|
|
|
+.. _Options That Control Optimization in GCC: https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Optimize-Options.html#Optimize-Options
|