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.kin...@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.kin...@intel.com>
> Sent: Friday, December 1, 2023 1:29 PM
> To: Pedro Falcato <pedro.falc...@gmail.com>; devel@edk2.groups.io
> Cc: mikub...@linux.microsoft.com; Sean Brogan <sean.bro...@microsoft.com>;
> Kinney, Michael D <michael.d.kin...@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.falc...@gmail.com>
> > Sent: Friday, December 1, 2023 12:53 PM
> > To: devel@edk2.groups.io; pedro.falc...@gmail.com
> > Cc: mikub...@linux.microsoft.com; Kinney, Michael D
> > <michael.d.kin...@intel.com>; Sean Brogan <sean.bro...@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....@groups.io> wrote:
> > >
> > > On Fri, Dec 1, 2023 at 5:07 PM Michael Kubacki
> > > <mikub...@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/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to