summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2022-05-18 15:37:42 -0400
committerPeter Jones <pjones@redhat.com>2022-05-18 16:37:23 -0400
commitabe41ab1259a86e0979803bb0b040a8df98cfdb4 (patch)
tree0183e836feb04c6c80de221bb61d8e46ae938f1a
parentf81a7cc34e0b1a4f2d3104f44df80f93497eaa9e (diff)
downloadefi-boot-shim-abe41ab1259a86e0979803bb0b040a8df98cfdb4.tar.gz
efi-boot-shim-abe41ab1259a86e0979803bb0b040a8df98cfdb4.zip
make: unbreak scan-build again for gnu-efi
When using clang-analyzer, scan-build sets CC to /usr/bin/../libexec/ccc-analyzer, which for whatever reason when we're in the sub-make to build gnu-efi, then gets confused and invokes gcc rather than clang. This causes gnu-efi's attempt to check which compiler it's using to fail, because "/usr/bin/../libexec/ccc-analyzer -v" invokes GCC. At that point ccc-analyzer complains that it can't find the clang invocation in its own output, which it chose not to use clang for, as such: /usr/bin/../libexec/ccc-analyzer -I/home/pjones/devel/github.com/shim/worktree/gnu-efi//lib -I/home/pjones/devel/github.com/shim/worktree/gnu-efi/inc -I/home/pjones/devel/github.com/shim/worktree/gnu-efi/inc/x86_64 -I/home/pjones/devel/github.com/shim/worktree/gnu-efi/inc/protocol -Wno-error=pragmas -mno-red-zone -mno-avx -fpic -Os -Wall -Wextra -Wno-missing-field-initializers -Werror -fshort-wchar -fno-strict-aliasing -ffreestanding -fno-stack-protector -fno-stack-check -nostdinc -isystem /home/pjones/devel/github.com/shim/worktree/gnu-efi/../include/system -isystem /usr/lib/gcc/x86_64-redhat-linux/11/include -DCONFIG_x86_64 -DGNU_EFI_USE_MS_ABI -DGNU_EFI_USE_EXTERNAL_STDARG -maccumulate-outgoing-args --std=c11 -c /home/pjones/devel/github.com/shim/worktree/gnu-efi//lib/smbios.c -o smbios.o could not find clang line make[3]: *** [/home/pjones/devel/github.com/shim/worktree/gnu-efi//lib/../Make.rules:52: smbios.o] Error 1 This patch passes CCC_CC=$(COMPILER) to the gnu-efi sub-make, which forces ccc-analyzer to use $(COMPILER), which is still clang. Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 1d5e9d1b..5fbea7f9 100644
--- a/Makefile
+++ b/Makefile
@@ -151,6 +151,7 @@ gnu-efi/$(ARCH_GNUEFI)/gnuefi/libgnuefi.a gnu-efi/$(ARCH_GNUEFI)/lib/libefi.a:
mkdir -p gnu-efi/lib gnu-efi/gnuefi
$(MAKE) -C gnu-efi \
COMPILER="$(COMPILER)" \
+ CCC_CC="$(COMPILER)" \
CC="$(CC)" \
ARCH=$(ARCH_GNUEFI) \
TOPDIR=$(TOPDIR)/gnu-efi \