diff options
author | Fabio Baltieri <fabiobaltieri@google.com> | 2023-05-09 13:18:51 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-05-15 16:38:54 +0000 |
commit | f21e3bc823547c9cac5b36ba2f8358ab806b7ce3 (patch) | |
tree | 0e914be0110f8fa600f8fcc7a1197e33947254e3 | |
parent | 9a21e1e51a47b5adff47990e75e62661e9b33827 (diff) | |
download | chrome-ec-f21e3bc823547c9cac5b36ba2f8358ab806b7ce3.tar.gz |
doc: zephyr_troubleshooting: add a note about macro expansion
Add a note about the new config option
CONFIG_COMPILER_TRACK_MACRO_EXPANSION, and also add an example on how to
disable LTO without changing the project file itself.
BUG=none
TEST=check the page on gitiles
Change-Id: I3af8b5ba4f8a0e59a419e426baa4d5460040e86c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516858
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
-rw-r--r-- | docs/zephyr/zephyr_troubleshooting.md | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/docs/zephyr/zephyr_troubleshooting.md b/docs/zephyr/zephyr_troubleshooting.md index aa6980a9d5..3f3cc508cc 100644 --- a/docs/zephyr/zephyr_troubleshooting.md +++ b/docs/zephyr/zephyr_troubleshooting.md @@ -135,13 +135,23 @@ example a missing `struct device` can show as /tmp/ccCiGy7c.ltrans0.ltrans.o:(.rodata+0x6a0): undefined reference to `__device_dts_ord_75' ``` -Adding `CONFIG_LTO=n` to the corresponding `prj.conf` usually results in more -useful error messages, for example: +Adding `CONFIG_LTO=n` to the corresponding `prj.conf` or building with `zmake +build <project> -DCONFIG_LTO=n` usually results in more useful error messages, +for example: ``` modules/ec/libec_shim.a(adc.c.obj):(.rodata.adc_channels+0x58): undefined reference to `__device_dts_ord_75' ``` +## Macro Error Expansion + +GCC errors on macros include macro expansion by default. This usually results +in a wall of errors that makes it very hard to identify the actual problem. For +these situations it's useful to disable macro expansion entirely by setting +`CONFIG_COMPILER_TRACK_MACRO_EXPANSION=n`, for example by building with: + +`zmake build <project> -DCONFIG_COMPILER_TRACK_MACRO_EXPANSION=n` + ## Build artifacts The buildsystem can be configured to leave the build artifact next to the |