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

Re: [PATCH 2/2] xen: Add CONFIG_GC_SECTIONS


  • To: Anthony PERARD <anthony@xxxxxxxxxxxxxx>
  • From: Jason Andryuk <jason.andryuk@xxxxxxx>
  • Date: Wed, 10 Dec 2025 12:08:01 -0500
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=fLeVL7ayWcVTMb4z9L6irY86uDxmPJ66naDSp/8q4Iw=; b=iq23b022SLKGdZpsJG9SuIFoysY6ZxnIylj86t9RyfeNkqUEcDIP27LdR2rFvrc7u/7hnUstSjtnPC9wDoLnZcOQ56VO7guBrQZl7YzIGHXuSeUPfW2OUPTqrHmSrrq+hK8CFC2JmRbOJrTOU6wPyAHl4WfBTzNtqHq94gSwzY7okJd1KD1jwG4lt17QOy8IOLM4Q43W8Io2b45zZcF+RZVyuQwt60P5oscxhkju1nMlEqnG1h6UeuGSFvOuOZAbWNClncVE5KeAUR0GUHduPmUA7XqKBECja5FA7psdFFNU7v4+gxnQcDNumMXahTme+GWUtORO/zkxf/OiV2qUVw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zNH379ABrs9JcV0sveeVcWK+VPxueXRjH9iytQTm4yCRd0Lcm9vESpUple6eDzck35GGB9NX1GNJlMtJ5z0pAXrCdbLgdsDG6QfySz0mxTxY6bxe3X3cWtPfb/17kU5lxsg3HrXgWiIhzs/CMgLJB45YQfwE9HVx14Il0B9eFZcABHfYb2OJANPaWD1do1cq0T8jqMOi+FZ+VxGJBTPda9nj0unVZIAOPlKGozE7CaUssmXT3bjFEOZ/yHMineNIr/0JpL31EZdKXJXQno3O/ATMvaSFyG2bdoWMGFSpPhl8EW0ilb8nsjURRFiSbBVctXRwDqd36d0U/OCcJJDAYQ==
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Victor Lira <victorm.lira@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Timothy Pearson <tpearson@xxxxxxxxxxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, "Connor Davis" <connojdavis@xxxxxxxxx>, Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Wed, 10 Dec 2025 17:08:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 2025-12-10 09:40, Anthony PERARD wrote:
On Tue, Dec 09, 2025 at 04:47:28PM -0500, Jason Andryuk wrote:
diff --git a/xen/Makefile b/xen/Makefile
index e6cf287425..aeb5dcf2ee 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -469,10 +469,13 @@ all-symbols-$(CONFIG_FAST_SYMBOL_LOOKUP) += --sort-by-name
include $(srctree)/arch/$(SRCARCH)/arch.mk +XEN_FINAL_LDFLAGS-$(CONFIG_GC_SECTIONS) := --gc-sections

Is there a good reason to add this flags after the arch-specific
makefiles? If not, could you move that just before, and right after the
definition of "$(all-symbols)" as it's a variable that is used in the
same phase of the build. (With Jan's other feedback)

No, there is no reason for its location.  I can move it.

  # define new variables to avoid the ones defined in Config.mk
  export XEN_CFLAGS := $(CFLAGS)
  export XEN_AFLAGS := $(AFLAGS)
  export XEN_LDFLAGS := $(LDFLAGS)
+export XEN_FINAL_LDFLAGS := $(LDFLAGS) $(XEN_FINAL_LDFLAGS-y)

"FINAL" isn't very descriptive. A completely wrong interpretation might
be that we should use the "final" variable instead of "XEN_LDFLAGS". How
about a name that describe where this set of flags is going to be used,
like "XEN_LDFLAGS_xen_syms" (which unfortunately doesn't exactly fit
with x86 xen.efi target), or maybe suffix it with "_target" or just
"_xen"? (In Linux build system, they use "LDFLAGS_vmlinux", but I don't
know what would be the equivalent of "vmlinux" in our build system.)

I plan to use "_xen" unless anyone objects. "_xen_lds" could be another option, but again that doesn't match efi.lds.

Hmmm - maybe my earlier xen.efi link failure was from efi.lds needing to be updated.


The prefix "XEN_" is used as namespace, with one reason described in the
comment.

I'm not sure what you mean here. Are you just pointing out that XEN_ is the prefix and not the target?

Also, could you use $(XEN_LDFLAGS) instead of $(LDFLAGS) ?

Yes.

Thanks,
Jason



 


Rackspace

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