From 254094d66fea22ec36733e8a7d7b4c7d97bfded7 Mon Sep 17 00:00:00 2001 From: Michael Holzheu Date: Fri, 14 Jul 2017 11:23:26 +0200 Subject: [PATCH] s390: Prevent GOT relocations Use the "-fno-optimize-sibling-calls" gcc option to prevent GOT relocations caused by gcc versions without the commit "S/390: Fix 64 bit sibcall": * https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=233169 Otherwise we get compile errors like: GEN criu/pie/parasite-blob.h Error (compel/src/lib/handle-elf-host.c:572): Unsupported relocation of type 26 Those can be caused by the following relocation types: * R_390_GOTENT (e.g. RHEL7 based systems) * R_390_GOTPCDBL (e.g. Debian Jessie) * R_390_GOT12 (e.g. Debian Jessie) Signed-off-by: Michael Holzheu Signed-off-by: Andrei Vagin --- Makefile.compel | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile.compel b/Makefile.compel index 9b40079b3..5c854e3dc 100644 --- a/Makefile.compel +++ b/Makefile.compel @@ -71,10 +71,12 @@ compel-install-targets += compel/$(LIBCOMPEL_SO) compel-install-targets += compel/compel compel-install-targets += $(compel-plugins) -# We assume that compel code does not change floating point registers. -# On s390 gcc uses fprs to cache gprs. Therefore disable floating point -# with -msoft-float. +# +# Also ensure with -fno-optimize-sibling-calls that we don't create GOT +# (Global Offset Table) relocations with gcc compilers that don't have +# commit "S/390: Fix 64 bit sibcall". +# ifeq ($(ARCH),s390) -CFLAGS += -msoft-float -HOSTCFLAGS += -msoft-float +CFLAGS += -msoft-float -fno-optimize-sibling-calls +HOSTCFLAGS += -msoft-float -fno-optimize-sibling-calls endif