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

[PATCH 2/2] tools/firmware: do not add a .note.gnu.property section


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Fri, 1 Apr 2022 16:37:19 +0200
  • 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=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=0WF9KvEYEzdfBix0SwaBl+hEi0VZ8z9aUzi13sJkjWA=; b=L8MBkNjSx7UiOtV3YJlr74jXJa/dC8RSEMdu8/jOYdM7a/MMcnl8R7b3II9DnI7RHA0hvMEOU513e+u5hJzQEtpCscSkKnE23bg7At94JisdC2zzq+RQLxxKz3gYPDwJNelnbrIU/yFQ15rYbPhLawMDhIjrN6w745gdGYQs8dhMWspEBkUEkfIfjbZ5iBd9OBbLJbu2og0L1BFrUoM9l3oQhjuNGXWp+glgOvrSyHvrRNh9BjLG+Gs61FImihbA3TxX/9jdGKJlOLsoBgiUNIDEQdjDB9mDdm38JnX4cxr3KxYifL99A+l6ngZ8tTId7Hzax4fA1KF+HYsx8r8T+w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AMgTfOOEbgSizV2T/0ybHtkedXa0//FktUTPSJRDwER5kxzzw4i/eqTD2VPDU3oglKmMGKZ5XrWMBiYPTW/CeviANQAxbk4JZVFF2pV/tfJIwOaPRPvi5pgP1OAB0NWtF85H5gxpEj60Kf36eDD+htIwx84E8vtB/46PZWIzLiXY2xJfjPhjg+9iAY5FCe4PvJ4NwuYJbspD5cj4OWbuqJvy+67jDhqzNZ+TPiBC5GpcVdqcpYfiBnmSx7gUpwEFZ4jm0ci4y4vUK7Oxnz4uroESbvTPH4wnk1ryKlHoYp0piazE/fE8VNb8PnEaZaqBJVepWpTDFsho3b3Rsuk7mw==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Fri, 01 Apr 2022 14:37:59 +0000
  • Ironport-data: A9a23:GMiM8qxFqMnmyzK23KR6t+cIxirEfRIJ4+MujC+fZmUNrF6WrkUAm 2RNUDrSPa6LZmHweIwna9+38EoF7JPQzINjHQc9/iAxQypGp/SeCIXCJC8cHc8zwu4v7q5Dx 59DAjUVBJlsFhcwnj/0bv656yMUOZigHtIQMsadUsxKbVIiGX9JZS5LwbZj2NY02YHhWWthh PupyyHhEA79s9JLGjp8B5Kr8HuDa9yr5Vv0FnRnDRx6lAe2e0s9VfrzFonoR5fMeaFGH/bSe gr25OrRElU1XfsaIojNfr7TKiXmS1NJVOSEoiI+t6OK2nCuqsGuu0qS2TV1hUp/0l20c95NJ NplvJ/tTiMVPYvwvssYVxN5EC9aB+pGweqSSZS/mZT7I0zudnLtx7NlDV0sPJ1e8eFyaY1M3 aVGcnZXNEnF3r/ohuLgIgVvrp1LwM3DJoQQt2sm1TjEJf0nXYrCU+PB4towMDIY2J8QQq2FN 5BxhTxHYzvcSEdGBVguCpMbnMOZi1/iSBZJgQfAzUYwyzeKl1EguFT3C/LOYcCDT8hRmkeep 0rF8n7/DxVcM8aQoRKa9lq8i+mJmjn0MKo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h0C0qX0tnao4lHpES7YTb7dXsMg24F5VKpEdByj3gbpXXN WGNPuspcq+TGnqL0ww5gJUsZ+RtzUIb1q7q3E5y4KoO2M8pgE686MarPZv6kvouqhNDqWs3N 60QZiApIs+PvP+UpgNdtvpOfHHclAlYSi8Rl56cm6XXZ3uBRr22uvKCfMOlaWXRKA=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Prevent the assembler from creating a .note.gnu.property section on
the output objects, as it's not useful for firmware related binaries,
and breaks the resulting rombios image.

This requires modifying the cc-option Makefile macro so it can test
assembler options (by replacing the usage of the -S flag with -c) and
also stripping the -Wa, prefix if present when checking for the test
output.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 Config.mk               | 2 +-
 tools/firmware/Rules.mk | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/Config.mk b/Config.mk
index f56f7dc334..82832945e5 100644
--- a/Config.mk
+++ b/Config.mk
@@ -91,7 +91,7 @@ PYTHON_PREFIX_ARG ?= --prefix="$(prefix)"
 #
 # 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:-Wa$(comma)%=%) -`"; \
               then echo "$(2)"; else echo "$(3)"; fi ;)
 
 # cc-option-add: Add an option to compilation flags, but only if supported.
diff --git a/tools/firmware/Rules.mk b/tools/firmware/Rules.mk
index efbbc73a45..1cbe666f5e 100644
--- a/tools/firmware/Rules.mk
+++ b/tools/firmware/Rules.mk
@@ -15,6 +15,10 @@ CFLAGS += -Werror
 
 EMBEDDED_EXTRA_CFLAGS += -fcf-protection=none
 
+# Do not add the .note.gnu.property section to any of the firmware objects: it
+# breaks the rombios binary and is not useful for firmware anyway.
+EMBEDDED_EXTRA_CFLAGS += -Wa$$(comma)-mx86-used-note=no
+
 $(call cc-options-add,CFLAGS,CC,$(EMBEDDED_EXTRA_CFLAGS))
 
 # Extra CFLAGS suitable for an embedded type of environment.
-- 
2.35.1




 


Rackspace

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