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

[xen staging-4.20] xen: add non-executable stack note uniformly



commit 6a0a1202c69383c0d0ac62019ac41a3a56fd4cea
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Wed Mar 4 14:52:21 2026 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Mar 4 14:52:21 2026 +0100

    xen: add non-executable stack note uniformly
    
    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>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    master commit: 3dfd77003c28ff3f6bfbf76a75d40a41ccecb33f
    master date: 2026-02-13 16:42:42 +0100
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/Makefile b/xen/Makefile
index b7b5941159..19d4e56bd2 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -415,7 +415,7 @@ endif
 
 AFLAGS += -D__ASSEMBLY__
 
-$(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
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging-4.20



 


Rackspace

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