From 7953b4037eedcd27d214b7e77d7ccfb9d229e3f3 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 15 Mar 2018 14:09:37 -0700 Subject: [PATCH] Fix zdtm with Ubuntu Bionic/arm/clang 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 --- test/zdtm/Makefile.inc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc index 5e8836e90..673fa1bc6 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)