From 804d65e5fd86057e78c0d0b5f6139172d20b8207 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Mon, 24 Feb 2020 17:20:57 -0800 Subject: make: add preprocessor stage For the upcoming introduction of transitioning Cr50 console communications to packet mode, there is a need to be able to replace all print function invocations in the code with calls to packet sending function. This replacement is easiest to make in C preprocessor outputs, as there all macros are replaced with actual function invocations. This patch adds a configuration option CONFIG_EXTRACT_PRINTF_STRINGS, when enabled, building of the image object files starts happening in three steps instead of one, instead of .c => .o transition, the steps are .c => .E => .Ep => .o, where .E is the C preprocessor output, and .Ep is result of post processing by ./util/util_precompile.py. BUG=b:149964350 TEST=image layout does not change if CONFIG_EXTRACT_PRINTF_STRINGS is not defined. With the rest of the patches applied defining the above config option allows to build a Cr50 image supporting packet console communications mode. Signed-off-by: Vadim Bendebury Change-Id: I20b8ba7c5d13cb54ac6adbdbce856d92023ce997 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2113122 Reviewed-by: Randall Spangler --- include/config.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/config.h') diff --git a/include/config.h b/include/config.h index f810be8e90..5e556b7224 100644 --- a/include/config.h +++ b/include/config.h @@ -1411,6 +1411,9 @@ /* Enable verbose output to UART console and extra timestamp print precision. */ #define CONFIG_CONSOLE_VERBOSE +/* Trigger building the image with all format strings extracted. */ +#undef CONFIG_EXTRACT_PRINTF_STRINGS + /* * Enable EC-CR50 communication (a.k.a. EC-EFS2). This is for CR50 config only. */ -- cgit v1.2.1