kumquat-buildroot/package/cmocka/cmocka.mk
Joel Carlson 5622c76bf4 package/cmocka: fix build on Thumb classic configurations
The cmocka package checks if a toolchain supports the
-fstack-clash-protection compiler flag, and if it does automatically
uses it. That flag is not supported by GCC for Thumb1 builds (at least
as of both GCC 11 and GCC 12). Let's tell cmocka about this by passing
-DWITH_STACK_CLASH_PROTECTION=OFF in this configuration, as suggested
by Arnout Vandecappelle.

Fixes:
http://autobuild.buildroot.net/results/4044b3a71d3130d934c7a7c0c5badfabb2a97030/

Signed-off-by: Joel Carlson <JoelsonCarl@gmail.com>
[Thomas: change the initial patch from Joel to use the suggestion from
Arnout]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2023-07-31 00:12:26 +02:00

30 lines
869 B
Makefile

################################################################################
#
# cmocka
#
################################################################################
CMOCKA_VERSION = 1.1.5
CMOCKA_SOURCE = cmocka-$(CMOCKA_VERSION).tar.xz
CMOCKA_SITE = https://cmocka.org/files/1.1
CMOCKA_LICENSE = Apache-2.0
CMOCKA_LICENSE_FILES = COPYING
CMOCKA_INSTALL_STAGING = YES
CMOCKA_CONF_OPTS = -DWITH_EXAMPLES=OFF
# cmocka only supports out of source builds
CMOCKA_SUPPORTS_IN_SOURCE_BUILD = NO
# cmocka always builds a shared library, but you can optionally build a static
# library as well
ifeq ($(BR2_SHARED_STATIC_LIBS),y)
CMOCKA_CONF_OPTS += -DWITH_STATIC_LIB=ON
endif
# gcc for ARM Thumb1 doesn't implement -fstack-clash-protection
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
CMOCKA_CONF_OPTS += -DWITH_STACK_CLASH_PROTECTION=OFF
endif
$(eval $(cmake-package))