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

[Xen-devel] [RFC XEN PATCH 10/23] xen,Kbuild: Handle __OBJECT_*__


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 23 Oct 2019 17:48:24 +0100
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=anthony.perard@xxxxxxxxxx; spf=Pass smtp.mailfrom=anthony.perard@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Wed, 23 Oct 2019 17:10:42 +0000
  • Ironport-sdr: aDN0t4NhP09v2ZMQ/H814fpWXsziTIH+Ixh4gEfvb9RGEDfbpUo7rrVU3w+i2GCbUoCm4xpnwJ jJWjfhy38+KER2xVIrUNBJVRNzT0xqTWZV372cLQwY/9ZpKW/ZDWxz+fOtrtF2VD5MrbUsuPJK 63gOIBSseGQYRriOUeIv0P2tFg2SsxSf2RKn/iYJ2wDfKil7XWP5i/wTTm579PSh5v/cAFnAv7 RjFl5SRRQ9QvqlO093OqCZXyq/pUSSrRdXYKzGqGh10KqHS5UaqHesucQjb6n/Mp7h9CGNbMwi KQE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Define __OBJECT_FILE__ and __OBJECT_LABEL__ as it is done in
arch/x86/Rules.mk.

Those defines would also be created when doing an ARM build, when
Kbuild will be used to build xen.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 xen/scripts/Makefile.lib | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/xen/scripts/Makefile.lib b/xen/scripts/Makefile.lib
index 19641e836dc3..7ba3cf034c98 100644
--- a/xen/scripts/Makefile.lib
+++ b/xen/scripts/Makefile.lib
@@ -97,20 +97,12 @@ real-obj-m  := $(addprefix $(obj)/,$(real-obj-m))
 multi-used-m   := $(addprefix $(obj)/,$(multi-used-m))
 subdir-ym      := $(addprefix $(obj)/,$(subdir-ym))
 
-# Finds the multi-part object the current object will be linked into.
-# If the object belongs to two or more multi-part objects, all of them are
-# concatenated with a colon separator.
-modname-multi = $(subst $(space),:,$(sort $(foreach m,$(multi-used),\
-               $(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) 
$($(m:.o=-m))),$(m:.o=)))))
-
-modname = $(if $(modname-multi),$(modname-multi),$(basetarget))
-
-# These flags are needed for modversions and compiling, so we define them here
-# $(modname_flags) defines KBUILD_MODNAME as the name of the module it will
-# end up in (or would, if it gets compiled in)
-name-fix = $(squote)$(quote)$(subst $(comma),_,$(subst 
-,_,$1))$(quote)$(squote)
-basename_flags = -DKBUILD_BASENAME=$(call name-fix,$(basetarget))
-modname_flags  = -DKBUILD_MODNAME=$(call name-fix,$(modname))
+object_file_flags  = '-D__OBJECT_FILE__="$(subst $(obj)/,,$@)"'
+ifeq ($(findstring -DHAVE_AS_QUOTED_SYM,$(KBUILD_CFLAGS)),)
+object_file_flags += '-D__OBJECT_LABEL__=$(subst /,$$,$(subst -,_,$(@)))'
+else
+object_file_flags += '-D__OBJECT_LABEL__=$(subst -,_,$(@))'
+endif
 
 # See comment about INIT_SECTIONS_ONLY in include/xen/compiler.h
 $(filter %.init.o,$(real-obj-y) $(extra-y)): ccflags-y += -DINIT_SECTIONS_ONLY
@@ -168,13 +160,13 @@ endif
 
 c_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
                 $(_c_flags) $(modkern_cflags)                           \
-                $(basename_flags) $(modname_flags)
+                $(object_file_flags)
 
 a_flags        = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
-                $(_a_flags) $(modkern_aflags)
+                $(object_file_flags) $(_a_flags)
 
 cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
-                $(_cpp_flags)
+                $(object_file_flags) $(_cpp_flags)
 
 ld_flags       = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F))
 
-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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