From b3001c863be8cd4499fb8690f670b4c8e5c76d75 Mon Sep 17 00:00:00 2001 From: jammyjellyfish Date: Fri, 21 Apr 2023 17:40:24 +0800 Subject: [PATCH] Fix clang build error --- dbxtool.spec | 1 + fix-clang-build-error.patch | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 fix-clang-build-error.patch diff --git a/dbxtool.spec b/dbxtool.spec index d526e8f..161343e 100644 --- a/dbxtool.spec +++ b/dbxtool.spec @@ -9,6 +9,7 @@ URL: https://github.com/vathpela/dbxtool-devel Source0: https://github.com/vathpela/%{name}-devel/archive/%{git_commit_hash}/%{name}-devel-889594f.tar.gz Patch9000: remove-duplicate-efi-defines.patch +Patch9001: fix-clang-build-error.patch BuildRequires: gcc popt-devel efivar-devel >= 35-1 systemd Requires: efivar systemd diff --git a/fix-clang-build-error.patch b/fix-clang-build-error.patch new file mode 100644 index 0000000..1dabb0a --- /dev/null +++ b/fix-clang-build-error.patch @@ -0,0 +1,27 @@ +diff -up dbxtool-devel-889594ffb104e3384fd91395f4f26b8b68fc38e1/Make.defaults.orig2 dbxtool-devel-889594ffb104e3384fd91395f4f26b8b68fc38e1/Make.defaults +--- dbxtool-devel-889594ffb104e3384fd91395f4f26b8b68fc38e1/Make.defaults.orig2 2023-04-21 17:32:14.589427594 +0800 ++++ dbxtool-devel-889594ffb104e3384fd91395f4f26b8b68fc38e1/Make.defaults 2023-04-21 17:37:13.503082890 +0800 +@@ -5,6 +5,7 @@ PREFIX := /usr + + INCDIR = -I$(TOPDIR)/include + CFLAGS = -g3 -Og ++ifeq ($(CC),$(COMPILER)gcc) + BUILDFLAGS = $(CFLAGS) -fPIC -fshort-wchar -fno-strict-aliasing \ + -fno-merge-constants -std=gnu11 -D_GNU_SOURCE \ + -Wall -Wextra -Werror -Werror=format-security \ +@@ -12,6 +13,15 @@ BUILDFLAGS = $(CFLAGS) -fPIC -fshort-wch + -Wno-unused-result -Wno-unused-function -Wno-error=cpp \ + -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong \ + --param=ssp-buffer-size=4 -fexceptions ++else ++BUILDFLAGS = $(CFLAGS) -fPIC -fshort-wchar -fno-strict-aliasing \ ++ -std=gnu11 -D_GNU_SOURCE \ ++ -Wall -Wextra -Werror -Werror=format-security \ ++ -Wsign-compare -Werror=sign-compare \ ++ -Wno-unused-result -Wno-unused-function -Wno-error=cpp \ ++ -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong \ ++ --param=ssp-buffer-size=4 -fexceptions ++endif + ASFLAGS = + LDFLAGS = -nostdlib + CCLDFLAGS = -shared -- Gitee