From patchwork Tue Feb 27 17:51:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 129842 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp92547lja; Tue, 27 Feb 2018 09:51:46 -0800 (PST) X-Google-Smtp-Source: AH8x226+p+W3hIyY+vGVqQYtE42Pe5hYZLcgH2E4O+xrsktCtBhmzoFVwWuWdgDGgEIUjZYPR+cd X-Received: by 2002:a17:902:9a04:: with SMTP id v4-v6mr14774058plp.252.1519753906655; Tue, 27 Feb 2018 09:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519753906; cv=none; d=google.com; s=arc-20160816; b=CkzcPcP1RFq72C7YtBhPNATxShsz9b2YMxLVNlsDHOxUNgn85AKOIGpuI7dS/zQH8U Y/huKuZGdEzpXsX7CqXe7Lzi0aB0Vw/FnhDR+Pu8TpXPYZA2tPYC6Wk2Cs879CMXqfXr lLdbjxUudrXLFe0+IqRoD4plR80Cy1bnGWlvySwlwQOQ97+tc5BAmF1ClnkH5kNa7TlC vnH1h/HuvAlKbIHugayo4z/aLXR77zr+2+jjnSJkNTiG82/RLD8FHAnEucczgy2/rghM r5KAOKivyDZdVesHXsUqZ7ND++T5UUADD2EI+T9w5Ufp+o673h+FHuPT3p4k/uzZnyXw 43xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to:arc-authentication-results; bh=H6O4WZYIWTsnHhv5cK+8Qvp1HlB1/3FVkkc2iZkPiq4=; b=cQNpcOplCaNDJSuWu4c5A4D7Gkl7aoNqM/KaUwTSY2a39JlQ9rp06lpMEO9RoRozPU 0M5pUf1zheTn+vED2xC+AwhXE3RAsCkEC/6FA0gexZP/7GnIVmC9sLImV7DYkWoYnHk8 CaIfJYiGv6Oeh7qDrN4AKcEyVm8i57qZ51HXW5sIfx51RA+Um5LfTop7hlHgNpsmOXpO hTv5aXlm2HJfHFLbsYMxRY4ddLCjJqdlcjQ0Cup4u3nu3A7zhD3bluzqsIL8LxUXxEbn MppqtiyQMOciD/dQ1vemuJyl1i36t28uezgd7zJHI0lP90o/Dg6dHC0GAZPxWm7IkDJo LN0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NAWSbBCo; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id t9si1964891pgn.157.2018.02.27.09.51.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 09:51:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=NAWSbBCo; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 6847D223522BA; Tue, 27 Feb 2018 09:45:39 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:400c:c09::242; helo=mail-wm0-x242.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (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 D7B4622352288 for ; Tue, 27 Feb 2018 09:45:37 -0800 (PST) Received: by mail-wm0-x242.google.com with SMTP id t6so178697wmt.5 for ; Tue, 27 Feb 2018 09:51:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Kpof+OfAdibjMXr2scveQDajJuY/mRURW3Hutaw16Ak=; b=NAWSbBCo7UCpH/6wL7HoXQ1lMDCTfyeZ4DI8vueo1XWtqBsU1oStLlFkppSUdvjThh 6/3GFUxO3QtuLPN/9LgnnndtDEuLSzx36N64TNnlN6hNaYpGMVCg/9szqXEU6maFNhOo pKwymrOGjvT8wHwbePbvxCt6PYQ+rUgqMymRE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Kpof+OfAdibjMXr2scveQDajJuY/mRURW3Hutaw16Ak=; b=OquiOPs6g/gxwYps/raxWa64lVSVaXvU2BVq6/W3MseoG5r0K505bIqG3NfXIU7Ewg WPuG4QZPZyoqeGQ8AdfLFAOVeNNVB9U79NsytBQSaCXQnQnkpTOxFyrJcR67J/LUry9N bFAfaytrwJKQFB+atRIfHHvtrVeUpJaNvWfZo5BtI3GXLiPRJBVItmapJUgxt3AgUfAl RpqNESp4CXg/JzKuJEtysPQY5WAsEdasVqlqwTpQb6U9oIkcnx2xTE4u7KEGJzOgwxaK xN24AN0D8cpDLZ3v/8aFZh+FybwiCCZ4VJnvJGSONygPw0BpDy3/1YEAnhDfC+cmVv2b FTYw== X-Gm-Message-State: APf1xPDJp3qRm39K212cvtwRzbzApbd4GM6WPgovcBc9Hy9muSotbu/z dpGlEL/laNR/24JSOdtjSI2/BQ== X-Received: by 10.28.137.14 with SMTP id l14mr11439738wmd.137.1519753902105; Tue, 27 Feb 2018 09:51:42 -0800 (PST) Received: from localhost.localdomain ([160.163.57.8]) by smtp.gmail.com with ESMTPSA id l11sm9236947wrg.71.2018.02.27.09.51.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 09:51:41 -0800 (PST) From: Ard Biesheuvel To: leif.lindholm@linaro.org, edk2-devel@lists.01.org Date: Tue, 27 Feb 2018 17:51:32 +0000 Message-Id: <20180227175132.1607-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Subject: [edk2] [PATCH] BaseTools/tools_def: use separate PP definition for DTC X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: liming.gao@intel.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Clang's preprocessor behaves differently from GCC's, and produces intermediate device tree source that still contains #pragma pack() and other directives that the device tree compiler chokes on. For assembling device tree sources, it matters very little which preprocessor is being used, so let's just use GNU CPP explicitly. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- We may need to revisit this in the future, but at present, it is highly unlikely that someone has DTC installed but not GNU CPP, so for the time being, this should be a sufficient fix. BaseTools/Conf/build_rule.template | 2 +- BaseTools/Conf/tools_def.template | 10 +++------- 2 files changed, 4 insertions(+), 8 deletions(-) -- 2.11.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm Reviewed-by: Liming Gao diff --git a/BaseTools/Conf/build_rule.template b/BaseTools/Conf/build_rule.template index 77ed282e0311..92482341ab11 100755 --- a/BaseTools/Conf/build_rule.template +++ b/BaseTools/Conf/build_rule.template @@ -278,7 +278,7 @@ $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.dtb - "$(PP)" $(DTCPP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i + "$(DTCPP)" $(DTCPP_FLAGS) $(INC) ${src} > ${d_path}(+)${s_base}.i "$(DTC)" $(DTC_FLAGS) -I dts -O dtb -o ${dst} ${d_path}(+)${s_base}.i [Visual-Form-Representation-File] diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 427ad60b0e26..a5463797c330 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -237,6 +237,7 @@ DEFINE IPHONE_TOOLS = /Developer/Platforms/iPhoneOS.platform/Develope DEFINE SOURCERY_CYGWIN_TOOLS = /cygdrive/c/Program Files/CodeSourcery/Sourcery G++ Lite/bin +DEFINE DTCPP_BIN = ENV(DTCPP_PREFIX)cpp DEFINE DTC_BIN = ENV(DTC_PREFIX)dtc #################################################################################### @@ -4499,6 +4500,8 @@ DEBUG_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_N RELEASE_*_*_OBJCOPY_ADDDEBUGFLAG = NOOPT_*_*_OBJCOPY_ADDDEBUGFLAG = --add-gnu-debuglink=$(DEBUG_DIR)/$(MODULE_NAME).debug *_*_*_DTC_FLAGS = -H epapr +*_*_*_DTCPP_PATH = DEF(DTCPP_BIN) +*_*_*_DTC_PATH = DEF(DTC_BIN) DEFINE GCC_ALL_CC_FLAGS = -g -Os -fshort-wchar -fno-builtin -fno-strict-aliasing -Wall -Werror -Wno-array-bounds -include AutoGen.h -fno-common DEFINE GCC_IA32_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -m32 -malign-double -freorder-blocks -freorder-blocks-and-partition -O2 -mno-stack-arg-probe @@ -4912,7 +4915,6 @@ RELEASE_GCC45_X64_CC_FLAGS = DEF(GCC45_X64_CC_FLAGS) -Os *_GCC46_*_MAKE_PATH = DEF(GCC46_IA32_PREFIX)make *_GCC46_*_*_DLL = ENV(GCC46_DLL) *_GCC46_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_GCC46_*_DTC_PATH = DEF(DTC_BIN) *_GCC46_*_PP_FLAGS = DEF(GCC_PP_FLAGS) *_GCC46_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) @@ -5023,7 +5025,6 @@ RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC46_ARM_CC_FLAGS) -Wno-unused-but-set-v *_GCC47_*_MAKE_PATH = DEF(GCC47_IA32_PREFIX)make *_GCC47_*_*_DLL = ENV(GCC47_DLL) *_GCC47_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_GCC47_*_DTC_PATH = DEF(DTC_BIN) *_GCC47_*_PP_FLAGS = DEF(GCC_PP_FLAGS) *_GCC47_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) @@ -5163,7 +5164,6 @@ RELEASE_GCC47_AARCH64_CC_FLAGS = DEF(GCC47_AARCH64_CC_FLAGS) -Wno-unused-but-s *_GCC48_*_MAKE_PATH = DEF(GCC48_IA32_PREFIX)make *_GCC48_*_*_DLL = ENV(GCC48_DLL) *_GCC48_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_GCC48_*_DTC_PATH = DEF(DTC_BIN) *_GCC48_*_PP_FLAGS = DEF(GCC_PP_FLAGS) *_GCC48_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) @@ -5303,7 +5303,6 @@ RELEASE_GCC48_AARCH64_CC_FLAGS = DEF(GCC48_AARCH64_CC_FLAGS) -Wno-unused-but-s *_GCC49_*_MAKE_PATH = DEF(GCC49_IA32_PREFIX)make *_GCC49_*_*_DLL = ENV(GCC49_DLL) *_GCC49_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_GCC49_*_DTC_PATH = DEF(DTC_BIN) *_GCC49_*_PP_FLAGS = DEF(GCC_PP_FLAGS) *_GCC49_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) @@ -5449,7 +5448,6 @@ RELEASE_GCC49_AARCH64_DLINK_FLAGS = DEF(GCC49_AARCH64_DLINK_FLAGS) *_GCC5_*_MAKE_PATH = DEF(GCC5_IA32_PREFIX)make *_GCC5_*_*_DLL = ENV(GCC5_DLL) *_GCC5_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_GCC5_*_DTC_PATH = DEF(DTC_BIN) *_GCC5_*_PP_FLAGS = DEF(GCC_PP_FLAGS) *_GCC5_*_ASLPP_FLAGS = DEF(GCC_ASLPP_FLAGS) @@ -5606,7 +5604,6 @@ RELEASE_GCC5_AARCH64_DLINK_FLAGS = DEF(GCC5_AARCH64_DLINK_FLAGS) -flto -Os -L$(W *_CLANG35_*_MAKE_PATH = make *_CLANG35_*_*_DLL = ENV(CLANG35_DLL) *_CLANG35_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_CLANG35_*_DTC_PATH = DEF(DTC_BIN) *_CLANG35_*_PP_FLAGS = DEF(GCC_PP_FLAGS) *_CLANG35_*_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) @@ -5684,7 +5681,6 @@ RELEASE_CLANG35_AARCH64_CC_FLAGS = DEF(CLANG35_AARCH64_CC_FLAGS) $(ARCHCC_FLAGS) *_CLANG38_*_MAKE_PATH = make *_CLANG38_*_*_DLL = ENV(CLANG38_DLL) *_CLANG38_*_ASL_PATH = DEF(UNIX_IASL_BIN) -*_CLANG38_*_DTC_PATH = DEF(DTC_BIN) *_CLANG38_*_APP_FLAGS = *_CLANG38_*_ASL_FLAGS = DEF(IASL_FLAGS)