From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mx.groups.io with SMTP id smtpd.web11.30881.1661469183114849001 for ; Thu, 25 Aug 2022 16:13:03 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm2 header.b=Xbsf7laM; spf=pass (domain: bsdio.com, ip: 66.111.4.26, mailfrom: rebecca@bsdio.com) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5B15E5C005C; Thu, 25 Aug 2022 19:13:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 25 Aug 2022 19:13:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1661469182; x=1661555582; bh=/rFFClSv0Y yaTaA+2HbeW9x7JRtUiGm2irluVjOwkT8=; b=Xbsf7laMe8WFc6vZYnDotoFVBO hcpc0iwJ3IZYa29cOF0yKODbEAvkA45bsVhXmV2cDHLTKy5vmpVwoDDN71PPHguY cjnpEPj/EgQ3zX0PcyYMUBnGDIWUwjFdeT91n9FBTCwqr9BHR8HhTEA7h7Ee9pIp EfVADX10PLrRhu+K8ZxTOddZp2LKmx/ShDLUgkX+AIdOQRbLBo+5SmWZO6sQXZha SnGj0dm7+PGDfTaxtMyxXc0R3K8lO/mAsrks0fdOauUvdUFgxKi3NvoR6Xw4C/2s ciAIwJs3luc4N3PnY3d90bOTYQi3v7CAqkG4KjvllHNfz5KVMsq1WBsYPAYA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1661469182; x=1661555582; bh=/rFFClSv0YyaTaA+2HbeW9x7JRtU iGm2irluVjOwkT8=; b=bNkpObpX6PM021tYvweBuXPrk+yK8/x0CQrphRSNsgf9 IsH2Qe5jWADs5ZJ39CVX3cxcTnZbvHAoibTJUPoIQgNNlE90w6R+MPgLbzSHJngr zRdl0r0LyX2nz496wDOt2kMC1/8ri4fAmuk9UxctLzW0mH8UAN8aBzPR9pNgRRc0 SZHf2Il7B/jEllFLnHFF3712b7P+UiezD4DuCiAkngfA95rHDh4++cB7N1Wsfbgg JhjCkyDA3y48tOIdweBHr1y5CBCYMQ/ERJ4ejUY4y+kKpJKzv/ksDb86euznOkMs LDS0PuwrGwi0gkFUVosNttDKdLN1yYJxkQ+GoJKvCA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdejgedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfkffggfgfuvfevfhfhjgesrgdtreertdefjeenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepjeduvdekffefvddttdduveehfefgkefhhefgkedugfffgeevhfejfefgkeet heehnecuffhomhgrihhnpehgihhthhhusgdrtghomhdpsghsughiohdrtghomhdpghhroh huphhsrdhiohenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 Aug 2022 19:13:01 -0400 (EDT) Message-ID: <04d48cc6-a9da-ff39-3403-b1d0abd1f045@bsdio.com> Date: Thu, 25 Aug 2022 17:13:00 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2-devel] BaseTools no longer builds on macOS: "error: unknown warning option '-Werror=stringop-overflow'" To: devel@edk2.groups.io, afish@apple.com Cc: Mike Kinney References: <170EA793884203D0.22386@groups.io> From: "Rebecca Cran" In-Reply-To: Content-Type: multipart/alternative; boundary="------------INFaQTqmZnmlBkC1hEQrwtfl" Content-Language: en-US --------------INFaQTqmZnmlBkC1hEQrwtfl Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Thanks, that patch works. Is it too late to get it in for the stable tag? Reviewed-by: Rebecca Cran On 8/25/22 11:49, Andrew Fish via groups.io wrote: > Maybe having the check last would be cleaner. > > *diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile > b/BaseTools/Source/C/DevicePath/GNUmakefile* > > *index c217674345b1..17f213879e82 100644* > > *--- a/BaseTools/Source/C/DevicePath/GNUmakefile* > > *+++ b/BaseTools/Source/C/DevicePath/GNUmakefile* > > @@ -16,10 +16,12 @@include $(MAKEROOT)/Makefiles/app.makefile > >  GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}') > >  ifneq ("$(GCCVERSION)", "5") > >  ifneq ($(CXX), llvm) > > +ifneq ($(DARWIN),Darwin) > >  # gcc 12 trips over device path handling > >  BUILD_CFLAGS += -Wno-error=stringop-overflow > >  endif > >  endif > > +endif > >  LIBS = -lCommon > >  ifeq ($(CYGWIN), CYGWIN) > > > > Thanks, > > Andrew Fish > >> On Aug 25, 2022, at 10:45 AM, Andrew Fish via groups.io >> wrote: >> >> Rebecca, >> >> FYI /usr/bin/gcc has been a redirector into clang for a lot of years. >> >> The build picks different default sets of complier flags based on >> build type. There is already code that assumes gcc == clang here [1] >> >> I think the issue is the check that is wrapping "BUILD_CFLAGS += >> -Wno-error=stringop-overflow”. It needs to skip the check on macOS. >> >> *diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile >> b/BaseTools/Source/C/DevicePath/GNUmakefile* >> *index c217674345b1..f3c9739617f2 100644* >> *--- a/BaseTools/Source/C/DevicePath/GNUmakefile* >> *+++ b/BaseTools/Source/C/DevicePath/GNUmakefile* >> @@ -14,12 +14,14 @@OBJECTS = DevicePath.o UefiDevicePathLib.o >> DevicePathFromText.o DevicePathUtili >>  include $(MAKEROOT)/Makefiles/app.makefile >> >> >>  GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}') >> +ifneq ($(DARWIN),Darwin) >>  ifneq ("$(GCCVERSION)", "5") >>  ifneq ($(CXX), llvm) >>  # gcc 12 trips over device path handling >>  BUILD_CFLAGS += -Wno-error=stringop-overflow >>  endif >>  endif >> +endif >> >> >>  LIBS = -lCommon >>  ifeq ($(CYGWIN), CYGWIN) >> >> >> [1] >> https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/Makefiles/header.makefile#L83 >> >> Thanks, >> >> Andrew Fish >> >>> On Aug 25, 2022, at 9:20 AM, Rebecca Cran wrote: >>> >>> BaseTools no longer builds on macOS (12.5.1, Monterey), because >>> 'gcc' in /usr/bin is really clang. >>> >>> I tried installing gcc 12 from Homebrew, but the build then failed >>> saying it couldn't find _stdio.h. >>> >>> It appears the breakage might have been introduced in this commit >>> back in March: >>> >>> commit 22130dcd98b4d4b76ac8d922adb4a2dbc86fa52c >>> Author: Gerd Hoffmann >>> Date:   Thu Mar 24 20:04:36 2022 +0800 >>> >>>     Basetools: turn off gcc12 warning >>> >>> Running "make -C BaseTools" produces the following error: >>> >>> >>> /Library/Developer/CommandLineTools/usr/bin/make -C DevicePath >>> gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I >>> ../Include/IndustryStandard -I ../Common/ -I .. -I . -I >>> ../Include/X64/ -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror >>> -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result >>> -nostdlib -g -O2  -Wno-error=stringop-overflow DevicePath.c -o >>> DevicePath.o >>> error: unknown warning option '-Werror=stringop-overflow'; did you >>> mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option] >>> make[2]: *** [DevicePath.o] Error 1 >>> make[1]: *** [DevicePath] Error 2 >>> make: *** [Source/C] Error 2 >>> >>> >>> bcran@procan edk2 % gcc -v >>> Configured with: --prefix=/Library/Developer/CommandLineTools/usr >>> --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 >>> Apple clang version 12.0.5 (clang-1205.0.22.9) >>> Target: x86_64-apple-darwin21.6.0 >>> Thread model: posix >>> InstalledDir: /Library/Developer/CommandLineTools/usr/bin >>> >>> bcran@procan edk2 % uname -a >>> Darwin procan.int.bsdio.com 21.6.0 Darwin Kernel Version 21.6.0: Wed >>> Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64 >>> >>> -- >>> Rebecca Cran >>> >> > > --------------INFaQTqmZnmlBkC1hEQrwtfl Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Thanks, that patch works. Is it too late to get it in for the stable tag?


