[CRIU] [PATCH 1/5] Fix zdtm with Ubuntu Bionic/arm/clang

Kir Kolyshkin kolyshkin at gmail.com
Fri Mar 16 00:09:37 MSK 2018


In Ubuntu Bionic for armhf, clang is compiled for armv8l rather than
armv7l (as it was and still is for gcc) and so it uses armv8 by default.

This breaks compilation of tests using smp_mb():

> error: instruction requires: data-barriers

The fix is to add "-march=armv7-a" to CFLAGS which we already do,
except not for the tests.

Signed-off-by: Kir Kolyshkin <kolyshkin at gmail.com>
---
 test/zdtm/Makefile.inc | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc
index 5e8836e9..673fa1bc 100644
--- a/test/zdtm/Makefile.inc
+++ b/test/zdtm/Makefile.inc
@@ -21,6 +21,16 @@ endif
 
 SRCARCH ?= $(ARCH)
 
+ifeq ($(ARCH),arm)
+	ARMV := $(shell echo $(UNAME-M) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
+
+	ifeq ($(ARMV),6)
+		USERCFLAGS += -march=armv6
+	else ifeq ($(ARMV),7)
+		USERCFLAGS += -march=armv7-a
+	endif
+endif
+
 CC	:= gcc
 CFLAGS	+= -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
 CFLAGS	+= $(USERCFLAGS)
-- 
2.14.1



More information about the CRIU mailing list