public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] BaseTools/tools_def: suppress GCC predefined macros in DTB compilation
@ 2017-10-26 10:12 Ard Biesheuvel
  2017-10-26 11:09 ` Laszlo Ersek
  2017-10-31  5:41 ` Gao, Liming
  0 siblings, 2 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2017-10-26 10:12 UTC (permalink / raw)
  To: edk2-devel; +Cc: leif.lindholm, liming.gao, yonghong.zhu, Ard Biesheuvel

The standard GCC preprocessor we use to preprocess device tree sources
files has a whole bunch of macros predefined, among which

This causes a property like 'linux,code' to be converted into '1,code'
which is obviously wrong. So let's get rid of all the predefined macros
by passing -undef to the preprocessor command line.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 BaseTools/Conf/tools_def.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template
index df7c109438fd..98df0ffc9294 100755
--- a/BaseTools/Conf/tools_def.template
+++ b/BaseTools/Conf/tools_def.template
@@ -4369,7 +4369,7 @@ DEFINE GCC_VFRPP_FLAGS             = -x c -E -P -DVFRCOMPILE --include $(DEST_DI
 DEFINE GCC_ASLPP_FLAGS             = -x c -E -include AutoGen.h
 DEFINE GCC_ASLCC_FLAGS             = -x c
 DEFINE GCC_WINDRES_FLAGS           = -J rc -O coff
-DEFINE GCC_DTCPP_FLAGS             = -E -x assembler-with-cpp -imacros $(DEST_DIR_DEBUG)/AutoGen.h -nostdinc
+DEFINE GCC_DTCPP_FLAGS             = -E -x assembler-with-cpp -imacros $(DEST_DIR_DEBUG)/AutoGen.h -nostdinc -undef
 DEFINE GCC_IA32_RC_FLAGS           = -I binary -O elf32-i386          -B i386    --rename-section .data=.hii
 DEFINE GCC_X64_RC_FLAGS            = -I binary -O elf64-x86-64        -B i386    --rename-section .data=.hii
 DEFINE GCC_IPF_RC_FLAGS            = -I binary -O elf64-ia64-little   -B ia64    --rename-section .data=.hii
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-10-31  8:23 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-26 10:12 [PATCH] BaseTools/tools_def: suppress GCC predefined macros in DTB compilation Ard Biesheuvel
2017-10-26 11:09 ` Laszlo Ersek
2017-10-26 11:11   ` Ard Biesheuvel
2017-10-26 11:33     ` Leif Lindholm
2017-10-26 11:34       ` Ard Biesheuvel
2017-10-26 15:08         ` Laszlo Ersek
2017-10-31  5:41 ` Gao, Liming
2017-10-31  8:27   ` Ard Biesheuvel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox