> -----Original Message-----
> From: Leif Lindholm <[email protected]>
> Sent: Thursday, February 12, 2026 9:40 AM
> To: Kinney, Michael D <[email protected]>
> Cc: edk2-devel-groups-io <[email protected]>; Ard Biesheuvel
> <[email protected]>
> Subject: Re: successful GCC/CLANGDWARF builds print error messages
> 
> On Thu, 12 Feb 2026 at 16:56, Kinney, Michael D
> <[email protected]> wrote:
> > It is required for the Mingw CLANG EmulatorPkg and unit test builds
> that use CLANGDWARF tool chain tag that do produce PDB files and PDB
> files are required for source level debug.
> >
> > I agree that the log files containing those messages is not a good
> condition.  I will review and work on a solution.
> 
> Is mingw unixy enough that we can do
> -[ -e $(DEBUG_DIR)(+)*.pdb ] && $(CP) $(DEBUG_DIR)(+)*.pdb
> $(OUTPUT_DIR)
> ?

Unfortunately no.  Mingw runs a Windows shell that is not bash compatible.

The following may work for both to send stderr output to a file from
The optional step to hide the error message.

        -$(CP) $(DEBUG_DIR)(+)*.pdb $(OUTPUT_DIR) 2> $(DEBUG_DIR)(+).cp.pdb.log

However, this still generates a message from make that an ignorable
error was observed.

This specific rule does not copy PDB to the common dir.  This rule is
about copying the PDB from the module OUTPUT dir to the module DEBUG dir.
This was done so after a build, all the DEBUG dirs could be archived
To provide map and source level debug support. This means the .efi 
File actually exists in 3 locations and the .pdb is in 2 locations.

If we could generate the pdb in the DEBUG dir instead of the OUTPUT
dir in the DLINK action, then the copy can be removed.  Same for the
map file.

I think the following tools-def.txt changes could be a big improvement

For VS20xx and CLANGPDB:
    /PDB: $(DEST_DIR_DEBUG)/$(BASE_NAME).pdb
    /MAP: $(DEST_DIR_DEBUG)/$(BASE_NAME).map

For Mingw that uses CLANGDWARF:
    -Wl,--pdb,$(DEST_DEBUG_DIR)/$(BASE_NAME).pdb
    -Wl,-Map,$(DEST_DEBUG_DIR)/$(BASE_NAME).map


Historically, the default paths were used that put these files
in OUTPUT dir. By providing the exact path, the copy can be
avoided. Fewer copy actions and smaller build output dir.

> 
> > One aspect of the build I do not like is copying all the .efi files
> and source level debug support files to a common directory. If there
> are name collisions from modules with the same BASE_NAME in different
> packages integrated into a platform build, they will write over each
> other.
> > It would be better if the .efi and source level debug files
> remaining in the module build directory. If we did that, then the copy
> operations would not be required and this would remove extra actions
> in the build and also remove duplicate files in the build output
> directory.
> 
> I agree that would be even nicer, because the name collision thing is
> annoying.
> 
> If we can do that as quickly as (post stable tag) merging the above,
> sure :)
> 
> /
>     Leif
> 
> > Mike
> >
> > > -----Original Message-----
> > > From: Leif Lindholm <[email protected]>
> > > Sent: Thursday, February 12, 2026 3:03 AM
> > > To: edk2-devel-groups-io <[email protected]>; Kinney, Michael D
> > > <[email protected]>; Ard Biesheuvel
> > > <[email protected]>
> > > Subject: successful GCC/CLANGDWARF builds print error messages
> > >
> > > Hi Mike,
> > >
> > > since 20233f156c2e5 (in
> https://github.com/tianocore/edk2/pull/11929),
> > > every non-pdb-generating gcc or clangdwarf now prints an error
> message
> > > for every .efi generated, like:
> > >
> > > ---
> > > cp -p -f
> > >
> /work/git/tianocore/Build/Arm/NOOPT_CLANGDWARF/AARCH64/ArmPkg/Drivers/
> > > ArmGicDxe/ArmGicDxe/DEBUG/*.pdb
> > >
> /work/git/tianocore/Build/Arm/NOOPT_CLANGDWARF/AARCH64/ArmPkg/Drivers/
> > > ArmGicDxe/ArmGicDxe/OUTPUT
> > > cp: cannot stat
> > >
> '/work/git/tianocore/Build/Arm/NOOPT_CLANGDWARF/AARCH64/ArmPkg/Drivers
> > > /ArmGicDxe/ArmGicDxe/DEBUG/*.pdb':
> > > No such file or directory
> > > make: [GNUmakefile:450:
> > >
> /work/git/tianocore/Build/Arm/NOOPT_CLANGDWARF/AARCH64/ArmPkg/Drivers/
> > > ArmGicDxe/ArmGicDxe/OUTPUT/ArmGicDxe.efi]
> > > Error 1 (ignored)
> > > ---
> > >
> > > The error is (as stated) ignored, but it's not great when the
> output
> > > of a correct build includes lots of error printouts.
> > >
> > > Looking at the commit, the addition of the .pdb copying does not
> seem
> > > to form part of the change described in the commit message. Can we
> > > nuke the line?
> > >
> > > /
> > >     Leif


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#121813): https://edk2.groups.io/g/devel/message/121813
Mute This Topic: https://groups.io/mt/117772352/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to