From 6ccdd6cb46029c024482635870c23c7ff7723434 Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Tue, 10 Feb 2026 16:06:08 +0100 Subject: [PATCH] xen/x86: always consider '/' as a division in assembly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On x86 GNU assembler will consider '/' as the start of comment marker for some ELF targets. This is incorrect with Xen's usage, which does use '/' in assembly files as a mathematical operator. The behavior of the assembler can be altered by passing the --divide option; unconditionally pass this option when available to force the expected behavior. Reported-by: Jan Beulich Signed-off-by: Roger Pau Monné Reviewed-by: Jan Beulich Acked-by: Andrew Cooper --- xen/arch/x86/arch.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/xen/arch/x86/arch.mk b/xen/arch/x86/arch.mk index 0203138a81..2e06ae2582 100644 --- a/xen/arch/x86/arch.mk +++ b/xen/arch/x86/arch.mk @@ -123,3 +123,8 @@ endif # Set up the assembler include path properly for older toolchains. CFLAGS += -Wa,-I$(objtree)/include -Wa,-I$(srctree)/include + +# The GNU assembler will interpret '/' as a comment start marker instead of a +# divide for some ELF targets. Pass --divide when when available to signal '/' +# is always used as an operator in assembly. +$(call cc-option-add,CFLAGS,CC,-Wa$$(comma)--divide)