kumquat-buildroot/boot/shim/shim.mk
Fabrice Fontaine 66a202325a boot/shim: force arm mode instead of Thumb mode
Use OPTIMIZATIONS parameter to pass -marm to fix the following build
failure in Thumb mode:

/tmp/ccEjPM4h.s:941: Error: selected processor does not support `mrc p15,0,r2,c9,c13,0' in Thumb mode

CFLAGS can't be overridden as it is defined as:
CFLAGS		= $(FEATUREFLAGS) \
		  $(OPTIMIZATIONS) \
		  $(WARNFLAGS) \
		  $(if $(findstring clang,$(CC)),$(CLANG_WARNINGS)) \
		  $(ARCH_CFLAGS) \
		  $(WERRFLAGS) \
		  $(INCLUDES) \
		  $(DEFINES)

Fixes:
 - http://autobuild.buildroot.org/results/580156f89cfd72122fef07aa2fe37b4fdd4c316b
 - http://autobuild.buildroot.org/results/8980c0f422516c7263d8d0c9cc6123f30c4b7ee4

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2024-03-01 19:05:28 +01:00

39 lines
1.1 KiB
Makefile

################################################################################
#
# shim
#
################################################################################
SHIM_VERSION = 15.8
SHIM_SITE = https://github.com/rhboot/shim/releases/download/$(SHIM_VERSION)
SHIM_SOURCE = shim-$(SHIM_VERSION).tar.bz2
SHIM_LICENSE = BSD-2-Clause
SHIM_LICENSE_FILES = COPYRIGHT
SHIM_CPE_ID_VENDOR = redhat
SHIM_INSTALL_TARGET = NO
SHIM_INSTALL_IMAGES = YES
SHIM_CFLAGS = $(TARGET_CFLAGS)
SHIM_MAKE_OPTS = \
ARCH="$(GNU_EFI_PLATFORM)" \
CROSS_COMPILE="$(TARGET_CROSS)" \
DASHJ="-j$(PARALLEL_JOBS)" \
OPTIMIZATIONS="$(SHIM_CFLAGS)"
# shim has some assembly function that is not present in Thumb mode:
# Error: selected processor does not support `mrc p15,0,r2,c9,c13,0' in Thumb mode
# so, we desactivate Thumb mode
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
SHIM_CFLAGS += -marm
endif
define SHIM_BUILD_CMDS
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(SHIM_MAKE_OPTS)
endef
define SHIM_INSTALL_IMAGES_CMDS
$(INSTALL) -m 0755 -t $(BINARIES_DIR) $(@D)/*.efi
endef
$(eval $(generic-package))