From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=LidU3boi; spf=pass (domain: apple.com, ip: 17.151.62.67, mailfrom: afish@apple.com) Received: from nwk-aaemail-lapp02.apple.com (nwk-aaemail-lapp02.apple.com [17.151.62.67]) by groups.io with SMTP; Tue, 16 Apr 2019 09:52:58 -0700 Received: from pps.filterd (nwk-aaemail-lapp02.apple.com [127.0.0.1]) by nwk-aaemail-lapp02.apple.com (8.16.0.27/8.16.0.27) with SMTP id x3GGfkjU022195; Tue, 16 Apr 2019 09:52:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=mime-version : content-type : sender : from : subject : date : references : to : in-reply-to : message-id; s=20180706; bh=bF6B5bzQnXbHukglPDJQGz3bfHWcMT9HGxsMEhGlC20=; b=LidU3boi9M0xcM8Hjj4w1pxK8/y8S69q9ToFTp/P20OZWajpmk9FrUUQ3DfJE86ktjju 0hzJiTgIh6EegETM2MgIkpewuV3kTQ8eg14CT3o+MBOZ8AZJbfQG9pHZzfxzpdB8icAp jVaC7C+bwB9Q6e8VnSG6d3rq/D5MW/kz1lwYtTRx2ZW85I/UAGzkgdogtQ0zHKV7bMr7 eEXHyFS3N7EfoOIlmnIPfRlh0DnFXK5xq1tpaholy9ebCbOdlGDi9qV5igwYUVOSXp6g Lf+WQqAkQ9s7hga7Z4qvZgy9AW6Nzb4unt8lHDOg25KUc2oYVY5//Fz8qKpivkKyo08t ig== Received: from ma1-mtap-s02.corp.apple.com (ma1-mtap-s02.corp.apple.com [17.40.76.6]) by nwk-aaemail-lapp02.apple.com with ESMTP id 2rucbnvvh2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Tue, 16 Apr 2019 09:52:58 -0700 MIME-version: 1.0 Received: from nwk-mmpp-sz11.apple.com (nwk-mmpp-sz11.apple.com [17.128.115.155]) by ma1-mtap-s02.corp.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) with ESMTPS id <0PQ200LEOC89LKD0@ma1-mtap-s02.corp.apple.com>; Tue, 16 Apr 2019 09:52:57 -0700 (PDT) Received: from process_milters-daemon.nwk-mmpp-sz11.apple.com by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) id <0PQ200A00BCVVX00@nwk-mmpp-sz11.apple.com>; Tue, 16 Apr 2019 09:52:57 -0700 (PDT) X-Va-A: X-Va-T-CD: 7bfed498854b4330452a09632c5255fc X-Va-E-CD: 14eaadd8ee2b4de2f749c2aa94dfd5d5 X-Va-R-CD: dc71f010bfddf555e8b320e35ccf2feb X-Va-CD: 0 X-Va-ID: be272fde-68cb-4511-8e67-08da9d1cc234 X-V-A: X-V-T-CD: 4ee433b0206933e8f1863051c8c07a9a X-V-E-CD: 14eaadd8ee2b4de2f749c2aa94dfd5d5 X-V-R-CD: dc71f010bfddf555e8b320e35ccf2feb X-V-CD: 0 X-V-ID: 8be547fb-7dd9-4cfc-8a65-8dcf231d7442 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-16_06:,, signatures=0 Received: from [17.234.31.148] (unknown [17.234.31.148]) by nwk-mmpp-sz11.apple.com (Oracle Communications Messaging Server 8.0.2.3.20181024 64bit (built Oct 24 2018)) with ESMTPSA id <0PQ200MUGC88FV50@nwk-mmpp-sz11.apple.com>; Tue, 16 Apr 2019 09:52:56 -0700 (PDT) Sender: afish@apple.com From: "Andrew Fish" Subject: Re: [edk2-devel] Remove debug strings from OVMF.fd Date: Tue, 16 Apr 2019 09:52:50 -0700 References: To: devel@edk2.groups.io, pedroyossis@gmail.com In-reply-to: Message-id: <34850C25-D7DE-4F3B-A0B4-15AC6B7FD8AF@apple.com> X-Mailer: Apple Mail (2.3445.6.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-16_06:,, signatures=0 Content-type: multipart/alternative; boundary="Boundary_(ID_5UrjMbQ+ZzfFd/EDJNZYMA)" --Boundary_(ID_5UrjMbQ+ZzfFd/EDJNZYMA) Content-type: text/plain; charset=utf-8 Content-transfer-encoding: quoted-printable Pedro, There is an assumption that you have Link Time Optimization (LTO) turned o= n to dead strip. There are 3 PCD flags that let you control what ends up in= the ROM. Assuming LTO you should be able to use PcdFixedDebugPrintErrorLev= el to strip sets of strings out of the file. You can also turn all DEBUG pr= ints off via PcdDebugPropertyMask. https://github.com/tianocore/edk2/blob/master/MdePkg/MdePkg.dec ## This flag is used to control build time optimization based on debug p= rint level. # Its default value is 0xFFFFFFFF to expose all debug print level. # BIT0 - Initialization message.
# BIT1 - Warning message.
# BIT2 - Load Event message.
# BIT3 - File System message.
# BIT4 - Allocate or Free Pool message.
# BIT5 - Allocate or Free Page message.
# BIT6 - Information message.
# BIT7 - Dispatcher message.
# BIT8 - Variable message.
# BIT10 - Boot Manager message.
# BIT12 - BlockIo Driver message.
# BIT14 - Network Driver message.
# BIT16 - UNDI Driver message.
# BIT17 - LoadFile message.
# BIT19 - Event message.
# BIT20 - Global Coherency Database changes message.
# BIT21 - Memory range cachability changes message.
# BIT22 - Detailed debug message.
# BIT31 - Error message.
# @Prompt Fixed Debug Message Print Level. gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|0xFFFFFFFF|UINT32|= 0x30001016 ## The mask is used to control DebugLib behavior.