Reviewed-by: Rebecca Cran <rebecca@bsdio.com>


On 8/25/22 11:49, Andrew Fish via groups.io wrote:
Maybe having the check last would be cleaner. 

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile

index c217674345b1..17f213879e82 100644

--- a/BaseTools/Source/C/DevicePath/GNUmakefile

+++ b/BaseTools/Source/C/DevicePath/GNUmakefile

@@ -16,10 +16,12 @@ include $(MAKEROOT)/Makefiles/app.makefile

 GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')

 ifneq ("$(GCCVERSION)", "5")

 ifneq ($(CXX), llvm)

+ifneq ($(DARWIN),Darwin)

 # gcc 12 trips over device path handling

 BUILD_CFLAGS += -Wno-error=stringop-overflow

 endif

 endif

+endif

 

 LIBS = -lCommon

 ifeq ($(CYGWIN), CYGWIN)



Thanks,

Andrew Fish

On Aug 25, 2022, at 10:45 AM, Andrew Fish via groups.io <afish=apple.com@groups.io> wrote:

Rebecca,

FYI /usr/bin/gcc has been a redirector into clang for a lot of years. 

The build picks different default sets of complier flags based on build type. There is already code that assumes gcc == clang here [1]

I think the issue is the check that is wrapping "BUILD_CFLAGS += -Wno-error=stringop-overflow”. It needs to skip the check on macOS. 

diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile
index c217674345b1..f3c9739617f2 100644
--- a/BaseTools/Source/C/DevicePath/GNUmakefile
+++ b/BaseTools/Source/C/DevicePath/GNUmakefile
@@ -14,12 +14,14 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili
 include $(MAKEROOT)/Makefiles/app.makefile

 

 GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')
+ifneq ($(DARWIN),Darwin)
 ifneq ("$(GCCVERSION)", "5")
 ifneq ($(CXX), llvm)
 # gcc 12 trips over device path handling
 BUILD_CFLAGS += -Wno-error=stringop-overflow
 endif
 endif
+endif

 

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



Thanks,

Andrew Fish

On Aug 25, 2022, at 9:20 AM, Rebecca Cran <rebecca@bsdio.com> wrote:

BaseTools no longer builds on macOS (12.5.1, Monterey), because 'gcc' in /usr/bin is really clang.

I tried installing gcc 12 from Homebrew, but the build then failed saying it couldn't find _stdio.h.

It appears the breakage might have been introduced in this commit back in March:

commit 22130dcd98b4d4b76ac8d922adb4a2dbc86fa52c
Author: Gerd Hoffmann <kraxel@redhat.com>
Date:   Thu Mar 24 20:04:36 2022 +0800

    Basetools: turn off gcc12 warning

Running "make -C BaseTools" produces the following error:


/Library/Developer/CommandLineTools/usr/bin/make -C DevicePath
gcc  -c  -I .. -I ../Include/Common -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I . -I ../Include/X64/ -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g -O2  -Wno-error=stringop-overflow DevicePath.c -o DevicePath.o
error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]
make[2]: *** [DevicePath.o] Error 1
make[1]: *** [DevicePath] Error 2
make: *** [Source/C] Error 2


bcran@procan edk2 % gcc -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

bcran@procan edk2 % uname -a
Darwin procan.int.bsdio.com 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:25:27 PDT 2022; root:xnu-8020.141.5~2/RELEASE_X86_64 x86_64

--
Rebecca Cran



--------------INFaQTqmZnmlBkC1hEQrwtfl--