diff --git a/0035-support-build-with-clang.patch b/0035-support-build-with-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..34ef8897f588b5cc0a6911976998fdec1f6c3845 --- /dev/null +++ b/0035-support-build-with-clang.patch @@ -0,0 +1,75 @@ +diff --git a/BaseTools/Source/C/Makefiles/header.makefile b/BaseTools/Source/C/Makefiles/header.makefile +index 0df728f..902e42f 100644 +--- a/BaseTools/Source/C/Makefiles/header.makefile ++++ b/BaseTools/Source/C/Makefiles/header.makefile +@@ -41,7 +41,7 @@ endif + CYGWIN:=$(findstring CYGWIN, $(shell uname -s)) + LINUX:=$(findstring Linux, $(shell uname -s)) + DARWIN:=$(findstring Darwin, $(shell uname -s)) +-ifeq ($(CXX), llvm) ++ifeq ($(CXX), clang++) + BUILD_CC ?= $(CLANG_BIN)clang + BUILD_CXX ?= $(CLANG_BIN)clang++ + BUILD_AS ?= $(CLANG_BIN)clang +@@ -85,11 +85,11 @@ ifeq ($(DARWIN),Darwin) + BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -Wall -Werror \ + -Wno-deprecated-declarations -Wno-self-assign -Wno-unused-result -nostdlib -g + else +-ifeq ($(CXX), llvm) ++ifeq ($(CXX), clang++) + BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ + -fno-delete-null-pointer-checks -Wall -Werror \ + -Wno-deprecated-declarations -Wno-self-assign \ +--Wno-unused-result -nostdlib -g ++-Wno-unused-result -Wno-error=unused-result -nostdlib -g + else + BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ + -fno-delete-null-pointer-checks -Wall -Werror \ +@@ -97,7 +97,7 @@ BUILD_CFLAGS = -MD -fshort-wchar -fno-strict-aliasing -fwrapv \ + -Wno-unused-result -nostdlib -g + endif + endif +-ifeq ($(CXX), llvm) ++ifeq ($(CXX), clang++) + BUILD_LFLAGS = + BUILD_CXXFLAGS = -Wno-deprecated-register -Wno-unused-result + else +diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source/C/VfrCompile/GNUmakefile +index fc32994..e8920f9 100644 +--- a/BaseTools/Source/C/VfrCompile/GNUmakefile ++++ b/BaseTools/Source/C/VfrCompile/GNUmakefile +@@ -16,7 +16,7 @@ TOOL_INCLUDE = -I Pccts/h + #OBJECTS = VfrSyntax.o VfrServices.o DLGLexer.o EfiVfrParser.o ATokenBuffer.o DLexerBase.o AParser.o + OBJECTS = AParser.o DLexerBase.o ATokenBuffer.o EfiVfrParser.o VfrLexer.o VfrSyntax.o \ + VfrFormPkg.o VfrError.o VfrUtilityLib.o VfrCompiler.o +-ifeq ($(CXX), llvm) ++ifeq ($(CXX), clang++) + VFR_CPPFLAGS = -Wno-deprecated-register -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS) + else + VFR_CPPFLAGS = -DPCCTS_USE_NAMESPACE_STD $(BUILD_CPPFLAGS) +diff --git a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile +index 559b1c9..f936f09 100644 +--- a/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile ++++ b/BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile +@@ -164,7 +164,7 @@ PCCTS_H=../h + # + # UNIX (default) + # +-ifeq ($(CXX), llvm) ++ifeq ($(CXX), clang++) + BUILD_CC?=$(CLANG_BIN)clang + else + BUILD_CC?=gcc +diff --git a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile +index 5a3561e..9820bd9 100644 +--- a/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile ++++ b/BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile +@@ -114,7 +114,7 @@ PCCTS_H=../h + # + # UNIX + # +-ifeq ($(CXX), llvm) ++ifeq ($(CXX), clang++) + BUILD_CC?=$(CLANG_BIN)clang + else + BUILD_CC?=cc diff --git a/edk2.spec b/edk2.spec index f5dceebefa3a438941e6dc2c67bbfe5aa45f2360..d8622bb9c85834211f8fc00761a797445d448876 100644 --- a/edk2.spec +++ b/edk2.spec @@ -5,7 +5,7 @@ Name: edk2 Version: %{stable_date} -Release: 13 +Release: 14 Summary: EFI Development Kit II License: BSD-2-Clause-Patent URL: https://github.com/tianocore/edk2 @@ -59,6 +59,7 @@ Patch0031: 0031-MdeModulePkg-UsbBusDxe-fix-NOOPT-build-error.patch Patch0032: 0032-BaseTools-GenEfs-GenSec-fix-gcc12-warning.patch Patch0033: 0033-BaseTools-LzmaCompress-fix-gcc12-warning.patch Patch0034: 0034-Basetools-turn-off-gcc12-warning.patch +Patch0035: 0035-support-build-with-clang.patch BuildRequires: acpica-tools gcc gcc-c++ libuuid-devel python3 bc nasm python3-unversioned-command @@ -260,6 +261,9 @@ chmod +x %{buildroot}%{_bindir}/Rsa2048Sha256GenerateKeys %endif %changelog +* Tue Aug 22 2023 feng luo - 202011-14 +- Support build with clang + * Thu Jul 13 2023 Jiabo Feng - 202011-13 - solving the compilation failure problem of gcc 12.3.0