# BIT0 - Enable Debug Assert.
# BIT1 - Enable Debug Print.
# BIT2 - Enable Debug Code.
# BIT3 - Enable Clear Memory.
# BIT4 - Enable BreakPoint as ASSERT.
# BIT5 - Enable DeadLoop as ASSERT.
# @Prompt Debug Property. # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMa= sk & 0xC0) =3D=3D 0 gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|0x00000005 ## This flag is used to control the print out Debug message.

# BIT0 - Initialization message.
# BIT1 - Warning message.
# BIT2 - Load Event message.
# BIT3 - File System message.
# BIT4 - Allocate or Free Pool message.
# BIT5 - Allocate or Free Page message.
# BIT6 - Information message.
# BIT7 - Dispatcher message.
# BIT8 - Variable message.
# BIT10 - Boot Manager message.
# BIT12 - BlockIo Driver message.
# BIT14 - Network Driver message.
# BIT16 - UNDI Driver message.
# BIT17 - LoadFile message.
# BIT19 - Event message.
# BIT20 - Global Coherency Database changes message.
# BIT21 - Memory range cachability changes message.
# BIT22 - Detailed debug message.
# BIT31 - Error message.
# @Prompt Debug Message Print Level. # @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.PcdDebugPrintError= Level & 0x7F84AA00) =3D=3D 0 gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000000|UINT32|0x000= 00006 Thanks, Andrew Fish > On Apr 16, 2019, at 8:46 AM, Pedro Barbosa wrote= : >=20 > Hi EDK2 developers, >=20 > I'm trying to build OVMF without debug symbols but even building as RELE= ASE, I still can see some strings on the PE files, such as: > /Build/OvmfX64/RELEASE_GCC5/X64/MdeModulePkg/Application= /UiApp/UiApp/DEBUG/UiApp.dll > and many others in the format */DEBUG/*.dll >=20 > Is there a way to build without these strings? >=20 > Thanks! >=20 > --=20 > []s >=20 > Pedro Y=C3=B3ssis Silva Barbosa > Security Engineer, Google > PhD in Computer Science, UFCG, Brazil > sites.google.com/site/pedroysb >=20 --Boundary_(ID_5UrjMbQ+ZzfFd/EDJNZYMA) Content-type: text/html; charset=utf-8 Content-transfer-encoding: quoted-printable
Pedro,

There is an assumpt= ion that you have Link Time Optimization (LTO) turned on to dead strip. The= re are 3 PCD flags that let you control what ends up in the ROM. Assuming L= TO you should be able to use PcdFixedDebugPrintErrorLevel to strip set= s of strings out of the file. You can also turn all DEBUG prints off via&nb= sp;PcdDebugPropertyMask.

