[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xen staging] xen/x86: always consider '/' as a division in assembly



commit 6ccdd6cb46029c024482635870c23c7ff7723434
Author:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
AuthorDate: Tue Feb 10 16:06:08 2026 +0100
Commit:     Roger Pau Monne <roger.pau@xxxxxxxxxx>
CommitDate: Thu Feb 12 19:21:46 2026 +0100

    xen/x86: always consider '/' as a division in assembly
    
    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 <jbeulich@xxxxxxxx>
    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 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)
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.