8bc468
From 4878775c8e0f2ea6869aff139d219f6eb0c4006c Mon Sep 17 00:00:00 2001
8bc468
From: Adrian Reber <areber@redhat.com>
8bc468
Date: Fri, 28 Jan 2022 15:10:31 +0000
8bc468
Subject: [PATCH] Fix building with annobin
8bc468
8bc468
Annobin (used at least in Fedora and RHEL) injects annotation into the
8bc468
compiled objects which break the parasite and restorer.
8bc468
8bc468
This removes the annobin flags as used in Fedora and RHEL and makes CRIU
8bc468
work on Fedora and RHEL with annobin enabled.
8bc468
8bc468
Signed-off-by: Adrian Reber <areber@redhat.com>
8bc468
---
8bc468
 compel/plugins/Makefile   | 2 +-
8bc468
 criu/pie/Makefile         | 2 +-
8bc468
 criu/pie/Makefile.library | 2 +-
8bc468
 3 files changed, 3 insertions(+), 3 deletions(-)
8bc468
8bc468
diff --git a/compel/plugins/Makefile b/compel/plugins/Makefile
8bc468
index e5fa781ac..37630d438 100644
8bc468
--- a/compel/plugins/Makefile
8bc468
+++ b/compel/plugins/Makefile
8bc468
@@ -1,4 +1,4 @@
8bc468
-CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
8bc468
+CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN) -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1,$(CFLAGS))
8bc468
 CFLAGS		+= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
8bc468
 CFLAGS		+= -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
8bc468
 
8bc468
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
8bc468
index 265dcf82b..386626334 100644
8bc468
--- a/criu/pie/Makefile
8bc468
+++ b/criu/pie/Makefile
8bc468
@@ -4,7 +4,7 @@
8bc468
 
8bc468
 target		:= parasite restorer
8bc468
 
8bc468
-CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
8bc468
+CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN) -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1,$(CFLAGS))
8bc468
 CFLAGS		+= $(CFLAGS_PIE)
8bc468
 ccflags-y	+= -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
8bc468
 ccflags-y	+= -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=0
8bc468
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
8bc468
index da2a2fab3..6247afe7e 100644
8bc468
--- a/criu/pie/Makefile.library
8bc468
+++ b/criu/pie/Makefile.library
8bc468
@@ -21,7 +21,7 @@ ifeq ($(ARCH),arm)
8bc468
         lib-y		+= ./$(ARCH_DIR)/pie-cacheflush.o
8bc468
 endif
8bc468
 
8bc468
-CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
8bc468
+CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN) -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1,$(CFLAGS))
8bc468
 CFLAGS		+= $(CFLAGS_PIE)
8bc468
 
8bc468
 ifeq ($(ARCH),mips)
8bc468
-- 
8bc468
2.34.1
8bc468