diff --git a/0040-support-build-with-clang.patch b/0040-support-build-with-clang.patch new file mode 100644 index 0000000000000000000000000000000000000000..05ae9f44841a7cb11b116b84b23b105104422301 --- /dev/null +++ b/0040-support-build-with-clang.patch @@ -0,0 +1,105 @@ +From 0bc6ab936cc95aad6df04ccb1717254581b19f6a Mon Sep 17 00:00:00 2001 +From: luofeng +Date: Tue, 12 Sep 2023 21:59:05 +0800 +Subject: [PATCH] support clang build + +--- + BaseTools/Source/C/DevicePath/GNUmakefile | 2 ++ + BaseTools/Source/C/Makefiles/header.makefile | 8 ++++---- + BaseTools/Source/C/VfrCompile/GNUmakefile | 2 +- + BaseTools/Source/C/VfrCompile/Pccts/antlr/makefile | 2 +- + BaseTools/Source/C/VfrCompile/Pccts/dlg/makefile | 2 +- + 5 files changed, 9 insertions(+), 7 deletions(-) + +diff --git a/BaseTools/Source/C/DevicePath/GNUmakefile b/BaseTools/Source/C/DevicePath/GNUmakefile +index b05d2bd..d575317 100644 +--- a/BaseTools/Source/C/DevicePath/GNUmakefile ++++ b/BaseTools/Source/C/DevicePath/GNUmakefile +@@ -14,7 +14,9 @@ OBJECTS = DevicePath.o UefiDevicePathLib.o DevicePathFromText.o DevicePathUtili + include $(MAKEROOT)/Makefiles/app.makefile + + # gcc 12 trips over device path handling ++ifeq ($(CXX), g++) + BUILD_CFLAGS += -Wno-error=stringop-overflow ++endif + + LIBS = -lCommon + ifeq ($(CYGWIN), CYGWIN) +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 +-- +2.33.0 + diff --git a/edk2.spec b/edk2.spec index ec38354399ab76989ea51c997a3b2e9ba0e3fc51..5ee554478b75eedd10b49bdfbadeb61b2fc3a4d6 100644 --- a/edk2.spec +++ b/edk2.spec @@ -7,7 +7,7 @@ Name: edk2 Version: %{stable_date} -Release: 5 +Release: 6 Summary: EFI Development Kit II License: BSD-2-Clause-Patent and OpenSSL and MIT URL: https://github.com/tianocore/edk2 @@ -60,6 +60,7 @@ patch36: 0036-NetworkPkg-Dhcp6Dxe-SECURITY-PATCH-CVE-2023-45229-Re.patch patch37: 0037-NetworkPkg-Dhcp6Dxe-Removes-duplicate-check-and-repl.patch patch38: 0038-NetworkPkg-Dhcp6Dxe-Packet-Length-is-not-updated-bef.patch patch39: 0039-NetworkPkg-Updating-SecurityFixes.yaml.patch +Patch40: 0040-support-build-with-clang.patch BuildRequires: acpica-tools gcc gcc-c++ libuuid-devel python3 bc nasm python3-unversioned-command isl @@ -297,6 +298,9 @@ chmod +x %{buildroot}%{_bindir}/Rsa2048Sha256GenerateKeys %endif %changelog +* Thu Mar 7 2024 luofeng - 202308-6 +- Support build with clang + * Thu Mar 7 2024 yexiao - 202308-5 - fix CVE-2023-45229、CVE-2023-45230、CVE-2023-45231、CVE-2023-45232、CVE-2023-45233、CVE-2023-45234、CVE-2023-45235 @@ -315,7 +319,7 @@ chmod +x %{buildroot}%{_bindir}/Rsa2048Sha256GenerateKeys * Thu Jul 13 2023 Jiabo Feng - 202011-13 - solving the compilation failure problem of gcc 12.3.0 -* Fri Mar 10 2023 yexiao - 202011-12 +* Fri March 10 2023 yexiao - 202011-12 - fix CVE-2022-4304 * Sun Feb 26 2023 chenhuiying - 202011-11