]> granicus.if.org Git - esp-idf/blob - Kconfig
Merge branch 'bugfix/move_ringbuf_lib_to_iram' into 'master'
[esp-idf] / Kconfig
1 #
2 # For a description of the syntax of this configuration file,
3 # see kconfig/kconfig-language.txt.
4 #
5 mainmenu "Espressif IoT Development Framework Configuration"
6
7 config IDF_CMAKE
8     bool
9     option env="IDF_CMAKE"
10
11 menu "SDK tool configuration"
12 config TOOLPREFIX
13     string "Compiler toolchain path/prefix"
14     default "xtensa-esp32-elf-"
15     help
16         The prefix/path that is used to call the toolchain. The default setting assumes
17         a crosstool-ng gcc setup that is in your PATH.
18
19 config PYTHON
20     string "Python 2 interpreter"
21     depends on !IDF_CMAKE
22     default "python"
23     help
24         The executable name/path that is used to run python. On some systems Python 2.x
25         may need to be invoked as python2.
26
27         (Note: This option is used with the GNU Make build system only, not idf.py
28         or CMake-based builds.)
29
30 config MAKE_WARN_UNDEFINED_VARIABLES
31     bool "'make' warns on undefined variables"
32     default "y"
33     help
34         Adds --warn-undefined-variables to MAKEFLAGS. This causes make to
35         print a warning any time an undefined variable is referenced.
36
37         This option helps find places where a variable reference is misspelled
38         or otherwise missing, but it can be unwanted if you have Makefiles which
39         depend on undefined variables expanding to an empty string.
40
41 endmenu  # SDK tool configuration
42
43 source "$COMPONENT_KCONFIGS_PROJBUILD"
44
45 menu "Compiler options"
46
47 choice OPTIMIZATION_COMPILER
48     prompt "Optimization Level"
49     default OPTIMIZATION_LEVEL_DEBUG
50     help
51         This option sets compiler optimization level (gcc -O argument).
52
53         - for "Release" setting, -Os flag is added to CFLAGS.
54         - for "Debug" setting, -Og flag is added to CFLAGS.
55
56         "Release" with -Os produces smaller & faster compiled code but it
57         may be harder to correlated code addresses to source files when debugging.
58
59         To add custom optimization settings, set CFLAGS and/or CPPFLAGS
60         in project makefile, before including $(IDF_PATH)/make/project.mk. Note that
61         custom optimization levels may be unsupported.
62
63 config OPTIMIZATION_LEVEL_DEBUG
64     bool "Debug (-Og)"
65 config OPTIMIZATION_LEVEL_RELEASE
66     bool "Release (-Os)"
67 endchoice
68
69 choice OPTIMIZATION_ASSERTION_LEVEL
70     prompt "Assertion level"
71     default OPTIMIZATION_ASSERTIONS_ENABLED
72     help
73         Assertions can be:
74
75         - Enabled. Failure will print verbose assertion details. This is the default.
76
77         - Set to "silent" to save code size (failed assertions will abort() but user
78           needs to use the aborting address to find the line number with the failed assertion.)
79
80         - Disabled entirely (not recommended for most configurations.) -DNDEBUG is added
81           to CPPFLAGS in this case.
82
83 config OPTIMIZATION_ASSERTIONS_ENABLED
84     prompt "Enabled"
85     bool
86     help
87         Enable assertions. Assertion content and line number will be printed on failure.
88
89 config OPTIMIZATION_ASSERTIONS_SILENT
90     prompt "Silent (saves code size)"
91     bool
92     help
93         Enable silent assertions. Failed assertions will abort(), user needs to
94         use the aborting address to find the line number with the failed assertion.
95
96 config OPTIMIZATION_ASSERTIONS_DISABLED
97     prompt "Disabled (sets -DNDEBUG)"
98     bool
99     help
100         If assertions are disabled, -DNDEBUG is added to CPPFLAGS.
101
102 endchoice # assertions
103
104 menuconfig CXX_EXCEPTIONS
105    bool "Enable C++ exceptions"
106    default n
107    help
108        Enabling this option compiles all IDF C++ files with exception support enabled.
109
110        Disabling this option disables C++ exception support in all compiled files, and any libstdc++ code which throws
111        an exception will abort instead.
112
113        Enabling this option currently adds an additional ~500 bytes of heap overhead
114        when an exception is thrown in user code for the first time.
115
116 config CXX_EXCEPTIONS_EMG_POOL_SIZE
117     int "Emergency Pool Size"
118     default 0
119     depends on CXX_EXCEPTIONS
120     help
121        Size (in bytes) of the emergency memory pool for C++ exceptions. This pool will be used to allocate
122        memory for thrown exceptions when there is not enough memory on the heap.
123
124 choice STACK_CHECK_MODE
125     prompt "Stack smashing protection mode"
126     default STACK_CHECK_NONE
127     help
128         Stack smashing protection mode. Emit extra code to check for buffer overflows, such as stack
129         smashing attacks. This is done by adding a guard variable to functions with vulnerable objects.
130         The guards are initialized when a function is entered and then checked when the function exits.
131         If a guard check fails, program is halted. Protection has the following modes:
132
133         - In NORMAL mode (GCC flag: -fstack-protector) only functions that call alloca,
134           and functions with buffers larger than 8 bytes are protected.
135         
136         - STRONG mode (GCC flag: -fstack-protector-strong) is like NORMAL, but includes
137           additional functions to be protected -- those that have local array definitions,
138           or have references to local frame addresses.
139         
140         - In OVERALL mode (GCC flag: -fstack-protector-all) all functions are protected.
141
142         Modes have the following impact on code performance and coverage:
143
144         - performance: NORMAL > STRONG > OVERALL
145         
146         - coverage: NORMAL < STRONG < OVERALL
147
148
149 config STACK_CHECK_NONE
150     bool "None"
151 config STACK_CHECK_NORM
152     bool "Normal"
153 config STACK_CHECK_STRONG
154     bool "Strong"
155 config STACK_CHECK_ALL
156     bool "Overall"
157 endchoice
158
159 config STACK_CHECK
160     bool
161     default !STACK_CHECK_NONE
162     help
163         Stack smashing protection.
164
165 config WARN_WRITE_STRINGS
166     bool "Enable -Wwrite-strings warning flag"
167     default "n"
168     help
169         Adds -Wwrite-strings flag for the C/C++ compilers.
170
171         For C, this gives string constants the type ``const char[]`` so that
172         copying the address of one into a non-const ``char *`` pointer
173         produces a warning. This warning helps to find at compile time code
174         that tries to write into a string constant.
175
176         For C++, this warns about the deprecated conversion from string
177         literals to ``char *``.
178
179 config DISABLE_GCC8_WARNINGS
180     bool "Disable new warnings introduced in GCC 6 - 8"
181     default "n"
182     help
183         Enable this option if using GCC 6 or newer, and wanting to disable warnings which don't appear with GCC 5.
184
185
186 endmenu # Compiler Options
187
188 menu "Component config"
189 source "$COMPONENT_KCONFIGS"
190 endmenu