public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Michael D Kinney" <michael.d.kinney@intel.com>
To: Pedro Falcato <pedro.falcato@gmail.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "mikuback@linux.microsoft.com" <mikuback@linux.microsoft.com>,
	Sean Brogan <sean.brogan@microsoft.com>,
	"Kinney, Michael D" <michael.d.kinney@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] UnitTestFrameworkPkg: Fix Google Test components with multiple files
Date: Sun, 3 Dec 2023 00:34:16 +0000	[thread overview]
Message-ID: <CO1PR11MB492909505C9775361E51B821D287A@CO1PR11MB4929.namprd11.prod.outlook.com> (raw)
In-Reply-To: <CO1PR11MB492993436D4935A2C32DD001D281A@CO1PR11MB4929.namprd11.prod.outlook.com>

Hi Pedro,

I have reviewed the use of /NODEFAULTLIB.

It is correct for this flag to be used for FW components
to prevent standard application libs from being linked.

For any component that links as a Windows application, this
flag should not be used.  This applies to host based unit 
tests and to the EmulatorPkg/Host/Win.  I have verified that
/NODEFAULTLIB can be removed from both of these use cases
and only use /NODEFAULTLIB for FW components.

With /NODEFAULTLIB removed from UnitTestFrameworkPkgHost.dsc.inc
This series is:

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

I have taken the branch from Michael Kubacki and added this
one change to run through EDK II CI and added by Rb tags.

https://github.com/tianocore/edk2/pull/5098

Best regards,

Mike



> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Friday, December 1, 2023 1:29 PM
> To: Pedro Falcato <pedro.falcato@gmail.com>; devel@edk2.groups.io
> Cc: mikuback@linux.microsoft.com; Sean Brogan <sean.brogan@microsoft.com>;
> Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH 1/2] UnitTestFrameworkPkg: Fix Google Test
> components with multiple files
> 
> Hi Pedro,
> 
> Thanks for the follow up and debug.
> 
> I suspect some of those flags were inherited from
> EmulatorPkg builds and may not apply to GoogeTest
> builds.
> 
> I will investigate.
> 
> Very happy to see a solution for this issue.
> 
> Mike
> 
> > -----Original Message-----
> > From: Pedro Falcato <pedro.falcato@gmail.com>
> > Sent: Friday, December 1, 2023 12:53 PM
> > To: devel@edk2.groups.io; pedro.falcato@gmail.com
> > Cc: mikuback@linux.microsoft.com; Kinney, Michael D
> > <michael.d.kinney@intel.com>; Sean Brogan <sean.brogan@microsoft.com>
> > Subject: Re: [edk2-devel] [PATCH 1/2] UnitTestFrameworkPkg: Fix Google
> Test
> > components with multiple files
> >
> > On Fri, Dec 1, 2023 at 8:50 PM Pedro Falcato via groups.io
> > <pedro.falcato=gmail.com@groups.io> wrote:
> > >
> > > On Fri, Dec 1, 2023 at 5:07 PM Michael Kubacki
> > > <mikuback@linux.microsoft.com> wrote:
> > > >
> > > > Hi Pedro,
> > > >
> > > > Visual Studio NOOPT builds result in linker errors. I combined your
> > > > patch series with the test instruction change in this PR -
> > > > https://github.com/tianocore/edk2/pull/5096.
> > > >
> > > > You can use a PR to test the VS build.
> > >
> > > Thanks for the heads up, but I ended up booting Windows to expedite the
> > process.
> > >
> > > So, I noticed from the build logs that libcmtd.lib was having issues
> > > doing a /WHOLEARCHIVE link (not unheard of, had the same problems with
> > > Linux system libraries). Then I noticed in MSDN:
> > > "The /WHOLEARCHIVE option forces the linker to include every object
> > > file from either a specified static library, or if no library is
> > > specified, from all static libraries specified to the LINK command"
> > > Note the "from all static libraries specified to the LINK command". So
> > > I noticed libcmtd.lib was being specified manually, and I simply
> > > deleted
> > >
> > > /NODEFAULTLIB:libcmt.lib libcmtd.lib
> >
> > ... Forgot to mention that deleting this line allows the link to
> > complete and /WHOLEARCHIVE has the intended effect.
> >
> > --
> > Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111992): https://edk2.groups.io/g/devel/message/111992
Mute This Topic: https://groups.io/mt/102904623/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-12-03  0:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 22:42 [edk2-devel] [PATCH 0/2] UnitTestFrameworkPkg: Fix Google Test components with multiple files Pedro Falcato
2023-11-30 22:42 ` [edk2-devel] [PATCH 1/2] " Pedro Falcato
2023-12-01 17:07   ` Michael Kubacki
2023-12-01 20:50     ` Pedro Falcato
     [not found]     ` <179CD05BE5E43398.18076@groups.io>
2023-12-01 20:52       ` Pedro Falcato
2023-12-01 21:28         ` Michael D Kinney
2023-12-03  0:34           ` Michael D Kinney [this message]
2023-12-03  2:37             ` Michael D Kinney
2023-12-03 12:11               ` Pedro Falcato
2023-11-30 22:42 ` [edk2-devel] [PATCH 2/2] UnitTestFrameworkPkg/Readme.md: Remove the mention of the gtest main() limitation Pedro Falcato
2023-12-01 17:10   ` Michael Kubacki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CO1PR11MB492909505C9775361E51B821D287A@CO1PR11MB4929.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox