From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::243; helo=mail-io0-x243.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 040E521CEB149 for ; Thu, 26 Oct 2017 04:07:31 -0700 (PDT) Received: by mail-io0-x243.google.com with SMTP id n137so4512951iod.6 for ; Thu, 26 Oct 2017 04:11:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2A6E/oZyIZRfkY8nnW3fAWO0oNAVNMqaS5C1SU0zD4o=; b=QjSI90ON7dsGkK0w5xGiEy0UJySLKDSHa7w0tj6tt5QNpG0dFJXS+ZLcaWFsk9x5/x uZOmySVTKTWO1ytgH2rk3mzHsta/T0kqsYgfsjNYNpg8Z3XNcacr5zlQzEUNzdcw2n70 8qKEi4FPoaNpgVJeDA/EXnOOjidJq8Xr5wxYU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2A6E/oZyIZRfkY8nnW3fAWO0oNAVNMqaS5C1SU0zD4o=; b=Yc9ahwEiHN3bxZbICPYKyLAKllQVleiQoaQ8imKb5lyfVjhI8E5wAXPhxnHHHZX9iV cGYPIHjoBGsABtPmLxalYQLXrZ0crlLBqcYyP1uWLDg6nJVU4k2xvKpVcJ8adU8c0ntT 1QAHrslzn5i45JC83v3KaVSKyGkH8yhG2MwYNQsH0OgHYQD4a/NWVFay2kLLBesCRhPI WFvcKic7+zXGQzzh7r7+VimT/HdNllFhs1nw4VTIIsLQcN/CNFx4yIQe9N2FWaouyyEL /DXTspB5rHWr3z1fT25bwFkw0g8JrWCRm+X2RUJ+phY9U7ZWmMTrpzn43FDdPg6Mn3XG fc8A== X-Gm-Message-State: AMCzsaUnBTIaHemtCto+LDioZLgDao69+gRNCfYa47nmbB0QveFBWw/d qgjiAd+OJRKRmC6jsltPEndkWddi5tSVql9/cG4dKw== X-Google-Smtp-Source: ABhQp+S6uwW9j21BZeMmicQ3SRDyGSKdx3ylF30Rpcx9Sq0yxKIeucskaiRiMHyzAOcRM/IyIM+LLrvwItgx3QMSWG4= X-Received: by 10.107.142.208 with SMTP id q199mr30713490iod.186.1509016277120; Thu, 26 Oct 2017 04:11:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.131.167 with HTTP; Thu, 26 Oct 2017 04:11:16 -0700 (PDT) In-Reply-To: <2b0ce401-e334-335f-a352-7ce841041313@redhat.com> References: <20171026101209.31630-1-ard.biesheuvel@linaro.org> <2b0ce401-e334-335f-a352-7ce841041313@redhat.com> From: Ard Biesheuvel Date: Thu, 26 Oct 2017 12:11:16 +0100 Message-ID: To: Laszlo Ersek Cc: "edk2-devel@lists.01.org" , "Gao, Liming" , Leif Lindholm Subject: Re: [PATCH] BaseTools/tools_def: suppress GCC predefined macros in DTB compilation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Oct 2017 11:07:32 -0000 Content-Type: text/plain; charset="UTF-8" On 26 October 2017 at 12:09, Laszlo Ersek 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 :-) #define __linux 1 #define __linux__ 1 #define __gnu_linux__ 1 #define linux 1 >> 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 >> --- >> 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