[edk2-devel] BaseTools no longer builds on macOS: "error: unknown warning option '-Werror=stringop-overflow'"

Rebecca Cran rebecca at bsdio.com
Thu Aug 25 16:20:45 UTC 2022


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 at 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 at 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 at 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



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92819): https://edk2.groups.io/g/devel/message/92819
Mute This Topic: https://groups.io/mt/93251921/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list