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

[PATCH 1/5] xen/x86: always consider '/' as a division in assembly


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Wed, 11 Feb 2026 11:46:34 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wFEnF/B/qAAmu6sYYVBneacC7PqpTZjrKWQURe561Zk=; b=GqJAKzafE8HvK4ztE6wm/cDwuFbJll9WW4/QWe34g9x1TMrDd8nA/iUXX0F+unX6YNYE0WrBxvSsdp3LrKVeiEZfMOngi0UXzop9yTYue+H5psRZkuSvRaw+uRnZFeaNvM7AyWHEOaxPGh1cad8V0T9cmt/4ADiyt3SRVn7SNYWKwbep8DzAi6nbqLjGjGz0RaOtgox02nyqh7ne232NfuKMkuTsXXsCK7TGWYlVO4Dh//O/YkcMZosNUB6NdG4Dim4BaSZQ0Bd8nIRs15Ca8gKPVKs/y6UnsY4mAyM48ZHW2TdRiCYQfLbywRVjwqK9KX7jmbxRKGWtbHuHlr015Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=c2JmdyeZs3AnSln0jDWwMWCZDyJgGpkntpGiQS8VzfIu2kH3qYyLkR/fPhs+L5WhFQsgPcJKCrZQaoKnz3xiZN80LeHahGRds1S77Qh6qRfnYz7bCPPeJOyqbg3CWfTgsCl/HW6QeDXPA1mbVnrtLoaNV0DbsoaGkfy5Dby8J40ngI3KAypMaUtmabDoWNcXAZ1QjO6bLtTHRKD43/H8BLlcmQwkENINaWKwOL9gsgHUtEelKrRIbPhk/SlKJwPIjMOkrp1b4cRsddtfjIuTSjITTv494UP5ufempN+s2OcTsPLBfjQIPrDbH0xah9jH3MqWyIpBPU7UdHQxjbe0TA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Wed, 11 Feb 2026 10:47:12 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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>
---
Changes since v1:
 - Guard option setting to x86 only.
 - Adjust comment.
---
 xen/Makefile | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xen/Makefile b/xen/Makefile
index a054315fa4a2..4c83e2a46477 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -413,6 +413,13 @@ ifneq ($(CONFIG_CC_IS_CLANG),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
+ifeq ($(CONFIG_X86),y)
+# 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)
+endif
+
 $(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--noexecstack)
 
 LDFLAGS-$(call ld-option,--warn-rwx-segments) += --no-warn-rwx-segments
-- 
2.51.0




 


Rackspace

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