From: Laszlo Ersek <lersek@redhat.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>,
Leif Lindholm <leif.lindholm@linaro.org>
Cc: "edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [PATCH] BaseTools/tools_def: suppress GCC predefined macros in DTB compilation
Date: Thu, 26 Oct 2017 17:08:32 +0200 [thread overview]
Message-ID: <b276128e-4877-bf35-2a83-38a268087e7a@redhat.com> (raw)
In-Reply-To: <CAKv+Gu-BG2TY0-HVtgfEMLR6f8wGBioWpYaif7HHEqBPpsNnyA@mail.gmail.com>
On 10/26/17 13:34, Ard Biesheuvel wrote:
> On 26 October 2017 at 12:33, Leif Lindholm <leif.lindholm@linaro.org> wrote:
>> On Thu, Oct 26, 2017 at 12:11:16PM +0100, Ard Biesheuvel wrote:
>>> On 26 October 2017 at 12:09, Laszlo Ersek <lersek@redhat.com> wrote:
>>>> On 10/26/17 12:12, Ard Biesheuvel wrote:
>>>>> The standard GCC preprocessor we use to preprocess device tree sources
>>>>> files has a whole bunch of macros predefined, among which
>>>>>
>>>>
>>>> The example you wanted to paste is missing.
>>>>
>>>
>>> Yeah, the leading # made git-commit throw them away :-)
>>
>> Haha :)
Been there, burned myself similarly :)
>>> #define __linux 1
>>> #define __linux__ 1
>>> #define __gnu_linux__ 1
>>> #define linux 1
>>
>> How did you make it not throw them away?
>> (I can find a few suggestions online, neither sounds optimal.)
>>
>
> Oh Gmail doesn't care, so pasting them here is not a problem
>
> In Git, I just added some spaces at the beginning.
Or use email-style quoting ("> ").
Thanks,
Laszlo
>>>>> 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
>>>>>
>>>>
>>>> With the commit message fixed:
>>>>
>>>> Acked-by: Laszlo Ersek <lersek@redhat.com>
>>
>> With the same precondition:
>>
>> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>>
>> /
>> Leif
next prev parent reply other threads:[~2017-10-26 15:04 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-10-31 5:41 ` Gao, Liming
2017-10-31 8:27 ` Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b276128e-4877-bf35-2a83-38a268087e7a@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox