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

[PATCH 2/2] xen: add non-executable stack note uniformly


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 13 Feb 2026 14:56:14 +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=C6e9XKDp17m+e3nE3c73RDXKcJSz1yuYkM6ZLkwd094=; b=JaiTafasITTkino74wppYtIok6c+na+r4s1uSkHPyRFMxy0WSinICcPeyFaWmBT7WEFI/19dvZPv+p28RWyFv+4A3X0d+hUYOaabxnX09oU/Jpo3/RxvUu1yFdiin8OHfCB7zbLy6P8SAjWfjjeyScEF38+ztpn3UuCA8NpXbIvFae0pCFTDRvuPNHY0Xu8uBi+vpE55t37SrhMtPwot+FUvAr0YUz9Cf2/FVri3LtTzvU7dmNEvACjvMWBEKfPa0cMtZzDqQz7fgq4ktsRrvbwAAdNHUlkFcCystx+EzsDbMTfHGs8Xmf1nR9t75006MT9Jgus0C+LPqsPVCsK39Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=YeMjk1pus56FBdhhD+FvTkMgUyTghOJFzpQYrJU6eFTORUm4Gk+joxkhNenoQR3n2vfw3wAuezB+1wHSSJhL0J7xHuXItWxyrqlEdlqcFGNSZb/kVNLCOR7mcRhiO/Fs2f0d8/PwkMgu52diAF9hMDCnkkX7e8osdhm2Jtww5ryPoYXz/IZMtyvcc4dTyPUSOaHqhLMuyVTstLWpkEu/HIKX8HEROrVi5A9rSgjwMmoGwXlEVC15uC3zLYFKbTevlLnyMloKlrSF5+9ambly7sO1wTLIbSnVouTG80mtmQje0PRbc4PI/49tVkNsHKT/TUcMBh8pErm4tKXKgmnWuA==
  • 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: Fri, 13 Feb 2026 13:56:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Currently the -Wa,--noexecstack parameter is only passed to the compiler
when building assembly files, as the assembler doesn't add such note for
stack attributes.

However, the default addition of the .note.GNU-stack section is dependent
on the ELF target used.  Adjust the passing of -Wa,--noexecstack so it's
added to CFLAGS instead of AFLAGS, and hence such section is also added to
object files generated from .c sources.  This fixes the complains from the
linker about missing .note.GNU-stack section when building x86-64 Xen on
Darwin platforms.

Note we could instead pass `-z noexecstack` to the linker, but that however
would mask any possible errors or unintended mismatches from previous
steps.

Suggested-by: Jan Beulich <jbeulich@xxxxxxxx>
Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index a054315fa4a2..a2b442e76d5c 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -413,7 +413,7 @@ ifneq ($(CONFIG_CC_IS_CLANG),y)
 CFLAGS += -Wa,--strip-local-absolute
 endif
 
-$(call cc-option-add,AFLAGS,CC,-Wa$$(comma)--noexecstack)
+$(call cc-option-add,CFLAGS,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®.