<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">Rebecca,<div><br></div><div>FYI /usr/bin/gcc has been a redirector into clang for a lot of years. </div><div><br></div><div>The build picks different default sets of complier flags based on build type. There is already code that assumes gcc == clang here [1]</div><div><br></div><div>I think the issue is the check that is wrapping "BUILD_CFLAGS += -Wno-error=stringop-overflowā€¯. It needs to skip the check on macOS. </div><div><br></div><div><p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"><b>diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile</b></span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"><b>index c217674345b1..f3c9739617f2 100644</b></span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"><b>--- a/BaseTools/Source/C/DevicePath/GNUmakefile</b></span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"><b>+++ b/BaseTools/Source/C/DevicePath/GNUmakefile</b></span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures; color: #2eaebb">@@ -14,12 +14,14 @@</span><span style="font-variant-ligatures: no-common-ligatures"> OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o  DevicePathUtili</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> include $(MAKEROOT)/Makefiles/app.makefile</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><span style="font-variant-ligatures: no-common-ligatures"> </span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> GCCVERSION = $(shell gcc -dumpversion | awk -F'.' '{print $$1}')</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(47, 180, 29);"><span style="font-variant-ligatures: no-common-ligatures">+ifneq ($(DARWIN),Darwin)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> ifneq ("$(GCCVERSION)", "5")</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> ifneq ($(CXX), llvm)</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> # gcc 12 trips over device path handling</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> BUILD_CFLAGS += -Wno-error=stringop-overflow</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> endif</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> endif</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; color: rgb(47, 180, 29);"><span style="font-variant-ligatures: no-common-ligatures">+endif</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo; min-height: 13px;"><span style="font-variant-ligatures: no-common-ligatures"> </span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> LIBS = -lCommon</span></p>
<p style="margin: 0px; font-stretch: normal; font-size: 11px; line-height: normal; font-family: Menlo;"><span style="font-variant-ligatures: no-common-ligatures"> ifeq ($(CYGWIN), CYGWIN)</span></p></div><div><span style="font-variant-ligatures: no-common-ligatures"><br></span></div><div><br></div><div>[1] <a href="https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/Makefiles/header.makefile#L83">https://github.com/tianocore/edk2/blob/master/BaseTools/Source/C/Makefiles/header.makefile#L83</a></div><div><br></div><div>Thanks,</div><div><br></div><div>Andrew Fish<br><div><br><blockquote type="cite"><div>On Aug 25, 2022, at 9:20 AM, Rebecca Cran <rebecca@bsdio.com> wrote:</div><br class="Apple-interchange-newline"><div><div>BaseTools no longer builds on macOS (12.5.1, Monterey), because 'gcc' in /usr/bin is really clang.<br><br>I tried installing gcc 12 from Homebrew, but the build then failed saying it couldn't find _stdio.h.<br><br>It appears the breakage might have been introduced in this commit back in March:<br><br>commit 22130dcd98b4d4b76ac8d922adb4a2dbc86fa52c<br>Author: Gerd Hoffmann <kraxel@redhat.com><br>Date:   Thu Mar 24 20:04:36 2022 +0800<br><br>    Basetools: turn off gcc12 warning<br><br>Running "make -C BaseTools" produces the following error:<br><br><br>/Library/Developer/CommandLineTools/usr/bin/make -C DevicePath<br>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<br>error: unknown warning option '-Werror=stringop-overflow'; did you mean '-Werror=shift-overflow'? [-Werror,-Wunknown-warning-option]<br>make[2]: *** [DevicePath.o] Error 1<br>make[1]: *** [DevicePath] Error 2<br>make: *** [Source/C] Error 2<br><br><br>bcran@procan edk2 % gcc -v<br>Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1<br>Apple clang version 12.0.5 (clang-1205.0.22.9)<br>Target: x86_64-apple-darwin21.6.0<br>Thread model: posix<br>InstalledDir: /Library/Developer/CommandLineTools/usr/bin<br><br>bcran@procan edk2 % uname -a<br>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<br><br>-- <br>Rebecca Cran<br><br></div></div></blockquote></div><br></div></body></html>

 <div width="1" style="color:white;clear:both">_._,_._,_</div> <hr>   Groups.io Links:<p>   You receive all messages sent to this group.    <p> <a target="_blank" href="https://edk2.groups.io/g/devel/message/92820">View/Reply Online (#92820)</a> |    |  <a target="_blank" href="https://groups.io/mt/93251921/1813853">Mute This Topic</a>  | <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>    <a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> | <a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |  <a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>  [edk2-devel-archive@redhat.com]<br> <div width="1" style="color:white;clear:both">_._,_._,_</div>