buildroot/package/apitrace/apitrace.mk
Giulio Benetti fdee6c9f39 package/apitrace: fix build failure on m68k architecture
apitrace uses very big switch statements, which causes the build to fail
on m68k, because the offsets there are only 16-bit.

We fix that by using -mlong-jump-table-offsets on m68k, to use 32-bit
offsets for switch statements. That flag is available on gcc version >= 7
but apitrace package already depends on BR2_TOOLCHAIN_GCC_AT_LEAST_7, so
we can use it with no problem.

Fixes:
http://autobuild.buildroot.net/results/7306bf05962fec30fbe98b1eb8ee09b3162b8080/

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-01-30 22:55:46 +01:00

51 lines
1.4 KiB
Makefile

################################################################################
#
# apitrace
#
################################################################################
APITRACE_VERSION = 10.0
APITRACE_SITE = $(call github,apitrace,apitrace,$(APITRACE_VERSION))
APITRACE_LICENSE = MIT
APITRACE_LICENSE_FILES = LICENSE
APITRACE_DEPENDENCIES = host-python3 libpng
ifeq ($(BR2_PACKAGE_XORG7),y)
APITRACE_DEPENDENCIES += xlib_libX11
APITRACE_CONF_OPTS += -DENABLE_X11=ON
else
APITRACE_CONF_OPTS += -DENABLE_X11=OFF
endif
# Gui was never tested, so we prefer to explicitly disable it
APITRACE_CONF_OPTS += -DENABLE_GUI=false
APITRACE_CFLAGS = $(TARGET_CFLAGS)
APITRACE_CXXFLAGS = $(TARGET_CXXFLAGS)
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_68485),y)
# This works around embedded Brotli build failure
APITRACE_CFLAGS += -O0
# CMakeLists.txt sets CMAKE_CXX_FLAGS_<BUILD_TYPE> depending on
# BUILD_TYPE, and this comes after the generic CMAKE_CXX_FLAGS.
# Override CMAKE_BUILD_TYPE so no overrides are applied.
APITRACE_CONF_OPTS += -DCMAKE_BUILD_TYPE=Buildroot
endif
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_85180),y)
# This works around Apitrace itself build failure
APITRACE_CXXFLAGS += -O0
endif
# m68k needs 32-bit offsets in switch tables to build
ifeq ($(BR2_m68k),y)
APITRACE_CXXFLAGS += -mlong-jump-table-offsets
endif
APITRACE_CONF_OPTS += \
-DCMAKE_C_FLAGS="$(APITRACE_CFLAGS)" \
-DCMAKE_CXX_FLAGS="$(APITRACE_CXXFLAGS)"
$(eval $(cmake-package))