buildsys: check for indirect/RETPOLINE gcc support

copied from arch/x86/Makefile
This commit is contained in:
Fabian Grünbichler 2018-02-14 12:21:05 +01:00
parent ef812b062d
commit 7f4d14b06f

View File

@ -31,6 +31,12 @@ export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp -lchangelog.
SKIPABI=0 SKIPABI=0
ifeq ($(CC), cc)
GCC=gcc
else
GCC=$(CC)
endif
TOP=$(shell pwd) TOP=$(shell pwd)
KERNEL_CFG_ORG=config-${KERNEL_VER}.org KERNEL_CFG_ORG=config-${KERNEL_VER}.org
@ -101,11 +107,12 @@ ${VIRTUAL_HDR_DEB}: proxmox-ve/pve-headers.control
dpkg-deb --build pve-headers/data ${VIRTUAL_HDR_DEB} dpkg-deb --build pve-headers/data ${VIRTUAL_HDR_DEB}
check_gcc: check_gcc:
ifeq ($(CC), cc) $(GCC) --version|grep "6\.3" || false
gcc --version|grep "6\.3" || false @$(GCC) -Werror -mindirect-branch=thunk-extern -mindirect-branch-register -c -x c /dev/null -o check_gcc.o \
else || ( rm -f check_gcc.o; \
$(CC) --version|grep "6\.3" || false echo "Please install gcc-6 packages with indirect thunk / RETPOLINE support"; \
endif false)
@rm -f check_gcc.o
${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian | fwcheck abicheck ${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian | fwcheck abicheck
mkdir -p data/DEBIAN mkdir -p data/DEBIAN