From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from rn-mailsvcp-ppex-lapp15.apple.com (rn-mailsvcp-ppex-lapp15.apple.com [17.179.253.34]) by mx.groups.io with SMTP id smtpd.web08.27257.1661449771378777090 for ; Thu, 25 Aug 2022 10:49:31 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=mAPK6cvl; spf=pass (domain: apple.com, ip: 17.179.253.34, mailfrom: afish@apple.com) Received: from pps.filterd (rn-mailsvcp-ppex-lapp15.rno.apple.com [127.0.0.1]) by rn-mailsvcp-ppex-lapp15.rno.apple.com (8.16.1.2/8.16.1.2) with SMTP id 27PHjbaE011721; Thu, 25 Aug 2022 10:49:28 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=fGf63ZS8ZBCLGXyDulPTfxkLbEAt0br/+i61H2GmP+Q=; b=mAPK6cvleslDw3VH5xsf53Yq9TyK/M8vumILctLeSU/QPUS0BIVXQyfJ4ATKSRJ4sSoS dd82kaBZ/kZ+7/yfDTZ/JA1sm3DajEI5pWEGe8KlBUak+79ptuYDMflaaK8Xpor2GOWu jE0VqrpwPMBTClFZI3+OOwbdX73vHU89G37WoY2Svg77LZY32ETm2GKWJpnLmSLc0Fa5 PKPEJq5Ivcuyfh/Y7Nz7jzYJJXQ0L3LptJD5uaYl5DdCzdR53dqUijTUeFJJ/8g1Eji7 O/DeUECNO3AoVzk2cFKAJyKVmDFYdrrLX+bmQw3IjPjFsldrJ4VcyzoSATT4A646FUNi yw== Received: from rn-mailsvcp-mta-lapp04.rno.apple.com (rn-mailsvcp-mta-lapp04.rno.apple.com [10.225.203.152]) by rn-mailsvcp-ppex-lapp15.rno.apple.com with ESMTP id 3j2w6de5em-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Thu, 25 Aug 2022 10:49:28 -0700 Received: from rn-mailsvcp-mmp-lapp03.rno.apple.com (rn-mailsvcp-mmp-lapp03.rno.apple.com [17.179.253.16]) by rn-mailsvcp-mta-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPS id <0RH600JGJMUGN3J0@rn-mailsvcp-mta-lapp04.rno.apple.com>; Thu, 25 Aug 2022 10:49:28 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp03.rno.apple.com by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) id <0RH600W00MN5C800@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Thu, 25 Aug 2022 10:49:28 -0700 (PDT) X-Va-A: X-Va-T-CD: f900b3001c7ef03eb53e4f1f41858654 X-Va-E-CD: 10c78ec1d4f169814d7f576007099e23 X-Va-R-CD: f7c4e0ae72082eb721466aa96ba3b57f X-Va-CD: 0 X-Va-ID: 5c149013-8fdd-4818-906d-8ecb583f6f14 X-V-A: X-V-T-CD: f900b3001c7ef03eb53e4f1f41858654 X-V-E-CD: 10c78ec1d4f169814d7f576007099e23 X-V-R-CD: f7c4e0ae72082eb721466aa96ba3b57f X-V-CD: 0 X-V-ID: 34d786fb-1567-4003-a3d0-4b766c599dea X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.895 definitions=2022-08-25_08:2022-08-25,2022-08-25 signatures=0 Received: from smtpclient.apple (unknown [17.235.33.86]) by rn-mailsvcp-mmp-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.19.20220711 64bit (built Jul 11 2022)) with ESMTPSA id <0RH600BJDMUFLU00@rn-mailsvcp-mmp-lapp03.rno.apple.com>; Thu, 25 Aug 2022 10:49:28 -0700 (PDT) From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 16.0 \(3731.0.8.1.1\)) Subject: Re: [edk2-devel] BaseTools no longer builds on macOS: "error: unknown warning option '-Werror=stringop-overflow'" Date: Thu, 25 Aug 2022 10:49:17 -0700 In-reply-to: <170EA793884203D0.22386@groups.io> Cc: Rebecca Cran , Mike Kinney To: edk2-devel-groups-io , Andrew Fish References: <170EA793884203D0.22386@groups.io> X-Mailer: Apple Mail (2.3731.0.8.1.1) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.517,18.0.895 definitions=2022-08-25_08:2022-08-25,2022-08-25 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_D0833E5C-0D10-4BFD-92BB-25EF8112520C" --Apple-Mail=_D0833E5C-0D10-4BFD-92BB-25EF8112520C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Maybe having the check last would be cleaner.=20 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 =3D $(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 +=3D -Wno-error=3Dstringop-overflow endif endif +endif =20 LIBS =3D -lCommon ifeq ($(CYGWIN), CYGWIN) Thanks, Andrew Fish > On Aug 25, 2022, at 10:45 AM, Andrew Fish via groups.io wrote: >=20 > Rebecca, >=20 > FYI /usr/bin/gcc has been a redirector into clang for a lot of years.=20 >=20 > The build picks different default sets of complier flags based on build t= ype. There is already code that assumes gcc =3D=3D clang here [1] >=20 > I think the issue is the check that is wrapping "BUILD_CFLAGS +=3D -Wno-e= rror=3Dstringop-overflow=E2=80=9D. It needs to skip the check on macOS.=20 >=20 > 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 =3D DevicePath.o UefiDevicePathLib.o DevicePa= thFromText.o DevicePathUtili > include $(MAKEROOT)/Makefiles/app.makefile > =20 > GCCVERSION =3D $(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 +=3D -Wno-error=3Dstringop-overflow > endif > endif > +endif > =20 > LIBS =3D -lCommon > ifeq ($(CYGWIN), CYGWIN) >=20 >=20 > [1] https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/Make= files/header.makefile#L83 >=20 > Thanks, >=20 > Andrew Fish >=20 >> On Aug 25, 2022, at 9:20 AM, Rebecca Cran wrote: >>=20 >> BaseTools no longer builds on macOS (12.5.1, Monterey), because 'gcc' in= /usr/bin is really clang. >>=20 >> I tried installing gcc 12 from Homebrew, but the build then failed sayin= g it couldn't find _stdio.h. >>=20 >> It appears the breakage might have been introduced in this commit back i= n March: >>=20 >> commit 22130dcd98b4d4b76ac8d922adb4a2dbc86fa52c >> Author: Gerd Hoffmann >> Date: Thu Mar 24 20:04:36 2022 +0800 >>=20 >> Basetools: turn off gcc12 warning >>=20 >> Running "make -C BaseTools" produces the following error: >>=20 >>=20 >> /Library/Developer/CommandLineTools/usr/bin/make -C DevicePath >> gcc -c -I .. -I ../Include/Common -I ../Include/ -I ../Include/Industr= yStandard -I ../Common/ -I .. -I . -I ../Include/X64/ -MD -fshort-wchar -fn= o-strict-aliasing -Wall -Werror -Wno-deprecated-declarations -Wno-self-assi= gn -Wno-unused-result -nostdlib -g -O2 -Wno-error=3Dstringop-overflow Devi= cePath.c -o DevicePath.o >> error: unknown warning option '-Werror=3Dstringop-overflow'; did you mea= n '-Werror=3Dshift-overflow'? [-Werror,-Wunknown-warning-option] >> make[2]: *** [DevicePath.o] Error 1 >> make[1]: *** [DevicePath] Error 2 >> make: *** [Source/C] Error 2 >>=20 >>=20 >> bcran@procan edk2 % gcc -v >> Configured with: --prefix=3D/Library/Developer/CommandLineTools/usr --wi= th-gxx-include-dir=3D/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/us= r/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 >>=20 >> 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 >>=20 >> --=20 >> Rebecca Cran >>=20 >=20 >=20 --Apple-Mail=_D0833E5C-0D10-4BFD-92BB-25EF8112520C Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Maybe having the check last would= be cleaner. 

diff --git a/BaseT= ools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmak= efile

index c217674345b1..17f213879e82 100644

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

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

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

 GCCVERSION =3D $(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 +=3D -Wno-error=3Dstringop-overflow

 endif

 endif

+endif

 

 LIBS =3D -lCommon

 ifeq ($(CYGWIN), CYGWIN)


=
Thanks,

Andrew Fish

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

Rebecca,

FYI /usr/bin/gcc has been a redirector into clang for a lot of years.&nbs= p;

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

I think the issue is the check = that is wrapping "BUILD_CFLAGS +=3D -Wno-error=3Dstringop-overflow=E2=80=9D= . It needs to skip the check on macOS. 

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

 

 GCCVERSION =3D $(shell gcc -dump= version | awk -F'.' '{print $$1}')
+ifneq ($(DARWIN),Darwin)
&nbs= p;ifneq ("$(GCCVERSION)", "5")
 ifneq ($= (CXX), llvm)
 # gcc 12 trips over device= path handling
 BUILD_CFLAGS +=3D -Wno-e= rror=3Dstringop-overflow
 endif
 endif
+endif

 

 LIB= S =3D -lCommon
 ifeq ($(CYGWIN), CYGWIN)=



Thanks,
<= div>
Andrew Fish

O= n Aug 25, 2022, at 9:20 AM, Rebecca Cran <rebecca@bsdio.com> wrote:
BaseTools no longer b= uilds on macOS (12.5.1, Monterey), because 'gcc' in /usr/bin is really clan= g.

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

It appears the breakage might ha= ve been introduced in this commit back in March:

commit 22130dcd98b4= d4b76ac8d922adb4a2dbc86fa52c
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/CommandLineTo= ols/usr/bin/make -C DevicePath
gcc  -c  -I .. -I ../Include/Co= mmon -I ../Include/ -I ../Include/IndustryStandard -I ../Common/ -I .. -I .= -I ../Include/X64/ -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror -W= no-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g= -O2  -Wno-error=3Dstringop-overflow DevicePath.c -o DevicePath.o
e= rror: unknown warning option '-Werror=3Dstringop-overflow'; did you mean '-= Werror=3Dshift-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=3D/Library/Developer/CommandLineTools/usr --with-gxx-include-dir= =3D/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/Co= mmandLineTools/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 Cr= an


=20

--Apple-Mail=_D0833E5C-0D10-4BFD-92BB-25EF8112520C--