From nobody Mon Apr 29 03:36:49 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+45759+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+45759+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921682; cv=none; d=zoho.com; s=zohoarc; b=So6Fs1AYTICfsYAoRenPYFhLMNtjV/QBqQomFzNpLD56GwYi5l0+DEeknLBCK+GqRQYWKOe1eeZ56anpDilkZUWuSQ39xnWTWhmcFOswOqsgl2zvV0d8PEmzZLCElzeBM5vtIeCwzrfuWNyUB3IzoUsByic6R5C46VHR7FlHLJI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921682; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=qa/uiAKGFPZp3AbYAPEP1I+mnqivK2h9AkYlYd7Py/w=; b=PID+T292FGDonPCuVUCvoYwgbRph+44F0Dctfyj3BpIndrRjXhxdzApa85RJNTL6XMR+0Lzkeb8zIuCybwfRgjTju2P3EBjdampxzC1qpxKb3QWhn4hGpAEDI1nPfRKsjWZdnPq2Vn7YDwgBhV8WZgu0WST/zJ4eqlSGNHF4yPI= 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+45759+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 1565921681937444.5842845019081; Thu, 15 Aug 2019 19:14:41 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406942" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:40 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Hao A Wu Subject: [edk2-devel] [Patch V4 01/10] EmulatorPkg: Fix VS20xx IA32 boot failure Date: Thu, 15 Aug 2019 19:14:28 -0700 Message-Id: <20190816021437.7516-2-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921681; bh=yHfPIbIJCTLcTnIlZYJAdKfiNglQQDJLaYQO/jcKe80=; h=Cc:Date:From:Reply-To:Subject:To; b=sYZpZbQDnGy3BVSJNSIGAb629zlsDAihsN1PFowIUueoQInNz8XJiLbpVkHXxo1i3jR aiziFk/3Ku+l+UfpskgU8ZS/VKWIytc/m+tIbD7ksrLhs/6QcORcfXX6r9M0C1hVzrTkq b/on9U5NTYqBFPZQixqN5+xjGne8z2P2eho= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D2056 The IA32 build of the EmulatorPkg for VS20xx does not boot because the default value of PCD PcdPeiServicesTablePage rarely succeeds to be mapped on IA32 Windows Host Environments. Change the DEC default value for this PCD to a value that is compatible with Windows and POSIX host environments for IA32 and X64. For IA32 builds, this 64-bit PCD is truncated to a 32-bit value. PcdPeiServicesTablePage is changed from 0x1003000000 to 0x1013000000. With this new value, no boot failures are observed. However, the use of this hard coded value can potentially cause a boot failure if this address specified by the PCD is already allocated in the user process. Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Michael D Kinney Reviewed-by: Hao A Wu Reviewed-by: Jordan Justen --- EmulatorPkg/EmulatorPkg.dec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EmulatorPkg/EmulatorPkg.dec b/EmulatorPkg/EmulatorPkg.dec index c36f2c4186..99250d9fe5 100644 --- a/EmulatorPkg/EmulatorPkg.dec +++ b/EmulatorPkg/EmulatorPkg.dec @@ -2,7 +2,7 @@ # # This is the Emu Emulation Environment Platform # -# Copyright (c) 2008 - 2011, Intel Corporation. All rights reserved.
+# Copyright (c) 2008 - 2019, Intel Corporation. All rights reserved.
# Portions copyright (c) 2011, Apple Inc. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -66,7 +66,7 @@ [PcdsFixedAtBuild] gEmulatorPkgTokenSpaceGuid.PcdEmuApCount|L"0"|VOID*|0x00001019 =20 ## Magic page to implement PEI Services Table Pointer Lib - gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage|0x1003000000|UINT64|0= x0000101b + gEmulatorPkgTokenSpaceGuid.PcdPeiServicesTablePage|0x1013000000|UINT64|0= x0000101b =20 ## Size of the packet filter gEmulatorPkgTokenSpaceGuid.PcdNetworkPacketFilterSize|524288|UINT32|0x00= 00101c --=20 2.21.0.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 (#45759): https://edk2.groups.io/g/devel/message/45759 Mute This Topic: https://groups.io/mt/32894346/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- From nobody Mon Apr 29 03:36:49 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+45760+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+45760+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921682; cv=none; d=zoho.com; s=zohoarc; b=KUkbG45KPa0ccgOPOqLWBZnfN0hGuaCGJACF8NyoFHSuRt17VbrGJxkm2dTzTqf8riALPESZwA24tIsI/BhXmdAT9lAqnY0PfMnv3lvkymMqNJUtq4mUxsErfTwgSChk1wXLFQ/ejhqlzAX40PXt30IpTsk/bQj/P4+JF10rW2k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921682; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=kurX2CUuWSHe/huLycNg0YXYV7EjFq5IORVY/EZCnAE=; b=bB/OcBNMhWS0EnsN4exZTFwfdvru8s2X5/7db+DWV2BP4MHRNkVTjkigyZpPi4r1nFTHsNI/jL7DK2OnC7jDR0YonCp2lL4lDJ3I9odF7JnD7/jMqfmZR5t5b9rznhddjVzcvJIxKDkgl+saxTItrUKTZo/hQZfhfTZYZ69Op1c= 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+45760+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 1565921682389236.1726091931041; Thu, 15 Aug 2019 19:14:42 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406945" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:40 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Hao A Wu Subject: [edk2-devel] [Patch V4 02/10] EmulatorPkg: Remove UNIX_SEC_BUILD/WIN_SEC_BUILD Date: Thu, 15 Aug 2019 19:14:29 -0700 Message-Id: <20190816021437.7516-3-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921682; bh=d3EVGyPUc0C89ru3ZQ9RP4ZYKDwQl526Yr0+fz5SBTo=; h=Cc:Date:From:Reply-To:Subject:To; b=PNiJSdzY7oaaD1JmXW5YywvMGh+52FTq6JfqtJcVfDaPN7cBxrwo+69VD5XaVkEPwCU iZrBPyyIZoIyVIcyj65j1oGWpalioJdG8Snc9vqp2QBI5RjW7sSJFOmd4Yk6KACWlh26X MS9PSYe8Ns53qslqTOdzNA32FymR7aHKO60= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D2055 Remove the use of the defines UNIX_SEC_BUILD and WIN_SEC_BUILD. This simplifies the build command for the EmulatorPkg. Instead, use !if statements in the DSC file using $(ARCH) and $(FAMILY) to determine if the build is for a Windows or POSIX environment. The Readme.md, BAT, and sh files are also updated to remove the use of these defines. Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Michael D Kinney Reviewed-by: Hao A Wu Reviewed-by: Jordan Justen --- EmulatorPkg/EmulatorPkg.dsc | 26 +++++++++++++------------- EmulatorPkg/Readme.md | 8 ++++---- EmulatorPkg/Win/VS2017/BuildVS.bat | 2 +- EmulatorPkg/build.sh | 8 ++++---- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index ea8b6ce76e..153da464f1 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -4,7 +4,7 @@ # The Emulation Platform can be used to debug individual modules, prior to= creating # a real platform. This also provides an example for how an DSC is created. # -# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
# Portions copyright (c) 2010 - 2011, Apple Inc. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -236,18 +236,18 @@ [PcdsDynamicHii.common.DEFAULT] gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVar= iableGuid|0x0|10 =20 [Components] -!ifdef $(UNIX_SEC_BUILD) - ## - # Emulator, OS POSIX application - ## - EmulatorPkg/Unix/Host/Host.inf -!endif - -!ifdef $(WIN_SEC_BUILD) - ## - # Emulator, OS WIN application - ## - EmulatorPkg/Win/Host/WinHost.inf +!if "IA32" in $(ARCH) || "X64" in $(ARCH) + !if "MSFT" in $(FAMILY) + ## + # Emulator, OS WIN application + ## + EmulatorPkg/Win/Host/WinHost.inf + !else + ## + # Emulator, OS POSIX application + ## + EmulatorPkg/Unix/Host/Host.inf + !endif !endif =20 !ifndef $(SKIP_MAIN_BUILD) diff --git a/EmulatorPkg/Readme.md b/EmulatorPkg/Readme.md index 461975e859..5ea61ca7ab 100644 --- a/EmulatorPkg/Readme.md +++ b/EmulatorPkg/Readme.md @@ -21,19 +21,19 @@ https://github.com/tianocore/tianocore.github.io/wiki/E= mulatorPkg **You can use the following command to build.** * 32bit emulator in Windows: =20 - `build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 -D WIN_SEC_BUILD -a IA= 32` + `build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 -a IA32` =20 * 64bit emulator in Windows: =20 - `build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 -D WIN_SEC_BUILD -a X6= 4` + `build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 -a X64` =20 * 32bit emulator in Linux: =20 - `build -p EmulatorPkg\EmulatorPkg.dsc -t GCC5 -D UNIX_SEC_BUILD -a IA3= 2` + `build -p EmulatorPkg\EmulatorPkg.dsc -t GCC5 -a IA32` =20 * 64bit emulator in Linux: =20 - `build -p EmulatorPkg\EmulatorPkg.dsc -t GCC5 -D UNIX_SEC_BUILD -a X64` + `build -p EmulatorPkg\EmulatorPkg.dsc -t GCC5 -a X64` =20 **You can start/run the emulator using the following command:** * 32bit emulator in Windows: diff --git a/EmulatorPkg/Win/VS2017/BuildVS.bat b/EmulatorPkg/Win/VS2017/Bu= ildVS.bat index 83aebc77dc..6fcf40cc0a 100644 --- a/EmulatorPkg/Win/VS2017/BuildVS.bat +++ b/EmulatorPkg/Win/VS2017/BuildVS.bat @@ -1,3 +1,3 @@ cd ../../../ @call edksetup.bat -build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 -D WIN_SEC_BUILD %* +build -p EmulatorPkg\EmulatorPkg.dsc -t VS2017 %* diff --git a/EmulatorPkg/build.sh b/EmulatorPkg/build.sh index 2dab035ed5..60056e1b6c 100755 --- a/EmulatorPkg/build.sh +++ b/EmulatorPkg/build.sh @@ -233,13 +233,13 @@ fi =20 case $CLEAN_TYPE in clean) - build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc -a $PROCESSOR -b $BUIL= DTARGET -t $HOST_TOOLS -D UNIX_SEC_BUILD -n 3 clean + build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc -a $PROCESSOR -b $BUIL= DTARGET -t $HOST_TOOLS -n 3 clean build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc -a $PROCESSOR -b $BUIL= DTARGET -t $TARGET_TOOLS -n 3 clean exit $? ;; cleanall) make -C $WORKSPACE/BaseTools clean - build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc -a $PROCESSOR -b $BUIL= DTARGET -t $HOST_TOOLS -D UNIX_SEC_BUILD -n 3 clean + build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc -a $PROCESSOR -b $BUIL= DTARGET -t $HOST_TOOLS -n 3 clean build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc -a $PROCESSOR -b $BUIL= DTARGET -t $TARGET_TOOLS -n 3 clean build -p $WORKSPACE/ShellPkg/ShellPkg.dsc -a IA32 -b $BUILDTARGET -t $= TARGET_TOOLS -n 3 clean exit $? @@ -251,9 +251,9 @@ esac # Build the edk2 EmulatorPkg # if [[ $HOST_TOOLS =3D=3D $TARGET_TOOLS ]]; then - build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc $BUILD_OPTIONS -a $PROCE= SSOR -b $BUILDTARGET -t $TARGET_TOOLS -D BUILD_$ARCH_SIZE -D UNIX_SEC_BUILD= $NETWORK_SUPPORT $BUILD_NEW_SHELL $BUILD_FAT -n 3 + build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc $BUILD_OPTIONS -a $PROCE= SSOR -b $BUILDTARGET -t $TARGET_TOOLS -D BUILD_$ARCH_SIZE $NETWORK_SUPPORT = $BUILD_NEW_SHELL $BUILD_FAT -n 3 else - build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc $BUILD_OPTIONS -a $PROCE= SSOR -b $BUILDTARGET -t $HOST_TOOLS -D BUILD_$ARCH_SIZE -D UNIX_SEC_BUILD = -D SKIP_MAIN_BUILD -n 3 modules + build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc $BUILD_OPTIONS -a $PROCE= SSOR -b $BUILDTARGET -t $HOST_TOOLS -D BUILD_$ARCH_SIZE -D SKIP_MAIN_BUILD= -n 3 modules build -p $WORKSPACE/EmulatorPkg/EmulatorPkg.dsc $BUILD_OPTIONS -a $PROCE= SSOR -b $BUILDTARGET -t $TARGET_TOOLS -D BUILD_$ARCH_SIZE $NETWORK_SUPPORT = $BUILD_NEW_SHELL $BUILD_FAT -n 3 cp "$BUILD_OUTPUT_DIR/${BUILDTARGET}_$HOST_TOOLS/$PROCESSOR/Host" $BUILD= _ROOT_ARCH fi --=20 2.21.0.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 (#45760): https://edk2.groups.io/g/devel/message/45760 Mute This Topic: https://groups.io/mt/32894347/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- From nobody Mon Apr 29 03:36:49 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+45761+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+45761+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921682; cv=none; d=zoho.com; s=zohoarc; b=Lar/TQr6n4IYInn/d932JjF7A4dPjC9YvsgHGWhDNPh+/PIcJ3MtL64x0FLXEC6zAo+0DAPJvVzMDaGsJN8yZP3WemxrQwm3iYwGCJ7maO8U4ofL5iRCcZadzOkRDo00iXT5wB3JYohsfujUorPjFWAA2t+I9zzSK4FF0jEYgFg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921682; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=7wzd74KXNSvSIuYiDIMES6K/1FKAqLMft05VSs2TFmA=; b=KYOcjAdaiKQp7e6oE21gcrpNaSJsStJQMzUFmZHiyQ4qVK4oJlKqYECob9dz2JT0eFu2yq7yzxY9Nw4BJ/FqqP7ahzz+izdOU7mA4laa3rMOPAAfSbU5h1QhbZzlTi/HgwwhqLJuTsu1LJCgcytNToPp5ZXZVIC86PZlsIPJIq8= 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+45761+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 1565921682708276.74859611295244; Thu, 15 Aug 2019 19:14:42 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:41 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406949" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:40 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Hao A Wu Subject: [edk2-devel] [Patch V4 03/10] EmulatorPkg: Add -D DISABLE_NEW_DEPRECATED_INTERFACES Date: Thu, 15 Aug 2019 19:14:30 -0700 Message-Id: <20190816021437.7516-4-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921682; bh=/EBkygom0kb3SYdeGqBN2BOf/Ypd1zrbkqud1IkQRfI=; h=Cc:Date:From:Reply-To:Subject:To; b=HYemE3pMZeKgGWNjMRERYZaK5dExWTQmqXSbn3Ueu1kYQeV49059xp/KjE+su8E9ERf ZGUcN5lv5ytzaGUIt5isnRCIFCRZn+zrsumqwIg+r51+F1jN3yLGx5DbX7ETRn/S6gNXG eMCL8vF/geugJkbAOy7Z3joa2tx1CmD74JM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D162 Update EmulatorPkg specific modules and libraries to use safe string functions in BaseLib and safe PcdSetxx() functions in PcdLib. With these updates, the define DISABLE_NEW_DEPRECATED_INTERFACES is enabled in the DSC file. Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Michael D Kinney Reviewed-by: Hao A Wu Acked-by: Jordan Justen --- EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.c | 9 +- EmulatorPkg/EmulatorPkg.dsc | 6 +- EmulatorPkg/FlashMapPei/FlashMapPei.c | 8 +- EmulatorPkg/Library/SmbiosLib/SmbiosLib.c | 4 +- .../ThunkProtocolList/ThunkProtocolList.c | 11 +- EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c | 10 +- EmulatorPkg/Unix/Host/PosixFileSystem.c | 80 ++++++++---- EmulatorPkg/Unix/Host/X11GraphicsWindow.c | 4 +- EmulatorPkg/Win/Host/WinFileSystem.c | 116 ++++++++++++------ 9 files changed, 172 insertions(+), 76 deletions(-) diff --git a/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.c b/EmulatorPkg/Em= uBusDriverDxe/EmuBusDriverDxe.c index 0bf6e723a1..d8380f2be9 100644 --- a/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.c +++ b/EmulatorPkg/EmuBusDriverDxe/EmuBusDriverDxe.c @@ -1,7 +1,7 @@ /** @file Emu Bus driver =20 -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Portions copyright (c) 2011, Apple Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -256,7 +256,12 @@ EmuBusDriverBindingStart ( =20 EmuDevice->ControllerNameTable =3D NULL; =20 - StrnCpy (ComponentName, EmuIoThunk->ConfigString, sizeof (ComponentN= ame)/sizeof (CHAR16)); + StrnCpyS ( + ComponentName, + sizeof (ComponentName) / sizeof (CHAR16), + EmuIoThunk->ConfigString, + sizeof (ComponentName) / sizeof (CHAR16) + ); =20 EmuDevice->DevicePath =3D EmuBusCreateDevicePath ( ParentDevicePath, diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 153da464f1..529adfe1fa 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -408,10 +408,14 @@ [Components] !include NetworkPkg/Network.dsc.inc =20 [BuildOptions] + # + # Disable deprecated APIs. + # + *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES + MSFT:DEBUG_*_*_CC_FLAGS =3D /Od /Oy- MSFT:NOOPT_*_*_CC_FLAGS =3D /Od /Oy- =20 MSFT:*_*_*_DLINK_FLAGS =3D /ALIGN:4096 /FILEALIGN:4096 /SUBSYSTEM:CO= NSOLE MSFT:DEBUG_*_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_ENTRY_= POINT) /BASE:0x10000 MSFT:NOOPT_*_*_DLINK_FLAGS =3D /EXPORT:InitializeDriver=3D$(IMAGE_ENTRY_= POINT) /BASE:0x10000 - diff --git a/EmulatorPkg/FlashMapPei/FlashMapPei.c b/EmulatorPkg/FlashMapPe= i/FlashMapPei.c index 2a468e43ac..7744065dd6 100644 --- a/EmulatorPkg/FlashMapPei/FlashMapPei.c +++ b/EmulatorPkg/FlashMapPei/FlashMapPei.c @@ -1,7 +1,7 @@ /*++ @file PEIM to build GUIDed HOBs for platform specific flash map =20 -Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
Portions copyright (c) 2011, Apple Inc. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -69,9 +69,9 @@ Returns: return Status; } =20 - PcdSet64 (PcdFlashNvStorageVariableBase64, PcdGet64 (PcdEmuFlashNvStorag= eVariableBase) + FdFixUp); - PcdSet64 (PcdFlashNvStorageFtwWorkingBase64, PcdGet64 (PcdEmuFlashNvStor= ageFtwWorkingBase) + FdFixUp); - PcdSet64 (PcdFlashNvStorageFtwSpareBase64, PcdGet64 (PcdEmuFlashNvStorag= eFtwSpareBase) + FdFixUp); + PcdSet64S (PcdFlashNvStorageVariableBase64, PcdGet64 (PcdEmuFlashNvStora= geVariableBase) + FdFixUp); + PcdSet64S (PcdFlashNvStorageFtwWorkingBase64, PcdGet64 (PcdEmuFlashNvSto= rageFtwWorkingBase) + FdFixUp); + PcdSet64S (PcdFlashNvStorageFtwSpareBase64, PcdGet64 (PcdEmuFlashNvStora= geFtwSpareBase) + FdFixUp); =20 return EFI_SUCCESS; } diff --git a/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c b/EmulatorPkg/Librar= y/SmbiosLib/SmbiosLib.c index 331122e200..3acbb23644 100644 --- a/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c +++ b/EmulatorPkg/Library/SmbiosLib/SmbiosLib.c @@ -4,7 +4,7 @@ =20 =20 Copyright (c) 2012, Apple Inc. All rights reserved. -Portitions Copyright (c) 2006 - 2012, Intel Corporation. All rights reserv= ed.
+Portitions Copyright (c) 2006 - 2019, Intel Corporation. All rights reserv= ed.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -223,7 +223,7 @@ SmbiosLibUpdateUnicodeString ( if (Ascii =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - UnicodeStrToAsciiStr (String, Ascii); + UnicodeStrToAsciiStrS (String, Ascii, StrSize (String)); =20 StringIndex =3D StringNumber; Status =3D gSmbios->UpdateString (gSmbios, &SmbiosHandle, &StringIndex, = Ascii); diff --git a/EmulatorPkg/Library/ThunkProtocolList/ThunkProtocolList.c b/Em= ulatorPkg/Library/ThunkProtocolList/ThunkProtocolList.c index b7aacc851c..3a7b6d1ceb 100644 --- a/EmulatorPkg/Library/ThunkProtocolList/ThunkProtocolList.c +++ b/EmulatorPkg/Library/ThunkProtocolList/ThunkProtocolList.c @@ -2,7 +2,7 @@ Emulator Thunk to abstract OS services from pure EFI code =20 Copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
- Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+ Copyright (c) 2011 - 2019, Intel Corporation. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -37,6 +37,7 @@ AddThunkProtocol ( IN BOOLEAN EmuBusDriver ) { + UINTN Size; CHAR16 *StartString; CHAR16 *SubString; UINTN Instance; @@ -47,8 +48,12 @@ AddThunkProtocol ( } =20 Instance =3D 0; - StartString =3D AllocatePool (StrSize (ConfigString)); - StrCpy (StartString, ConfigString); + Size =3D StrSize (ConfigString); + StartString =3D AllocatePool (Size); + if (StartString =3D=3D NULL) { + return EFI_OUT_OF_RESOURCES; + } + StrCpyS (StartString, Size / sizeof (CHAR16), ConfigString); while (*StartString !=3D '\0') { =20 // diff --git a/EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c b/EmulatorPkg/Uni= x/Host/BerkeleyPacketFilter.c index e318a90740..8d0eb0d197 100644 --- a/EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c +++ b/EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c @@ -4,7 +4,7 @@ =20 Tested on Mac OS X. =20 -Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
Portitions copyright (c) 2011, Apple Inc. All rights reserved. =20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -242,7 +242,7 @@ EmuSnpStart ( // // Associate our interface with this BPF file descriptor. // - AsciiStrCpy (BoundIf.ifr_name, Private->InterfaceName); + AsciiStrCpyS (BoundIf.ifr_name, sizeof (BoundIf.ifr_name), Private->In= terfaceName); if (ioctl (Private->BpfFd, BIOCSETIF, &BoundIf) < 0) { goto DeviceErrorExit; } @@ -1016,7 +1016,11 @@ GetInterfaceMacAddr ( goto Exit; } =20 - UnicodeStrToAsciiStr (Private->Thunk->ConfigString, Private->InterfaceNa= me); + UnicodeStrToAsciiStrS ( + Private->Thunk->ConfigString, + Private->InterfaceName, + StrSize (Private->Thunk->ConfigString) + ); =20 Status =3D EFI_NOT_FOUND; If =3D IfAddrs; diff --git a/EmulatorPkg/Unix/Host/PosixFileSystem.c b/EmulatorPkg/Unix/Hos= t/PosixFileSystem.c index 6ba3b59d7a..0a618abcd8 100644 --- a/EmulatorPkg/Unix/Host/PosixFileSystem.c +++ b/EmulatorPkg/Unix/Host/PosixFileSystem.c @@ -127,7 +127,11 @@ PosixOpenVolume ( if (PrivateFile->FileName =3D=3D NULL) { goto Done; } - AsciiStrCpy (PrivateFile->FileName, Private->FilePath); + AsciiStrCpyS ( + PrivateFile->FileName, + AsciiStrSize (Private->FilePath), + Private->FilePath + ); =20 PrivateFile->Signature =3D EMU_EFI_FILE_PRIVATE_SIGNATURE; PrivateFile->Thunk =3D Private->Thunk; @@ -377,7 +381,7 @@ PosixFileOpen ( EFI_FILE_INFO *Info; struct stat finfo; int res; - + UINTN Size; =20 PrivateFile =3D EMU_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateRoot =3D EMU_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (Priva= teFile->SimpleFileSystem); @@ -412,17 +416,18 @@ OpenRoot: =20 CopyMem (NewPrivateFile, PrivateFile, sizeof (EMU_EFI_FILE_PRIVATE)); =20 - NewPrivateFile->FileName =3D malloc (AsciiStrSize (PrivateFile->FileName= ) + 1 + StrLen (FileName) + 1); + Size =3D AsciiStrSize (PrivateFile->FileName) + 1 + StrLen (FileName) + = 1; + NewPrivateFile->FileName =3D malloc (Size); if (NewPrivateFile->FileName =3D=3D NULL) { goto Done; } =20 if (*FileName =3D=3D L'\\') { - AsciiStrCpy (NewPrivateFile->FileName, PrivateRoot->FilePath); + AsciiStrCpyS (NewPrivateFile->FileName, Size, PrivateRoot->FilePath); // Skip first '\'. Src =3D FileName + 1; } else { - AsciiStrCpy (NewPrivateFile->FileName, PrivateFile->FileName); + AsciiStrCpyS (NewPrivateFile->FileName, Size, PrivateFile->FileName); Src =3D FileName; } Dst =3D NewPrivateFile->FileName + AsciiStrLen (NewPrivateFile->FileName= ); @@ -748,7 +753,7 @@ PosixFileRead ( UINTN NameSize; UINTN ResultSize; CHAR8 *FullFileName; - + UINTN FullFileNameSize; =20 PrivateFile =3D EMU_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); =20 @@ -798,15 +803,16 @@ PosixFileRead ( =20 *BufferSize =3D ResultSize; =20 - FullFileName =3D malloc (AsciiStrLen(PrivateFile->FileName) + 1 + NameSi= ze); + FullFileNameSize =3D AsciiStrLen(PrivateFile->FileName) + 1 + NameSize; + FullFileName =3D malloc (FullFileNameSize); if (FullFileName =3D=3D NULL) { Status =3D EFI_OUT_OF_RESOURCES; goto Done; } =20 - AsciiStrCpy (FullFileName, PrivateFile->FileName); - AsciiStrCat (FullFileName, "/"); - AsciiStrCat (FullFileName, PrivateFile->Dirent->d_name); + AsciiStrCpyS (FullFileName, FullFileNameSize, PrivateFile->FileName); + AsciiStrCatS (FullFileName, FullFileNameSize, "/"); + AsciiStrCatS (FullFileName, FullFileNameSize, PrivateFile->Dirent->d_nam= e); Status =3D UnixSimpleFileSystemFileInfo ( PrivateFile, FullFileName, @@ -1017,7 +1023,11 @@ PosixFileGetInfo ( FileSystemInfoBuffer->BlockSize =3D buf.f_bsize; =20 =20 - StrCpy ((CHAR16 *) FileSystemInfoBuffer->VolumeLabel, PrivateRoot->Vol= umeLabel); + StrCpyS ( + (CHAR16 *) FileSystemInfoBuffer->VolumeLabel, + (*BufferSize - SIZE_OF_EFI_FILE_SYSTEM_INFO) / sizeof (CHAR16), + PrivateRoot->VolumeLabel + ); *BufferSize =3D SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->V= olumeLabel); =20 } else if (CompareGuid (InformationType, &gEfiFileSystemVolumeLabelInfoI= dGuid)) { @@ -1026,7 +1036,11 @@ PosixFileGetInfo ( return EFI_BUFFER_TOO_SMALL; } =20 - StrCpy ((CHAR16 *) Buffer, PrivateRoot->VolumeLabel); + StrCpyS ( + (CHAR16 *) Buffer, + *BufferSize / sizeof (CHAR16), + PrivateRoot->VolumeLabel + ); *BufferSize =3D StrSize (PrivateRoot->VolumeLabel); =20 } @@ -1082,7 +1096,7 @@ PosixFileSetInfo ( CHAR16 *UnicodeFilePtr; int UnixStatus; struct utimbuf Utime; - + UINTN Size; =20 PrivateFile =3D EMU_EFI_FILE_PRIVATE_DATA_FROM_THIS (This); PrivateRoot =3D EMU_SIMPLE_FILE_SYSTEM_PRIVATE_DATA_FROM_THIS (PrivateFi= le->SimpleFileSystem); @@ -1110,7 +1124,11 @@ PosixFileSetInfo ( goto Done; } =20 - StrCpy (PrivateRoot->VolumeLabel, NewFileSystemInfo->VolumeLabel); + StrCpyS ( + PrivateRoot->VolumeLabel, + StrSize (NewFileSystemInfo->VolumeLabel) / sizeof (CHAR16), + NewFileSystemInfo->VolumeLabel + ); =20 Status =3D EFI_SUCCESS; goto Done; @@ -1125,7 +1143,11 @@ PosixFileSetInfo ( goto Done; } =20 - StrCpy (PrivateRoot->VolumeLabel, (CHAR16 *) Buffer); + StrCpyS ( + PrivateRoot->VolumeLabel, + StrSize (PrivateRoot->VolumeLabel) / sizeof (CHAR16), + (CHAR16 *) Buffer + ); =20 Status =3D EFI_SUCCESS; goto Done; @@ -1183,28 +1205,34 @@ PosixFileSetInfo ( goto Done; } =20 - AsciiStrCpy (OldFileName, PrivateFile->FileName); + AsciiStrCpyS ( + OldFileName, + AsciiStrSize (PrivateFile->FileName), + PrivateFile->FileName + ); =20 // // Make full pathname from new filename and rootpath. // if (NewFileInfo->FileName[0] =3D=3D '\\') { - NewFileName =3D malloc (AsciiStrLen (PrivateRoot->FilePath) + 1 + StrL= en (NewFileInfo->FileName) + 1); + Size =3D AsciiStrLen (PrivateRoot->FilePath) + 1 + StrLen (NewFileInfo= ->FileName) + 1; + NewFileName =3D malloc (Size); if (NewFileName =3D=3D NULL) { goto Done; } =20 - AsciiStrCpy (NewFileName, PrivateRoot->FilePath); + AsciiStrCpyS (NewFileName, Size, PrivateRoot->FilePath); AsciiFilePtr =3D NewFileName + AsciiStrLen(NewFileName); UnicodeFilePtr =3D NewFileInfo->FileName + 1; *AsciiFilePtr++ =3D'/'; } else { - NewFileName =3D malloc (AsciiStrLen (PrivateFile->FileName) + 2 + StrL= en (NewFileInfo->FileName) + 1); + Size =3D AsciiStrLen (PrivateFile->FileName) + 2 + StrLen (NewFileInfo= ->FileName) + 1; + NewFileName =3D malloc (Size); if (NewFileName =3D=3D NULL) { goto Done; } =20 - AsciiStrCpy (NewFileName, PrivateRoot->FilePath); + AsciiStrCpyS (NewFileName, Size, PrivateRoot->FilePath); AsciiFilePtr =3D NewFileName + AsciiStrLen(NewFileName); if ((AsciiFilePtr[-1] !=3D '/') && (NewFileInfo->FileName[0] !=3D '/')= ) { // make sure there is a / between Root FilePath and NewFileInfo File= name @@ -1312,7 +1340,11 @@ PosixFileSetInfo ( goto Done; } =20 - AsciiStrCpy (PrivateFile->FileName, NewFileName); + AsciiStrCpyS ( + PrivateFile->FileName, + AsciiStrSize (NewFileName), + NewFileName + ); } else { Status =3D EFI_DEVICE_ERROR; goto Done; @@ -1493,7 +1525,11 @@ PosixFileSystmeThunkOpen ( free (Private); return EFI_OUT_OF_RESOURCES; } - StrCpy (Private->VolumeLabel, L"EFI_EMULATED"); + StrCpyS ( + Private->VolumeLabel, + StrSize (L"EFI_EMULATED") / sizeof (CHAR16), + L"EFI_EMULATED" + ); =20 Private->Signature =3D EMU_SIMPLE_FILE_SYSTEM_PRIVATE_SIGNATURE; Private->Thunk =3D This; diff --git a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c b/EmulatorPkg/Unix/H= ost/X11GraphicsWindow.c index 9d03c13011..5325a0e35b 100644 --- a/EmulatorPkg/Unix/Host/X11GraphicsWindow.c +++ b/EmulatorPkg/Unix/Host/X11GraphicsWindow.c @@ -1,6 +1,6 @@ /*++ @file =20 -Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
Portions copyright (c) 2008 - 2011, Apple Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent @@ -957,7 +957,7 @@ X11GraphicsWindowOpen ( XDefineCursor (Drv->display, Drv->win, XCreateFontCursor (Drv->display, = XC_pirate)); =20 Drv->Title =3D malloc (StrSize (This->ConfigString)); - UnicodeStrToAsciiStr (This->ConfigString, Drv->Title); + UnicodeStrToAsciiStrS (This->ConfigString, Drv->Title, StrSize (This->Co= nfigString)); XStoreName (Drv->display, Drv->win, Drv->Title); =20 // XAutoRepeatOff (Drv->display); diff --git a/EmulatorPkg/Win/Host/WinFileSystem.c b/EmulatorPkg/Win/Host/Wi= nFileSystem.c index da6595228d..aab926889e 100644 --- a/EmulatorPkg/Win/Host/WinFileSystem.c +++ b/EmulatorPkg/Win/Host/WinFileSystem.c @@ -1,7 +1,7 @@ /*++ @file Support OS native directory access. =20 -Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 =20 @@ -205,8 +205,14 @@ WinNtOpenVolume ( goto Done; } =20 - StrCpy (PrivateFile->FilePath, Private->FilePath); - StrCpy (PrivateFile->FileName, PrivateFile->FilePath); + StrCpyS (PrivateFile->FilePath, + StrSize (Private->FilePath) / sizeof (CHAR16), + Private->FilePath + ); + StrCpyS (PrivateFile->FileName, + StrSize (Private->FilePath) / sizeof (CHAR16), + PrivateFile->FilePath + ); PrivateFile->Signature =3D WIN_NT_EFI_FILE_PRIVATE_SIGNATURE; PrivateFile->Thunk =3D Private->Thunk; PrivateFile->SimpleFileSystem =3D This; @@ -243,8 +249,8 @@ WinNtOpenVolume ( if (TempFileName =3D=3D NULL) { goto Done; } - StrCpy (TempFileName, PrivateFile->FilePath); - StrCat (TempFileName, L"\\*"); + StrCpyS (TempFileName, Size / sizeof (CHAR16), PrivateFile->FilePath); + StrCatS (TempFileName, Size / sizeof (CHAR16), L"\\*"); =20 PrivateFile->LHandle =3D FindFirstFile (TempFileName, &PrivateFile->Find= Buf); FreePool (TempFileName); @@ -362,7 +368,7 @@ GetNextFileNameToken ( } else { Offset =3D SlashPos - *FileName; Token =3D AllocateZeroPool ((Offset + 1) * sizeof (CHAR16)); - StrnCpy (Token, *FileName, Offset); + StrnCpyS (Token, Offset + 1, *FileName, Offset); // // Point *FileName to the next character after L'\'. // @@ -496,7 +502,7 @@ WinNtFileOpen ( if (TempFileName =3D=3D NULL) { return EFI_OUT_OF_RESOURCES; } - StrCpy (TempFileName, FileName); + StrCpyS (TempFileName, StrSize (FileName) / sizeof (CHAR16), FileName); FileName =3D TempFileName; =20 if (FileName[StrLen (FileName) - 1] =3D=3D L'\\') { @@ -548,9 +554,17 @@ WinNtFileOpen ( } =20 if (PrivateFile->IsDirectoryPath) { - StrCpy (NewPrivateFile->FilePath, PrivateFile->FileName); + StrCpyS ( + NewPrivateFile->FilePath, + StrSize (PrivateFile->FileName) / sizeof (CHAR16), + PrivateFile->FileName + ); } else { - StrCpy (NewPrivateFile->FilePath, PrivateFile->FilePath); + StrCpyS ( + NewPrivateFile->FilePath, + StrSize (PrivateFile->FileName) / sizeof (CHAR16), + PrivateFile->FilePath + ); } =20 Size =3D StrSize (NewPrivateFile->FilePath); @@ -563,17 +577,17 @@ WinNtFileOpen ( } =20 if (*FileName =3D=3D L'\\') { - StrCpy (NewPrivateFile->FileName, PrivateRoot->FilePath); - StrCat (NewPrivateFile->FileName, L"\\"); - StrCat (NewPrivateFile->FileName, FileName + 1); + StrCpyS (NewPrivateFile->FileName, Size / sizeof (CHAR16), PrivateRoot= ->FilePath); + StrCatS (NewPrivateFile->FileName, Size / sizeof (CHAR16), L"\\"); + StrCatS (NewPrivateFile->FileName, Size / sizeof (CHAR16), FileName + = 1); } else { - StrCpy (NewPrivateFile->FileName, NewPrivateFile->FilePath); + StrCpyS (NewPrivateFile->FileName, Size / sizeof (CHAR16), NewPrivateF= ile->FilePath); if (StrCmp (FileName, L"") !=3D 0) { // // In case the filename becomes empty, especially after trimming dot= s and blanks // - StrCat (NewPrivateFile->FileName, L"\\"); - StrCat (NewPrivateFile->FileName, FileName); + StrCatS (NewPrivateFile->FileName, Size / sizeof (CHAR16), L"\\"); + StrCatS (NewPrivateFile->FileName, Size / sizeof (CHAR16), FileName); } } =20 @@ -657,7 +671,11 @@ WinNtFileOpen ( goto Done; } =20 - StrCpy (NewPrivateFile->FilePath, NewPrivateFile->FileName); + StrCpyS ( + NewPrivateFile->FilePath, + StrSize (NewPrivateFile->FileName) / sizeof (CHAR16), + NewPrivateFile->FileName + ); if (TempChar !=3D 0) { *(RealFileName - 1) =3D TempChar; } @@ -715,7 +733,7 @@ WinNtFileOpen ( goto Done; } =20 - StrCpy (TempFileName, NewPrivateFile->FileName); + StrCpyS (TempFileName, Size / sizeof (CHAR16), NewPrivateFile->FileNam= e); =20 if ((OpenMode & EFI_FILE_MODE_CREATE)) { // @@ -769,7 +787,7 @@ WinNtFileOpen ( // // Find the first file under it // - StrCat (TempFileName, L"\\*"); + StrCatS (TempFileName, Size / sizeof (CHAR16), L"\\*"); NewPrivateFile->LHandle =3D FindFirstFile (TempFileName, &NewPrivateFi= le->FindBuf); FreePool (TempFileName); =20 @@ -1330,8 +1348,8 @@ WinNtFileSetPossition ( goto Done; } =20 - StrCpy (FileName, PrivateFile->FileName); - StrCat (FileName, L"\\*"); + StrCpyS (FileName, Size / sizeof (CHAR16), PrivateFile->FileName); + StrCatS (FileName, Size / sizeof (CHAR16), L"\\*"); =20 if (PrivateFile->LHandle !=3D INVALID_HANDLE_VALUE) { FindClose (PrivateFile->LHandle); @@ -1599,7 +1617,11 @@ WinNtFileGetInfo ( goto Done; } =20 - StrCpy (DriveName, PrivateFile->FilePath); + StrCpyS ( + DriveName, + (StrSize (PrivateFile->FilePath) + 1) / sizeof (CHAR16), + PrivateFile->FilePath + ); for (Index =3D 0; DriveName[Index] !=3D 0 && DriveName[Index] !=3D ':'= ; Index++) { ; } @@ -1664,7 +1686,11 @@ WinNtFileGetInfo ( } } =20 - StrCpy ((CHAR16 *)FileSystemInfoBuffer->VolumeLabel, PrivateRoot->Volu= meLabel); + StrCpyS ( + (CHAR16 *)FileSystemInfoBuffer->VolumeLabel, + (*BufferSize - SIZE_OF_EFI_FILE_SYSTEM_INFO) / sizeof (CHAR16), + PrivateRoot->VolumeLabel + ); *BufferSize =3D SIZE_OF_EFI_FILE_SYSTEM_INFO + StrSize (PrivateRoot->V= olumeLabel); Status =3D EFI_SUCCESS; } @@ -1676,7 +1702,11 @@ WinNtFileGetInfo ( goto Done; } =20 - StrCpy ((CHAR16 *)Buffer, PrivateRoot->VolumeLabel); + StrCpyS ( + (CHAR16 *)Buffer, + *BufferSize / sizeof (CHAR16), + PrivateRoot->VolumeLabel + ); *BufferSize =3D StrSize (PrivateRoot->VolumeLabel); Status =3D EFI_SUCCESS; } @@ -1768,7 +1798,11 @@ WinNtFileSetInfo ( goto Done; } =20 - StrCpy (PrivateRoot->VolumeLabel, NewFileSystemInfo->VolumeLabel); + StrCpyS ( + PrivateRoot->VolumeLabel, + StrSize (NewFileSystemInfo->VolumeLabel) / sizeof (CHAR16), + NewFileSystemInfo->VolumeLabel + ); =20 Status =3D EFI_SUCCESS; goto Done; @@ -1783,7 +1817,11 @@ WinNtFileSetInfo ( goto Done; } =20 - StrCpy (PrivateRoot->VolumeLabel, (CHAR16 *)Buffer); + StrCpyS ( + PrivateRoot->VolumeLabel, + StrSize (PrivateRoot->VolumeLabel) / sizeof (CHAR16), + (CHAR16 *)Buffer + ); =20 Status =3D EFI_SUCCESS; goto Done; @@ -1852,7 +1890,11 @@ WinNtFileSetInfo ( goto Done; } =20 - StrCpy (OldFileName, PrivateFile->FileName); + StrCpyS ( + OldFileName, + StrSize (PrivateFile->FileName) / sizeof (CHAR16), + PrivateFile->FileName + ); =20 // // Make full pathname from new filename and rootpath. @@ -1867,9 +1909,9 @@ WinNtFileSetInfo ( goto Done; } =20 - StrCpy (NewFileName, PrivateRoot->FilePath); - StrCat (NewFileName, L"\\"); - StrCat (NewFileName, NewFileInfo->FileName + 1); + StrCpyS (NewFileName, Size / sizeof (CHAR16), PrivateRoot->FilePath); + StrCatS (NewFileName, Size / sizeof (CHAR16), L"\\"); + StrCatS (NewFileName, Size / sizeof (CHAR16), NewFileInfo->FileName + = 1); } else { Size =3D StrSize (PrivateFile->FilePath); Size +=3D StrSize (L"\\"); @@ -1880,9 +1922,9 @@ WinNtFileSetInfo ( goto Done; } =20 - StrCpy (NewFileName, PrivateFile->FilePath); - StrCat (NewFileName, L"\\"); - StrCat (NewFileName, NewFileInfo->FileName); + StrCpyS (NewFileName, Size / sizeof (CHAR16), PrivateFile->FilePath); + StrCatS (NewFileName, Size / sizeof (CHAR16), L"\\"); + StrCatS (NewFileName, Size / sizeof (CHAR16), NewFileInfo->FileName); } =20 // @@ -1990,13 +2032,13 @@ WinNtFileSetInfo ( goto Done; } =20 - StrCpy (PrivateFile->FileName, NewFileName); + StrCpyS (PrivateFile->FileName, StrSize (NewFileName) / sizeof (CHAR= 16), NewFileName); =20 Size =3D StrSize (NewFileName); Size +=3D StrSize (L"\\*"); TempFileName =3D AllocatePool (Size); =20 - StrCpy (TempFileName, NewFileName); + StrCpyS (TempFileName, Size / sizeof (CHAR16), NewFileName); =20 if (!PrivateFile->IsDirectoryPath) { PrivateFile->LHandle =3D CreateFile ( @@ -2029,7 +2071,7 @@ WinNtFileSetInfo ( NULL ); =20 - StrCat (TempFileName, L"\\*"); + StrCatS (TempFileName, Size / sizeof (CHAR16), L"\\*"); PrivateFile->LHandle =3D FindFirstFile (TempFileName, &FindBuf); =20 FreePool (TempFileName); @@ -2048,7 +2090,7 @@ WinNtFileSetInfo ( Size +=3D StrSize (L"\\*"); TempFileName =3D AllocatePool (Size); =20 - StrCpy (TempFileName, OldFileName); + StrCpyS (TempFileName, Size / sizeof (CHAR16), OldFileName); =20 if (!PrivateFile->IsDirectoryPath) { PrivateFile->LHandle =3D CreateFile ( @@ -2071,7 +2113,7 @@ WinNtFileSetInfo ( NULL ); =20 - StrCat (TempFileName, L"\\*"); + StrCatS (TempFileName, Size / sizeof (CHAR16), L"\\*"); PrivateFile->LHandle =3D FindFirstFile (TempFileName, &FindBuf); } =20 --=20 2.21.0.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 (#45761): https://edk2.groups.io/g/devel/message/45761 Mute This Topic: https://groups.io/mt/32894348/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- From nobody Mon Apr 29 03:36:49 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+45762+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+45762+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921682; cv=none; d=zoho.com; s=zohoarc; b=h2NjOhaDovwb2O24szOUyellIpQ3SHjLgYBqnK5Yb0beIvps7Ze4TQC8FRufiTmi2xmjfCo0eqQDa+44aKwTaLSbX41dABcjfno0f4felbxXkr2dwgboXzANraBCGeoyAIDU8M+/jnyW73dr8wa6QZyGweJvAvuvn5y36o4eBpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921682; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=hfVwPy9URYBtKQnLEnubWsQIfETWhpYbLfM6FKVkGUM=; b=YA83rbidVvNJM4tM8AklOs54Esz59haAjWk2H0rWQAzY4O5qQ4NTZpjYmEgR+6ZtjJd8+z/kFqdkKANxhxkIJwv+ibfgXS3yezLyPC3VXcZ1J8U1fWNmpOOThUfYBMGqR0kUPuyIKgYLVeemOAUom+7O9ZhcDkvCt7BbZu0HlH0= 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+45762+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 156592168290824.327473881607148; Thu, 15 Aug 2019 19:14:42 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406957" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:41 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni , Hao A Wu Subject: [edk2-devel] [Patch V4 04/10] EmulatorPkg: Add support for NOOPT target Date: Thu, 15 Aug 2019 19:14:31 -0700 Message-Id: <20190816021437.7516-5-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921682; bh=KvmekDKBleYpv9HGbX/ZtguovROaSYbZg2DgWAg+vO8=; h=Cc:Date:From:Reply-To:Subject:To; b=kwTeoYy89OLef0MOqA7/t1KmDawTf091MF4Zm/IqwGaRUDHlgRN9Cqq9dXPp0C+H1Zk +XWTIWLmcWe7kWp8sjhBT1yXMDuKNPAwJvaTZx7AOgBrKCeBHNONneZBYP4doGAQZbopu Gg/Q4WwEL6tmwVO4R8Evnzr4X0ArgLyuxXE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add NOOPT to BUILD_TARGETS in DSC file. Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Michael D Kinney Reviewed-by: Hao A Wu Reviewed-by: Jordan Justen --- EmulatorPkg/EmulatorPkg.dsc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 529adfe1fa..0af2d1ff95 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -19,7 +19,7 @@ [Defines] OUTPUT_DIRECTORY =3D Build/Emulator$(ARCH) =20 SUPPORTED_ARCHITECTURES =3D X64|IA32 - BUILD_TARGETS =3D DEBUG|RELEASE + BUILD_TARGETS =3D DEBUG|RELEASE|NOOPT SKUID_IDENTIFIER =3D DEFAULT FLASH_DEFINITION =3D EmulatorPkg/EmulatorPkg.fdf =20 --=20 2.21.0.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 (#45762): https://edk2.groups.io/g/devel/message/45762 Mute This Topic: https://groups.io/mt/32894349/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- From nobody Mon Apr 29 03:36:49 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+45763+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+45763+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921683; cv=none; d=zoho.com; s=zohoarc; b=cnI6PC54ny+z1J6fELdhEHGGbE0u133ltJMQhOfD7NaZepB3SErQanlmlkP0gaCdOlL+wXJwEPUFiFUFlC57cbGaNaboN6b5D+g9S7lUY+KqkDQzsAtHIH3qSHUi1wv3wbpCE2+jr5Ltu7a9Kyf/QGolnrJBbP6QXXibz+Qktqc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921683; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=B1m4wfkiySrZbMB7uvkKCOghE03eeNv50uBJPFKhtDs=; b=QuxY8mUXez2CpEHg9l17AIjgd0LYZhj2ygtEHt3k7+MLC7j912r/xsIZjCuTlmPJwJHg4Bmggy+sL/KoURzP8zMmqylHR6LxmhoQwa4ji0uPAg6AwYb7sNBYvGM9CFWGhP3pYt/ut0M8CPXK60WHezcuWrSD/bMQhUSY4koDMXg= 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+45763+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 1565921683292884.584696945895; Thu, 15 Aug 2019 19:14:43 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406967" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:41 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Andrew Fish , Ray Ni Subject: [edk2-devel] [Patch V4 05/10] EmulatorPkg/Unix/Host: Disable inline/optimizations Date: Thu, 15 Aug 2019 19:14:32 -0700 Message-Id: <20190816021437.7516-6-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921682; bh=K+9q7//Ie7xRiLJakA2yVGZBpFFn7NeZOw5+GAP3Rnk=; h=Cc:Date:From:Reply-To:Subject:To; b=n/7S+i3JHqh+wbX1OsLW0GZIRaFiiTj9ZwxNllVBogNUAbH5Rv/rnuHdBxB6syOzBWn 6Jc1I7EjGIOc5O9/UdKFwHyhbdAUii8gXWvirJ0ePan31F3ttDegzMzOghU8S4wEOyyot cejQ7vRH2AVRFKZqGdnAZ/H1af3k3lIOU5k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" * Disable XCODE5 compiler optimizations fort Unix/Host. * Disable inline of SecGdbScriptBreak() to improve compatibility with XCODE5 * For X64 XCODE5 builds place output Host application in $(BIN_DIR) to match all other EmulatorPkg Host application builds. Cc: Jordan Justen Cc: Andrew Fish Cc: Ray Ni Signed-off-by: Michael D Kinney --- EmulatorPkg/Unix/Host/Host.c | 3 +++ EmulatorPkg/Unix/Host/Host.inf | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/EmulatorPkg/Unix/Host/Host.c b/EmulatorPkg/Unix/Host/Host.c index febfb1f44c..b431a4c2ed 100644 --- a/EmulatorPkg/Unix/Host/Host.c +++ b/EmulatorPkg/Unix/Host/Host.c @@ -1113,6 +1113,9 @@ DlLoadImage ( } =20 =20 +#ifdef __APPLE__ +__attribute__((noinline)) +#endif VOID SecGdbScriptBreak ( char *FileName, diff --git a/EmulatorPkg/Unix/Host/Host.inf b/EmulatorPkg/Unix/Host/Host.inf index ca4294249b..c479d2b7d0 100644 --- a/EmulatorPkg/Unix/Host/Host.inf +++ b/EmulatorPkg/Unix/Host/Host.inf @@ -137,6 +137,6 @@ [BuildOptions] XCODE:*_*_IA32_ASM_FLAGS =3D=3D -arch i386 -g =20 XCODE:*_*_X64_DLINK_PATH =3D=3D gcc - XCODE:*_*_X64_DLINK_FLAGS =3D=3D -L/usr/X11R6/lib -lXext -lX11 -framewo= rk Carbon -Wl,-no_pie + XCODE:*_*_X64_DLINK_FLAGS =3D=3D -o $(BIN_DIR)/Host -L/usr/X11R6/lib -l= Xext -lX11 -framework Carbon -Wl,-no_pie XCODE:*_*_X64_ASM_FLAGS =3D=3D -g - XCODE:*_*_X64_CC_FLAGS =3D -target x86_64-apple-darwin -I$(WORKSPACE)/E= mulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=3D__attribute__((ms_abi))" + XCODE:*_*_X64_CC_FLAGS =3D -O0 -target x86_64-apple-darwin -I$(WORKSPAC= E)/EmulatorPkg/Unix/Host/X11IncludeHack "-DEFIAPI=3D__attribute__((ms_abi))" --=20 2.21.0.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 (#45763): https://edk2.groups.io/g/devel/message/45763 Mute This Topic: https://groups.io/mt/32894350/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- From nobody Mon Apr 29 03:36:49 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+45764+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+45764+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921683; cv=none; d=zoho.com; s=zohoarc; b=aV8wie64JqBN0c38liZ13U+D0jOlgJY3fFuH5blIcNXyK05PHNKeLTh8O6t9g1G9uwlQY9oUQCftLQe7mzFQYUijFH+SgJqIe2MNlicCPudORPt4weYwY9RnKptNXZTE3njgoSWfX0uJkLSkDuoahTfn6il0ADEata5H0WqapTA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921683; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=szygIq133z+T3gtzoqQDr4gbobQ7FupgUHGphcWDvG0=; b=gB+N8ZJmZ+1bHLpU0SfO0Pz9LSQwGx9TB0N2L8X398jW9nbtchtcEka5EE1ZJD1cN4eFcwPCqvdK+BK5c1+OoJYC4l/wqMnpP68TCis4hkpWzeHf0XnqJzxkqj62tpFkkIDNm8zVGmBfk65PAMJ+a5HwmW98XFEnEFxw2teo6RI= 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+45764+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 1565921683737465.46642106616275; Thu, 15 Aug 2019 19:14:43 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:42 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406976" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:42 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Ray Ni , Andrew Fish Subject: [edk2-devel] [Patch V4 06/10] EmulatorPkg: Fix XCODE5 lldb issues Date: Thu, 15 Aug 2019 19:14:33 -0700 Message-Id: <20190816021437.7516-7-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921683; bh=Gu+IE/L1hQvY89QTwZipjYn7MMARRU+0iScKN4h3okM=; h=Cc:Date:From:Reply-To:Subject:To; b=Telr3NrOOYlyDXfH2h1SRaFdMmqkXPTfVEDOfoRPFYtncelBUb+nPrBczrmbM+n8DuY lxKozekX16sbCG+uE9YmAXtcmX+KfEyCwItFx2xkdJ1lN1bu5EtQoHDEV4sgvTR/J9Foq yy35uuL83+LbFqZz+H5Bhde9SpB3OM7mixo= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Fix scripts to support lldb symbolic debugging when using XCODE5 tool chain. Cc: Jordan Justen Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Andrew Fish Tested-by: Andrew Fish --- EmulatorPkg/Unix/lldbefi.py | 8 +++++--- EmulatorPkg/build.sh | 17 ++--------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/EmulatorPkg/Unix/lldbefi.py b/EmulatorPkg/Unix/lldbefi.py index 218326b8cb..099192d8b5 100755 --- a/EmulatorPkg/Unix/lldbefi.py +++ b/EmulatorPkg/Unix/lldbefi.py @@ -346,6 +346,7 @@ def TypePrintFormating(debugger): debugger.HandleCommand("type summary add CHAR8 --python-function lldbe= fi.CHAR8_TypeSummary") debugger.HandleCommand('type summary add --regex "CHAR8 \[[0-9]+\]" --= python-function lldbefi.CHAR8_TypeSummary') =20 + debugger.HandleCommand('setting set frame-format "frame #${frame.index= }: ${frame.pc}{ ${module.file.basename}{:${function.name}()${function.pc-of= fset}}}{ at ${line.file.fullpath}:${line.number}}\n"') =20 gEmulatorBreakWorkaroundNeeded =3D True =20 @@ -381,15 +382,16 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_d= ict): Error =3D lldb.SBError() FileNamePtr =3D frame.FindVariable ("FileName").GetValueAsUnsigned() FileNameLen =3D frame.FindVariable ("FileNameLength").GetValueAsUnsign= ed() + FileName =3D frame.thread.process.ReadCStringFromMemory (FileNamePtr, = FileNameLen, Error) if not Error.Success(): print "!ReadCStringFromMemory() did not find a %d byte C string at= %x" % (FileNameLen, FileNamePtr) # make breakpoint command contiue - frame.GetThread().GetProcess().Continue() + return False =20 debugger =3D frame.thread.process.target.debugger if frame.FindVariable ("AddSymbolFlag").GetValueAsUnsigned() =3D=3D 1: - LoadAddress =3D frame.FindVariable ("LoadAddress").GetValueAsUnsig= ned() + LoadAddress =3D frame.FindVariable ("LoadAddress").GetValueAsUnsig= ned() - 0x240 =20 debugger.HandleCommand ("target modules add %s" % FileName) print "target modules load --slid 0x%x %s" % (LoadAddress, FileNam= e) @@ -405,7 +407,7 @@ def LoadEmulatorEfiSymbols(frame, bp_loc , internal_dic= t): print "!lldb.target.RemoveModule (%s) FAILED" % SBModu= le =20 # make breakpoint command contiue - frame.thread.process.Continue() + return False =20 def GuidToCStructStr (guid, Name=3DFalse): # diff --git a/EmulatorPkg/build.sh b/EmulatorPkg/build.sh index 60056e1b6c..35912a7775 100755 --- a/EmulatorPkg/build.sh +++ b/EmulatorPkg/build.sh @@ -209,21 +209,8 @@ fi if [[ "$RUN_EMULATOR" =3D=3D "yes" ]]; then case `uname` in Darwin*) - # - # On Darwin we can't use dlopen, so we have to load the real PE/COFF= images. - # This .gdbinit script sets a breakpoint that loads symbols for the = PE/COFFEE - # images that get loaded in Host - # - if [[ "$CLANG_VER" =3D=3D *-ccc-host-triple* ]] - then - # only older versions of Xcode support -ccc-host-tripe, for newer ve= rsions - # it is -target - cp $WORKSPACE/EmulatorPkg/Unix/lldbefi.py "$BUILD_OUTPUT_DIR/${BUI= LDTARGET}_$TARGET_TOOLS/$PROCESSOR" - cd $BUILD_ROOT_ARCH; /usr/bin/lldb --source $WORKSPACE/EmulatorPkg= /Unix/lldbinit Host - exit $?=20 - else - cp $WORKSPACE/EmulatorPkg/Unix/.gdbinit "$BUILD_OUTPUT_DIR/${BUILD= TARGET}_$TARGET_TOOLS/$PROCESSOR" - fi + cd $BUILD_ROOT_ARCH; /usr/bin/lldb -o "command script import $WORKSP= ACE/EmulatorPkg/Unix/lldbefi.py" -o 'script lldb.debugger.SetAsync(True)' -= o "run" ./Host + exit $? ;; esac =20 --=20 2.21.0.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 (#45764): https://edk2.groups.io/g/devel/message/45764 Mute This Topic: https://groups.io/mt/32894351/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- From nobody Mon Apr 29 03:36:49 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+45765+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+45765+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921685; cv=none; d=zoho.com; s=zohoarc; b=OOJGlwsDAllAXqR0OdyGenK6isVh4vaNTDyWfIJbkEQzNROgwoKzFeSRbunOaEpOdH3Ft7q9jPakkKUreqY1uRqun3nbMHt6wCm3YHGuLgrgMqmW3d+qrtsFsBiywRF7p5+u4gzcFeqoI9w9nncizd1aZ+JIzeM9IUKr/awTWrY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921685; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=qXFg7EwIFG12owybqe3N6G22qCtVZnwUZ5ZF3L9KfV4=; b=iJELg2426Uxo606y7pga8i+tCpl4OQgICm0JOCJUvEEnwPLKx13l99XzhiWdLwqKBxs8D36vrxtxQ/9XV8j9X0C5VKjFV1Y/FR3yBBIyHQp8iCy7k6r/0YqJn5DpNdvUujIJd+rBQ25rrbfP7lMRtOxGkMP3zjoog6BMStfl3bk= 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+45765+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 1565921685020519.6337844948622; Thu, 15 Aug 2019 19:14:45 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:44 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406990" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:42 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Ray Ni , Andrew Fish Subject: [edk2-devel] [Patch V4 07/10] EmulatorPkg/Unix/Host: Fix BerkeleyPacketFilter.c issues Date: Thu, 15 Aug 2019 19:14:34 -0700 Message-Id: <20190816021437.7516-8-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921684; bh=tfxuQvDY74YLS1wrTpDUMMisHdm3vWBuEARUAT6e2CM=; h=Cc:Date:From:Reply-To:Subject:To; b=pZs2ib1HSLVVe1Y9xauRiOS5/PPXpSmfTTEvBC7rav+PqIydp+Ky4UTzvPYxTlVyt9B fqkaV/Ru8kq5zwAS+nObYm5DbXxFD8RZSi27NVInFJ6jn/Y+rZwgQsRiAcsTxJGu/FMVe EzAcx0L+SOAF7pAr6zzI09/WK7s5xUU+kII= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" * Fix uninitialized Private->ReadBuffer. * Remove old debug code that generates an exception. Cc: Jordan Justen Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Andrew Fish --- EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c b/EmulatorPkg/Uni= x/Host/BerkeleyPacketFilter.c index 8d0eb0d197..3013bbc86b 100644 --- a/EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c +++ b/EmulatorPkg/Unix/Host/BerkeleyPacketFilter.c @@ -216,6 +216,7 @@ EmuSnpStart ( } =20 Status =3D EFI_SUCCESS; + Private->ReadBuffer =3D NULL; if (Private->BpfFd =3D=3D 0) { Status =3D OpenBpfFileDescriptor (Private, &Private->BpfFd); if (EFI_ERROR (Status)) { @@ -766,10 +767,6 @@ EmuSnpGetStatus ( =20 Private =3D EMU_SNP_PRIVATE_DATA_FROM_THIS (This); =20 - if (TxBuf !=3D NULL) { - *((UINT8 **)TxBuf) =3D (UINT8 *)1; - } - if ( InterruptStatus !=3D NULL ) { *InterruptStatus =3D EFI_SIMPLE_NETWORK_TRANSMIT_INTERRUPT; } --=20 2.21.0.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 (#45765): https://edk2.groups.io/g/devel/message/45765 Mute This Topic: https://groups.io/mt/32894352/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- From nobody Mon Apr 29 03:36:49 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+45766+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+45766+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921685; cv=none; d=zoho.com; s=zohoarc; b=Nlxlq9nbd5pOBIDl+mvA0muZ6YQCYPwQo0IejRKtMy01ZA5MBUui+kdfgYXqr51YPRxD+MTH598FcpstmNnaZZbwPldClA6/nhVyBJpUMsJ0IuXgoTFhy66CchOHxDPXhH279CWiWTkeUDx32VbE17Lb5XXQZbiYrx0g1wNvxNw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921685; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=eUnjFbAyv+sK4/9p+d/JNNXwbckoEf1spuDjbujV9iA=; b=JGESgFW4z7LpTA07qSkEn4y0aqrjnIN3AxOXm0lMimX3MsmmFL95JIyVEkYNC0jMj1y408GGklMM8SiHdrXaAZ/wrkwldOGsJjbwPdjrn/TimT6B5ilDXgdXeuepA/pGorGXnXOmRefxSAjedqMlpSs4MdUysRm4b6sq8DoRAhc= 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+45766+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 156592168548739.594891009659705; Thu, 15 Aug 2019 19:14:45 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:44 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201406996" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:43 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Ray Ni , Andrew Fish Subject: [edk2-devel] [Patch V4 08/10] EmulatorPkg: Disable TftpDynamicCommand and LogoDxe for XCODE5 Date: Thu, 15 Aug 2019 19:14:35 -0700 Message-Id: <20190816021437.7516-9-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921685; bh=RhZx5LF39dl3JQS4NYhlG8WcBvXkm6e8sLG+JWPUJ2w=; h=Cc:Date:From:Reply-To:Subject:To; b=MyEAlxvD8BM6fnCWPbz96OLKv57DNTw95G7x4jR6uvjJIDkwDI36rDGwk0UdIq+wjpj YoCvRHZH9cKzk9hQTaPXWOeN58hOpmfg1ot/Tk/LTsz76To/HN40Ga4zvhTtbZnkt3mYk L7nHWCzbQximGUbRfL59GCuqn9Tu2gWXkzg= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Disable TftpDynamicCommand for XCODE5 because this command places HII content in an PE/COFF resource section that is not supported by the XCODE5 tool chain, and the missing HII content causes the load of this command to ASSERT(). Disable the LogoDxe module that places the logo bitmap in a PE/COFF resource section that is not supported by the XCODE5 tool chain, and the missing HII content causes the load of this module to ASSERT(). Cc: Jordan Justen Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Andrew Fish --- EmulatorPkg/EmulatorPkg.dsc | 4 ++++ EmulatorPkg/EmulatorPkg.fdf | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/EmulatorPkg/EmulatorPkg.dsc b/EmulatorPkg/EmulatorPkg.dsc index 0af2d1ff95..20f1187713 100644 --- a/EmulatorPkg/EmulatorPkg.dsc +++ b/EmulatorPkg/EmulatorPkg.dsc @@ -332,7 +332,9 @@ [Components] =20 MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf MdeModulePkg/Universal/BdsDxe/BdsDxe.inf +!if "XCODE5" not in $(TOOL_CHAIN_TAG) MdeModulePkg/Logo/LogoDxe.inf +!endif MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf MdeModulePkg/Application/UiApp/UiApp.inf { @@ -375,10 +377,12 @@ [Components] =20 FatPkg/EnhancedFatDxe/Fat.inf =20 +!if "XCODE5" not in $(TOOL_CHAIN_TAG) ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf { gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE } +!endif ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellComman= dLib.inf diff --git a/EmulatorPkg/EmulatorPkg.fdf b/EmulatorPkg/EmulatorPkg.fdf index ec411e82b4..295f6f1db8 100644 --- a/EmulatorPkg/EmulatorPkg.fdf +++ b/EmulatorPkg/EmulatorPkg.fdf @@ -178,7 +178,9 @@ [FV.FvRecovery] INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf +!if "XCODE5" not in $(TOOL_CHAIN_TAG) INF MdeModulePkg/Logo/LogoDxe.inf +!endif INF MdeModulePkg/Universal/LoadFileOnFv2/LoadFileOnFv2.inf INF RuleOverride =3D UI MdeModulePkg/Application/UiApp/UiApp.inf INF MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf @@ -194,7 +196,9 @@ [FV.FvRecovery] =20 INF FatPkg/EnhancedFatDxe/Fat.inf =20 +!if "XCODE5" not in $(TOOL_CHAIN_TAG) INF ShellPkg/DynamicCommand/TftpDynamicCommand/TftpDynamicCommand.inf +!endif INF ShellPkg/Application/Shell/Shell.inf =20 [Rule.Common.SEC] --=20 2.21.0.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 (#45766): https://edk2.groups.io/g/devel/message/45766 Mute This Topic: https://groups.io/mt/32894353/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- From nobody Mon Apr 29 03:36:49 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+45767+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+45767+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921685; cv=none; d=zoho.com; s=zohoarc; b=j94htOx6JQ73grtJV2iJ+mPaigm6jXoimn1WE5fQaPfDs58msHv8VMkyWAaS9EGDDJHodXkqaGUQ03xdhiwIWB7/AY6lQisladj5LGLpvLMlpslYuV4lS9vx26V4l2xr/w7XmEWsgUb+7iNsJ58tMBDRrY0j0yT4m9uvBxNh8h8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921685; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=USKC5p5cHxGHYL/PRCxJRPldF7+4Xc4lSeVXExTLlG0=; b=fvuLSmki5VvcafUhni9TN5fMM0hVwIfibliUjE6DMUJIrZ3Z6+Pf9tAc1jlZwVYyTiid6vfnAsMgKnvZYPiDk92IKeUvj+FeHHo67Comqu0EBN8wOJe0NNK66sz2Juai6Md19k1UIX4vys8Ee8YKMgu74E+KtYuYcPmOUjF8BPg= 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+45767+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 1565921685801479.215407808009; Thu, 15 Aug 2019 19:14:45 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:44 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201407004" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:43 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Ray Ni , Andrew Fish Subject: [edk2-devel] [Patch V4 09/10] EmulatorPkg/Sec: Change local variable scope for XCODE5 Date: Thu, 15 Aug 2019 19:14:36 -0700 Message-Id: <20190816021437.7516-10-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921685; bh=s9Tgbkpcnfz0miBv8m7FgaUY8SgQoYD6I2lzrS8oI0c=; h=Cc:Date:From:Reply-To:Subject:To; b=DbLigtadovbDLFEByDV5lJVSlEgF1PlcBSM5w2NiiHIBcM9tFOW5NwWKouzpDDK009L GKZ4zaDr4NH+dqQjmYRUEWVqM41fLe2WTJoyy+d0AvCe8YAfYevGS31adU6jIfSkZ9sRw 54I7YKr+A9S5tWtlnSxnAFXCcm5ygVzgEIk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The local variable PpiArray[10] is declared in middle of the SEC module _ModuleEntryPoint(). When building for XCODE5 with optimizations enabled, this results in corruption and an exception. The fix is to move the declaration of PpiArray[10] to the standard location at the beginning of the function so the storage for this local variable is allocated for the entire lifetime of the function. Cc: Jordan Justen Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Andrew Fish --- EmulatorPkg/Sec/Sec.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/EmulatorPkg/Sec/Sec.c b/EmulatorPkg/Sec/Sec.c index 701032233b..b734d2bb87 100644 --- a/EmulatorPkg/Sec/Sec.c +++ b/EmulatorPkg/Sec/Sec.c @@ -75,6 +75,7 @@ _ModuleEntryPoint ( EFI_PEI_PPI_DESCRIPTOR *SecPpiList; UINTN SecReseveredMemorySize; UINTN Index; + EFI_PEI_PPI_DESCRIPTOR PpiArray[10]; =20 EMU_MAGIC_PAGE()->PpiList =3D PpiList; ProcessLibraryConstructorList (); @@ -104,16 +105,13 @@ _ModuleEntryPoint ( SecCoreData->PeiTemporaryRamBase =3D (VOID *)((UINTN)SecCoreData->PeiTem= poraryRamBase + SecReseveredMemorySize); SecCoreData->PeiTemporaryRamSize -=3D SecReseveredMemorySize; #else - { - // - // When I subtrack from SecCoreData->PeiTemporaryRamBase PEI Core cras= hes? Either there is a bug - // or I don't understand temp RAM correctly? - // - EFI_PEI_PPI_DESCRIPTOR PpiArray[10]; + // + // When I subtrack from SecCoreData->PeiTemporaryRamBase PEI Core crashe= s? Either there is a bug + // or I don't understand temp RAM correctly? + // =20 - SecPpiList =3D &PpiArray[0]; - ASSERT (sizeof (PpiArray) >=3D SecReseveredMemorySize); - } + SecPpiList =3D &PpiArray[0]; + ASSERT (sizeof (PpiArray) >=3D SecReseveredMemorySize); #endif // Copy existing list, and append our entries. CopyMem (SecPpiList, PpiList, sizeof (EFI_PEI_PPI_DESCRIPTOR) * Index); --=20 2.21.0.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 (#45767): https://edk2.groups.io/g/devel/message/45767 Mute This Topic: https://groups.io/mt/32894354/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- From nobody Mon Apr 29 03:36:49 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+45768+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+45768+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1565921685; cv=none; d=zoho.com; s=zohoarc; b=ILgVty/H/RmL2/LicF4iBOkEFPKtBbu5kACEcyz7Nl2yj0ssIhwhU181oALag/AziwD7zlkhptuydyfvOziyjS6tpu29xW1r5qf3lKdsMaeFYH3SECl2ZuleQWosb4ki/76x+kg7bhmAXXQcdyduDaUE/FmsslYEhysx7nmhEMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565921685; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To:ARC-Authentication-Results; bh=ExBakEiZp4w+vxRA3bY1aQ83I6U45CzkUd/LGiXzPv0=; b=VYw1l0kBLgUd+XGdvL+oJ4OTtvzGl2iWjJ6i7vSneqE2Lh1zFfwdMbkrLLO3QhC44LAVdqw232lZy3OVKMdlNNHGbJBLMzmUaN2y5jtMAyrOcrTMaxslRfoXH/h1zsTNvRvM2BP6YpDLct2Uuv43NCtdJ6095K0S56717vpN2V8= 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+45768+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 1565921685971997.343616319063; Thu, 15 Aug 2019 19:14:45 -0700 (PDT) Return-Path: X-Received: from mga09.intel.com (mga09.intel.com []) by groups.io with SMTP; Thu, 15 Aug 2019 19:14:45 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Aug 2019 19:14:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,391,1559545200"; d="scan'208";a="201407025" X-Received: from unknown (HELO mdkinney-MOBL2.amr.corp.intel.com) ([10.241.98.74]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2019 19:14:44 -0700 From: "Michael D Kinney" To: devel@edk2.groups.io Cc: Jordan Justen , Ray Ni , Andrew Fish Subject: [edk2-devel] [Patch V4 10/10] BaseTools/tools_def.template: Add -gdwarf to XCODE5 X64 Date: Thu, 15 Aug 2019 19:14:37 -0700 Message-Id: <20190816021437.7516-11-michael.d.kinney@intel.com> In-Reply-To: <20190816021437.7516-1-michael.d.kinney@intel.com> References: <20190816021437.7516-1-michael.d.kinney@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,michael.d.kinney@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=1565921685; bh=+xiC4Ii1KVJSJ2ZVVqm1CYbSTPYIX8NXPFrb3U39HYQ=; h=Cc:Date:From:Reply-To:Subject:To; b=Eig4b5MyvGTeD+UKW/Khl+GZV+c6sAuCXWgPrPmX/G+EBuVvSZF79Boabb8tGrngf50 80It18/CrIVo2r2JnDriw5t6hSH8q86zJ0Z5Miu7V4XFWgSOgnXaQWY+54QvODpRvDped QPr1N6VOHg2xBZDKJiC5VGLKIJVXh3FnaM4= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Add -gdwarf to XCODE5 X64 builds to generate symbols for source level debug using lldb. Cc: Jordan Justen Cc: Ray Ni Cc: Michael D Kinney Signed-off-by: Andrew Fish Reviewed-by: Liming Gao --- BaseTools/Conf/tools_def.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.t= emplate index 26a2cf604f..8f0e6cb6c2 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2593,8 +2593,8 @@ RELEASE_XCODE5_X64_ASM_FLAGS =3D -arch x86_64 *_XCODE5_*_PP_FLAGS =3D -E -x assembler-with-cpp -include $(DEST_D= IR_DEBUG)/AutoGen.h *_XCODE5_*_VFRPP_FLAGS =3D -x c -E -P -DVFRCOMPILE -include $(DEST_DI= R_DEBUG)/$(MODULE_NAME)StrDefs.h =20 - DEBUG_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -Os = -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-exte= nsions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float = -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field= -initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftr= ap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -D NO_MSA= BI_VA_FUNCS $(PLATFORM_FLAGS) - NOOPT_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -O0 = -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-exte= nsions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float = -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field= -initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -ftr= ap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -D NO_MSA= BI_VA_FUNCS $(PLATFORM_FLAGS) + DEBUG_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -gdw= arf -Os -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno= -ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implici= t-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missi= ng-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-vara= rgs -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -= D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS) + NOOPT_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -g -gdw= arf -O0 -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno= -ms-extensions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implici= t-float -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missi= ng-field-initializers -Wno-tautological-compare -Wno-sign-compare -Wno-vara= rgs -ftrap-function=3Dundefined_behavior_has_been_optimized_away_by_clang -= D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS) RELEASE_XCODE5_X64_CC_FLAGS =3D -target x86_64-pc-win32-macho -c -Os = -Wall -Werror -Wextra -include AutoGen.h -funsigned-char -fno-ms-exte= nsions -fno-stack-protector -fno-builtin -fshort-wchar -mno-implicit-float = -mms-bitfields -Wno-unused-parameter -Wno-missing-braces -Wno-missing-field= -initializers -Wno-tautological-compare -Wno-sign-compare -Wno-varargs -Wno= -unused-const-variable -ftrap-function=3Dundefined_behavior_has_been_optimi= zed_away_by_clang -D NO_MSABI_VA_FUNCS $(PLATFORM_FLAGS) =20 ##########################################################################= ########## --=20 2.21.0.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 (#45768): https://edk2.groups.io/g/devel/message/45768 Mute This Topic: https://groups.io/mt/32894355/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-