From nobody Fri May 10 08:51:30 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+39749+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39749+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1556524911; cv=none; d=zoho.com; s=zohoarc; b=moF0yAcqWNPwH8y0IFoE7t7Ve0tNetxcmc83QHsCil9nyfL70TwxSfVl2jUvumsTINzfi1bnEm4pTuLfX5gULwo0iKeAAb4i2SNvyXbkhjc1PeRSHmRO3JjCLuzwE8qxN2Pf6d/Hf3dqIqbPj+QcAlion9kAMTtMQ3RBOlTFfgU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556524911; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To:ARC-Authentication-Results; bh=kS6chFVuGCRvIcH93NSgyM8IFRVQHiFAzTZWgA31dcA=; b=Vl7XzEn91L+NU71GYJzU9aYR64fXeocuActNegDnjh78efstDIKfB8Ws+ZcK1lZDH/CTdum0R5aZ2tZEcYd6MOSXKnffrP+7sAgRbjgTD9nErvNiq4rynxGc98NX+2N/roY6yaVLpvlwYjo6SHw8aoxSYv9Tc+soWzkqExt0s7s= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+39749+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1556524911757606.5909812887069; Mon, 29 Apr 2019 01:01:51 -0700 (PDT) Return-Path: X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by groups.io with SMTP; Mon, 29 Apr 2019 01:01:50 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 01:01:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,408,1549958400"; d="scan'208";a="139699017" X-Received: from shwdepsi1121.ccr.corp.intel.com ([10.239.158.47]) by orsmga006.jf.intel.com with ESMTP; 29 Apr 2019 01:01:49 -0700 From: "Bob Feng" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [Patch] BaseTools: Add GCC flags to Basetool build. Date: Mon, 29 Apr 2019 16:01:43 +0800 Message-Id: <20190429080144.11700-1-bob.c.feng@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,bob.c.feng@intel.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1556524911; bh=pr6+kaTdzrHDVIixMH7Tef7HkVKenFkV4Hzwy6MkPa4=; h=Cc:Date:From:Reply-To:Subject:To; b=l7Fzw2yb5R0sMMaG6uXYjqfTbZkwo+lXJw4PsMee41g778kr/YF95Qwq3CC0czynIwy lNEHREYX0noP48N1cHOI3Jaiytpanbix7b/6zYcbtd6M3vajHqhfnMOPfodj0HDUh6vyd mLFhPPNGzkfHbbgtiydcXBOvRFhPF+6S3Ko= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1764 Some compiler flags restrict the compiler from making arbitrary decisions while handling undefined C/C++ behaviors. Therefore they can be used to fix some issues caused by undefined behavior. For example, for GCC, the following flags are available: -fno-strict-overflow tells the compiler NOT to assume that signed overflow does not occur. -fno-delete-null-pointer-checks tells the compiler NOT to assume that null pointer deference does not exist. -fwrapv tells the compiler that signed overflow always wraps. This patch is going to add these 3 build options to BaseTool GCC build option. Signed-off-by: Bob Feng Cc: Liming Gao --- BaseTools/Source/C/Makefiles/header.makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Sourc= e/C/Makefiles/header.makefile index 90fb3453ad..f1aed62769 100644 --- a/BaseTools/Source/C/Makefiles/header.makefile +++ b/BaseTools/Source/C/Makefiles/header.makefile @@ -68,11 +68,11 @@ BUILD_OPTFLAGS =3D -O2 $(EXTRA_OPTFLAGS) =20 ifeq ($(DARWIN),Darwin) # assume clang or clang compatible flags on OS X BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno= -deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g else -BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno= -deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused= -result -nostdlib -g +BUILD_CFLAGS =3D -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno= -deprecated-declarations -Wno-stringop-truncation -Wno-restrict -Wno-unused= -result -nostdlib -g -fwrapv -fno-delete-null-pointer-checks -fno-strict-ov= erflow endif BUILD_LFLAGS =3D BUILD_CXXFLAGS =3D -Wno-unused-result =20 ifeq ($(HOST_ARCH), IA32) --=20 2.20.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#39749): https://edk2.groups.io/g/devel/message/39749 Mute This Topic: https://groups.io/mt/31381008/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-