All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: refine compiler target architecture
@ 2013-12-17  9:34 Andre Przywara
  2013-12-17 10:21 ` Ian Campbell
  0 siblings, 1 reply; 5+ messages in thread
From: Andre Przywara @ 2013-12-17  9:34 UTC (permalink / raw)
  To: Ian.Campbell, stefano.stabellini
  Cc: xen-devel, julien.grall, Andre Przywara, patches

Currently we compile the tools just with -marm. This breaks
compilation when the toolchain default is less than ARMv7, because
we require the "dmb" instruction in xenstored.
One possible (and working) fix would be to just adjust that for the
tools, but in fact the same rationale is true for the hypervisor.
So lets mandate ARMv7-A as the minimum for both Xen and the tools.

Unfortunately for some reasons -mcpu=cortex-a15 does not go together
with this -march, so lets be more generic and explicitly specify the
architecture extensions we actually need for the hypervisor.

This fixes native tool compilation on my Slackware system.

Signed-off-by: Andre Przywara <andre.przywara@linaro.org>
---

Not sure if this is safe enough for 4.4. On normal build environemnts
this shouldn't change anything, but one never knows.
In any case I want to drop it here for reference. I will try to do some
tests to prove that it's harmless enough.

Regards,
Andre.

 config/arm32.mk       | 4 ++--
 xen/arch/arm/Rules.mk | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/config/arm32.mk b/config/arm32.mk
index aa79d22..c5eb30e 100644
--- a/config/arm32.mk
+++ b/config/arm32.mk
@@ -6,8 +6,8 @@ CONFIG_XEN_INSTALL_SUFFIX :=
 
 # -march= -mcpu=
 
-# Explicitly specifiy 32-bit ARM ISA since toolchain default can be -mthumb:
-CFLAGS += -marm
+# Explicitly specifiy 32-bit ARMv7-A ISA since toolchain default can be less:
+CFLAGS += -marm -march=armv7-a
 
 HAS_PL011 := y
 HAS_EXYNOS4210 := y
diff --git a/xen/arch/arm/Rules.mk b/xen/arch/arm/Rules.mk
index aaa203e..891df25 100644
--- a/xen/arch/arm/Rules.mk
+++ b/xen/arch/arm/Rules.mk
@@ -20,7 +20,8 @@ arm := y
 ifeq ($(TARGET_SUBARCH),arm32)
 # Prevent floating-point variables from creeping into Xen.
 CFLAGS += -msoft-float
-CFLAGS += -mcpu=cortex-a15
+# allow assembly of virtualization extension instructions and smc for PSCI
+CFLAGS += -Wa,-march=armv7-a+sec+virt
 arm32 := y
 arm64 := n
 endif
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-12-18  9:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17  9:34 [PATCH] ARM: refine compiler target architecture Andre Przywara
2013-12-17 10:21 ` Ian Campbell
2013-12-18  7:48   ` Andre Przywara
2013-12-18  8:29     ` Ian Campbell
2013-12-18  9:01       ` Andre Przywara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.