From: "Andrew Fish" <afish@apple.com>
To: edk2-devel-groups-io <devel@edk2.groups.io>, grant@grantlmul.xyz
Cc: Bob Feng <bob.c.feng@intel.com>
Subject: Re: [edk2-devel] [PATCH 3/3] Basetools: turn off gcc12 warning
Date: Tue, 29 Mar 2022 14:38:15 -0700 [thread overview]
Message-ID: <5E43C0E3-E98D-4D90-8163-E452228F8759@apple.com> (raw)
In-Reply-To: <16977.1648577646804492712@groups.io>
[-- Attachment #1: Type: text/plain, Size: 2387 bytes --]
> On Mar 29, 2022, at 11:14 AM, grant@grantlmul.xyz wrote:
>
> While I can't test this myself, the following does appear to result in a successful build using the same clang version:
>
>
> diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
> index b05d2bddfa..81aa35aa31 100644
> --- a/BaseTools/Source/C/DevicePath/GNUmakefile
> +++ b/BaseTools/Source/C/DevicePath/GNUmakefile
> @@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
> include $(MAKEROOT)/Makefiles/app.makefile
>
> # gcc 12 trips over device path handling
> -BUILD_CFLAGS += -Wno-error=stringop-overflow
> +ifeq($(CC), gcc)
> + BUILD_CFLAGS += -Wno-error=stringop-overflow
> +endif
>
Gerd,
I’m not sure if this was caused by my email client but your fix did not work for me.
GNUmakefile:17: *** missing separator. Stop.
I had to add a space after `ifeq` to get it to work.
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index b05d2bddfa68..ebab1d3e2617 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile
# gcc 12 trips over device path handling
-BUILD_CFLAGS += -Wno-error=stringop-overflow
+ifeq ($(CC), gcc)
+ BUILD_CFLAGS += -Wno-error=stringop-overflow
+endif
LIBS = -lCommon
ifeq ($(CYGWIN), CYGWIN)
I had been working around like this previously (I’m not sure about the portability of -Wno-unknown-warning-option):
diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index b05d2bddfa68..d08588a81f80 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -14,7 +14,7 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili
include $(MAKEROOT)/Makefiles/app.makefile
# gcc 12 trips over device path handling
-BUILD_CFLAGS += -Wno-error=stringop-overflow
+BUILD_CFLAGS += -Wno-error=stringop-overflow -Wno-unknown-warning-option
LIBS = -lCommon
ifeq ($(CYGWIN), CYGWIN)
Thanks,
Andrew Fish
> LIBS = -lCommon
> ifeq ($(CYGWIN), CYGWIN)
>
[-- Attachment #2: Type: text/html, Size: 13075 bytes --]
next prev parent reply other threads:[~2022-03-29 21:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 12:04 [PATCH 0/3] BaseTools: patches to build with gcc12 Gerd Hoffmann
2022-03-24 12:04 ` [PATCH 1/3] BaseTools: fix gcc12 warning Gerd Hoffmann
2022-03-24 12:04 ` [PATCH 2/3] " Gerd Hoffmann
2022-03-24 12:04 ` [PATCH 3/3] Basetools: turn off " Gerd Hoffmann
2022-03-28 21:29 ` [edk2-devel] " Rebecca Cran
2022-03-29 4:00 ` Bob Feng
2022-03-29 18:14 ` grant
2022-03-29 21:38 ` Andrew Fish [this message]
[not found] ` <16E0F7C6F57A7FEC.28871@groups.io>
2022-03-29 21:39 ` Andrew Fish
2022-03-26 13:57 ` [edk2-devel] [PATCH 0/3] BaseTools: patches to build with gcc12 Bob Feng
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=5E43C0E3-E98D-4D90-8163-E452228F8759@apple.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