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

[PATCH] build: silence GNU ld 2.39 warning about executable stacks


  • To: Minios-devel <minios-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 Oct 2023 12:20:40 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=2+IzVlAFtYSdi/KBkFxlM3USq41aid8eoLDw79Ig6ZA=; b=Ujt38b1lgZTWwCtG1RTlHp+gLJztqW/Qj2/9maE1xac0icNl1742nI4uYCHtfMeBdDnIu2rJUGAlonze9NLOyl9rRK5noPUODbIy7WVQPMEtzVQu9wUMSfTRUuvfocc/SzZ0dyxR2KSHLlB1nLS1kJS8wBD2Ebjix+/yZDwl4JWi3Hc7VYeTjxjsQSSBh8ZLA1FvZKxTbyOKXBlvDt36e3yhesiqVFtyf9f6imNEY1/K2z6LxLlYjactamUvakKxPIxqjoYti75uQMdsjpXiEFdGw5NwbdZU4vTx9rR5lvP9lZC/irBowDHMoc0PPJtYOmngLLIZtfZCkodXpqc7dw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7oTvfw9BnzgyNhk1WwwKIENdRpNQ4zQWxPbEe4oOhE4COA1j/JPkET21zfoGcHtQOGEFNbdKUqKD7o7GVGDwWa+IFX88Ei+3QKU2uAPjAfFaw6BUXanVlrW/j5e1YleGPu66I9VI+FVw91eIkYPjdcp210wkxGpz/FyFGIJ7+/8MD7fjDxfsnYOPnCGCxYGePuGkKOkA+P6TwX8O/ybsy7dlcpZmvHT5GYrljYVp6qNgKjGr5OS0mK4e56qvwNqYxjBx7llGTifOcuHKLIgG6rTKnhCWazoh/+GNeP3shx2Esrj530moxI3M3qOc025Hf6L/979m+qm1ufewfGG+Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Samuel Thibault <samuel.thibault@xxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Tue, 24 Oct 2023 10:20:59 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

While for C files the compiler is supposed to arrange for emitting
respective information, for assembly sources we're responsible ourselves.

For the new use of cc-option to work we cannot pass -S to the compiler
anymore. We need the compiler to actually invoke the assembler, so switch
to using -c.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/Config.mk
+++ b/Config.mk
@@ -1,4 +1,6 @@
-#
+# Convenient variables
+comma := ,
+
 # Compare $(1) and $(2) and replace $(2) with $(1) if they differ
 #
 # Typically $(1) is a newly generated file and $(2) is the target file
@@ -20,7 +22,7 @@ endef
 #
 # Usage: cflags-y += $(call cc-option,$(CC),-march=winchip-c6,-march=i586)
 cc-option = $(shell if test -z "`echo 'void*p=1;' | \
-              $(1) $(2) -S -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
+              $(1) $(2) -c -o /dev/null -x c - 2>&1 | grep -- $(2) -`"; \
               then echo "$(2)"; else echo "$(3)"; fi ;)
 
 ifneq ($(MINIOS_CONFIG),)
--- a/minios.mk
+++ b/minios.mk
@@ -28,6 +28,10 @@ endif
 # Make the headers define our internal stuff
 DEF_CFLAGS += -D__INSIDE_MINIOS__
 
+# Arrange for assembly files to have a proper .note.GNU-stack section added,
+# to silence warnings otherwise issued by GNU ld 2.39 and newer.
+DEF_ASFLAGS += $(call cc-option,$(CC),-Wa$(comma)--noexecstack)
+
 # Build the CFLAGS and ASFLAGS for compiling and assembling.
 # DEF_... flags are the common mini-os flags,
 # ARCH_... flags may be defined in arch/$(TARGET_ARCH_FAM/rules.mk



 


Rackspace

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