Skip to content

Comments

BaseTools/Source/C: Remove duplicate -fshort-wchar#87

Draft
mikebeaton wants to merge 1 commit intoacidanthera:masterfrom
mikebeaton:short-wchar
Draft

BaseTools/Source/C: Remove duplicate -fshort-wchar#87
mikebeaton wants to merge 1 commit intoacidanthera:masterfrom
mikebeaton:short-wchar

Conversation

@mikebeaton
Copy link
Member

@mikebeaton mikebeaton commented Nov 21, 2025

Description

-fshort-wchar -flto -DUSING_LTO was added via CPPFLAGS to all relevant uses of gcc and g++ in commit 2f61ab9.

However CFLAGS, as defined in the lines above that change, is never consumed without CPPFLAGS, therefore -fshort-wchar can be removed from CFLAGS to avoid it appearing twice in every call to gcc which uses CFLAGS.

Note that the affected files within BaseTools/Source/C (those that include the changed file, and all those that those include) are:

Makefiles/app.makefile
Makefiles/lib.makefile
GNUmakefile
VfrCompile/GNUmakefile
Makefiles/footer.makefile
Makefiles/header.makefile

Note also that in VfrCompile/GNUmakefile g++ is affected by CPPFLAGS, but not CXXFLAGS.

  • Breaking change?
    • NO.
  • Impacts security?
    • NO.
  • Includes tests?
    • NO.

How This Was Tested

Confirm in BaseTools/Source/C build console output prior to change that all single and double appearances of -fshort-wchar match the pattern mentioned. Confirm compiled executables before and after change are the same size (they are not binary identical, and differ at multiple locations, but this is believed to be as expected due to meta-data).

Integration Instructions

N/A

`-fshort-wchar -flto -DUSING_LTO` was added via CPPFLAGS to all relevant
uses of gcc and g++ in commit 2f61ab9.

However CFLAGS, as defined in the lines above that change, is never
consumed without CPPFLAGS, therefore `-fshort-wchar` can be removed from
CFLAGS to avoid it appearing twice in every call to gcc which uses CFLAGS.

Note that the affected files within BaseTools/Source/C (those that
include the changed file, and all those that those include) are:

```
Makefiles/app.makefile
Makefiles/lib.makefile
GNUmakefile
VfrCompile/GNUmakefile
Makefiles/footer.makefile
Makefiles/header.makefile
```

Note also that in VfrCompile/GNUmakefile g++ is affected by CPPFLAGS,
but not CXXFLAGS.

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
@mikebeaton mikebeaton marked this pull request as draft November 21, 2025 11:21
@mikebeaton
Copy link
Member Author

mikebeaton commented Nov 21, 2025

Can't see why tianocore/edk2#11779 is failing, but putting this to draft status too as a precaution, until resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant