Provide -target and -march explicitly when building with clang. This makes cross-compilation much easier, because clang accept this parameters regardless of host platform. Basically,
make XEN_TARGET_ARCH=arm64 clang=y llvm=y will behave in the same way if building Xen on x86, or on arm64 or on any other platform. -march is required because with default value, clang will not recognize EL2 registers. Signed-off-by: Volodymyr Babchuk <[email protected]> --- config/arm64.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/arm64.mk b/config/arm64.mk index c4662f67d0..97eb9a82e7 100644 --- a/config/arm64.mk +++ b/config/arm64.mk @@ -5,6 +5,10 @@ CONFIG_XEN_INSTALL_SUFFIX := CFLAGS += #-marm -march= -mcpu= etc +ifeq ($(clang),y) +CFLAGS += -target aarch64 -march=armv8-a +endif + # Use only if calling $(LD) directly. LDFLAGS_DIRECT += -EL -- 2.47.0