https://github.com/tianocore/edk2/blob/master/MdePkg/MdePkg.dec<= div class=3D"">

## This fla= g is used to control build time optimization based on debug print level.
# Its default value is 0xFFFFFFFF to expose all debug= print level.
# BIT0 - Initialization message.<BR>
# BIT1 - Warning message.<BR>
# BIT2 - Load Event message.<BR>
# BIT3 - File System message.<BR>
# BIT4 - Allocate or Free Pool message.<BR>
# BIT5 - Allocate or Free Page message.<BR>
# BIT6 - Information message.<BR>
# BIT7 - Dispatcher message.<BR>
# BIT8 - Variable message.<BR>
# BIT10 - Boot Manager message.<BR>
# BIT12 - BlockIo Driver message.<BR>
# BIT14 - Network Driver message.<BR>
# BIT16 - UNDI Driver message.<BR>
# BIT17 - LoadFile message.<BR>
# BIT19 - Event message.<BR>
# BIT20 - Global Coherency Database changes message.&= lt;BR>
# BIT21 - Memory range cachability changes message.&l= t;BR>
# BIT22 - Detailed debug message.<BR>
# BIT31 - Error message.<BR>
# @Prompt Fixed Debug Message Print Level.
gEfiMdePkgTokenSpaceGuid.PcdFixedDebugPrintErrorLevel|= 0xFFFFFFFF|UINT32|0x30001016

## The mask is used to control DebugLi= b behavior.<BR><BR>
# BIT0 - Enable Debug Assert.<BR>
# BIT1 - Enable Debug Print.<BR>
# BIT2 - Enable Debug Code.<BR>
# BIT3 - Enable Clear Memory.<BR>
# BIT4 - Enable BreakPoint as ASSERT.<BR>
# BIT5 - Enable DeadLoop as ASSERT.<BR>
# @Prompt Debug Property.
# @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.= PcdDebugPropertyMask & 0xC0) =3D=3D 0
gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0|UINT8|= 0x00000005
## This flag is used to control the print out Debug message= .<BR><BR>
# BIT0 - Initialization message.<BR>
# BIT1 - Warning message.<BR>
# BIT2 - Load Event message.<BR>
# BIT3 - File System message.<BR>
# BIT4 - Allocate or Free Pool message.<BR>
# BIT5 - Allocate or Free Page message.<BR>
# BIT6 - Information message.<BR>
# BIT7 - Dispatcher message.<BR>
# BIT8 - Variable message.<BR>
# BIT10 - Boot Manager message.<BR>
# BIT12 - BlockIo Driver message.<BR>
# BIT14 - Network Driver message.<BR>
# BIT16 - UNDI Driver message.<BR>
# BIT17 - LoadFile message.<BR>
# BIT19 - Event message.<BR>
# BIT20 - Global Coherency Database changes message.&= lt;BR>
# BIT21 - Memory range cachability changes message.&l= t;BR>
# BIT22 - Detailed debug message.<BR>
# BIT31 - Error message.<BR>
# @Prompt Debug Message Print Level.
# @Expression 0x80000002 | (gEfiMdePkgTokenSpaceGuid.= PcdDebugPrintErrorLevel & 0x7F84AA00) =3D=3D 0
gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x800= 00000|UINT32|0x00000006

Thanks,

Andrew Fish

On Apr 16, 2019, at 8:46 AM, Pe= dro Barbosa <pedroyossis@gmail.com> wrote:

Hi EDK2 deve= lopers,

I'm trying to b= uild OVMF without debug symbols but even building as RELEASE, I still can s= ee some strings on the PE files, such as:
<my-edk2-= folder>/Build/OvmfX64/RELEASE_GCC5/X64/MdeModulePkg/Application/UiApp/Ui= App/DEBUG/UiApp.dll
and many others in the format */DE= BUG/*.dll

Is there a way to build without these strings?

Thanks!
<= div class=3D"">
--
[]s

Pedro Y=C3=B3ssis Silva BarbosaSecurity Engineer, Google
PhD in Computer = Science, UFCG, Brazil

--Boundary_(ID_5UrjMbQ+ZzfFd/EDJNZYMA)--