[CRIU] [PATCH 02/10] arm/build: Move -marm cflag to CFLAGS_PIE

Dmitry Safonov dima at arista.com
Sat May 18 01:53:01 MSK 2019


I don't want to see CFLAGS redefined per-architecture in PIE makefiles
in couple of places. Clean it up.
The only expected per-arch ifdeffery should be object files.
Also add a big comment about -marm vs -mthumb[2]

Signed-off-by: Dmitry Safonov <dima at arista.com>
---
 Makefile                  | 7 +++++++
 criu/pie/Makefile         | 4 ----
 criu/pie/Makefile.library | 5 -----
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 38887da99454..50948787ae35 100644
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,13 @@ ifeq ($(ARCH),arm)
         endif
 
         PROTOUFIX	:= y
+	# For simplicity - compile code in Arm mode without interwork.
+	# We could choose Thumb mode as default instead - but a dirty
+	# experiment shows that with 90Kb PIEs Thumb code doesn't save
+	# even one page. So, let's stick so far to Arm mode as it's more
+	# universal around all different Arm variations, until someone
+	# will find any use for Thumb mode. -dima
+        CFLAGS_PIE	:= -marm
 endif
 
 ifeq ($(ARCH),aarch64)
diff --git a/criu/pie/Makefile b/criu/pie/Makefile
index 739191308e70..c9e8a3d82286 100644
--- a/criu/pie/Makefile
+++ b/criu/pie/Makefile
@@ -17,10 +17,6 @@ ifneq ($(filter-out clean mrproper,$(MAKECMDGOALS)),)
 	compel_plugins	:= $(shell $(COMPEL_BIN) plugins)
 endif
 
-ifeq ($(SRCARCH),arm)
-	ccflags-y	+= -marm
-endif
-
 asflags-y	+= -D__ASSEMBLY__
 
 LDS		:= compel/arch/$(SRCARCH)/scripts/compel-pack.lds.S
diff --git a/criu/pie/Makefile.library b/criu/pie/Makefile.library
index a48a0ea4c98e..b7918438bb1f 100644
--- a/criu/pie/Makefile.library
+++ b/criu/pie/Makefile.library
@@ -38,8 +38,3 @@ CFLAGS		:= $(filter-out -pg $(CFLAGS-GCOV) $(CFLAGS-ASAN),$(CFLAGS))
 asflags-y		:= -D__ASSEMBLY__
 ccflags-y		+= $(COMPEL_UAPI_INCLUDES)
 ccflags-y		+= $(CFLAGS_PIE)
-
-ifeq ($(SRCARCH),arm)
-	ccflags-y	+= -marm
-endif
-
-- 
2.21.0



More information about the CRIU mailing list