From 7f4d14b06f356fb2ad828d88d25d0820e2daafa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Wed, 14 Feb 2018 12:21:05 +0100 Subject: [PATCH] buildsys: check for indirect/RETPOLINE gcc support copied from arch/x86/Makefile --- Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 491b8ea..832b135 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,12 @@ export SOURCE_DATE_EPOCH ?= $(shell dpkg-parsechangelog -STimestamp -lchangelog. SKIPABI=0 +ifeq ($(CC), cc) +GCC=gcc +else +GCC=$(CC) +endif + TOP=$(shell pwd) KERNEL_CFG_ORG=config-${KERNEL_VER}.org @@ -100,12 +106,13 @@ ${VIRTUAL_HDR_DEB}: proxmox-ve/pve-headers.control gzip -n --best pve-headers/data/usr/share/doc/${VIRTUALHDRPACKAGE}/changelog.Debian dpkg-deb --build pve-headers/data ${VIRTUAL_HDR_DEB} -check_gcc: -ifeq ($(CC), cc) - gcc --version|grep "6\.3" || false -else - $(CC) --version|grep "6\.3" || false -endif +check_gcc: + $(GCC) --version|grep "6\.3" || false + @$(GCC) -Werror -mindirect-branch=thunk-extern -mindirect-branch-register -c -x c /dev/null -o check_gcc.o \ + || ( rm -f check_gcc.o; \ + echo "Please install gcc-6 packages with indirect thunk / RETPOLINE support"; \ + false) + @rm -f check_gcc.o ${DST_DEB}: data control.in prerm.in postinst.in postrm.in copyright changelog.Debian | fwcheck abicheck mkdir -p data/DEBIAN