Re: [PATCH v2 1/1] Basetools: fix gcc workaround

Yuwei Chen

Since the gcc12 has the incompatible change from GCC5.4, I'd also suggest we could create a new TOOL CHAIN for gcc12.
The error reports I collected show in gcc5.4 , "-Wno-error=stringop-overflow" is an unrecognized command line option which is available in gcc12.

Christine (Yuwei)

-----Original Message-----
From: <> On Behalf Of Yuwei
Sent: Thursday, March 31, 2022 8:51 AM
To: Gerd Hoffmann <kraxel@...>;
Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran
<rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver
Steffen <osteffen@...>; Gao, Liming <gaoliming@...>
Subject: Re: [edk2-devel] [PATCH v2 1/1] Basetools: fix gcc workaround

Hi Hoffmann,

I received some reports that some platforms are using gcc5.4. With this patch,
these platform builds are still broken.
Would you like to revert the original commits?

Christine (Yuwei)

-----Original Message-----
From: Gerd Hoffmann <kraxel@...>
Sent: Tuesday, March 29, 2022 4:38 PM
Cc: Feng, Bob C <bob.c.feng@...>; Rebecca Cran
<rebecca@...>; Pawel Polawski <ppolawsk@...>; Oliver
Steffen <osteffen@...>; Chen, Christine
Gao, Liming <gaoliming@...>; Gerd Hoffmann
Subject: [PATCH v2 1/1] Basetools: fix gcc workaround

Apply the workaround only in case the compiler is gcc.
Fixes builds with clang.

Fixes: 22130dcd98b4 ("Basetools: turn off gcc12 warning")
Reported-by: Rebecca Cran <rebecca@...>
Signed-off-by: Gerd Hoffmann <kraxel@...>
BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++
1 file changed, 2 insertions(+)

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile
index b05d2bddfa68..6323e7355cc8 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -13,8 +13,10 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o
DevicePathFromText.o DevicePathUtili

include $(MAKEROOT)/Makefiles/app.makefile

+ifneq ($(CXX), llvm)
# gcc 12 trips over device path handling BUILD_CFLAGS += -Wno-

LIBS = -lCommon
ifeq ($(CYGWIN), CYGWIN)

Join to automatically receive all group messages.