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

Re: [XEN PATCH] libs: Fix unstable libs build on FreeBSD, auto-generate version-script


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 15 Feb 2023 16:30:43 +0100
  • 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=5E/eOlr4+msGuMlFNU60Z+RfH2+XGcrIuK0FW39cbHA=; b=PyVrIdhRiHfjf31JV6VtYPEPmFLnSWsB9bZGJLVae13w1eHm6/jvSsonLEw0ycvAUIP/8zyO6lV/rRa0MmhpsSf8Ur9I3S/q4FuvgROOVGX0YmR+WWk8ZPY432hZir7evzvAyEKAdvrldcHBqpF5pGy+ZW/rRrOTy2bfFBUkOQhqiciX3o8Z6zF6KwL+6LVSlF8uebr9sFwdDr1rMG9DlG2ARkUNIVcc8wtUcpvWphMSiJsqj/tsGX1jYLpBZE8HDUkCM3rJ0TPLivFJOa+BjmaEdTd7l1fyvhrtCXuF7pNw2dtGWcu5159uwcy+hQ5c1QQn4tHx1iCDru0MeqnsRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G+bJBoOae6PHeb/sivNiouEfZrXFht4cJLmigpHGIVtxM+4G/wE3oez9km/06DZA2pYGSk8stihVEx81xJwexHUt8BIEslW6ISReZBRBiblZIOApcSjOPQw2rSFOjD/ZnAQN1wNhSABLKp8i0DnEJUCMuok+I/YPwnWEr6Us6kS1la3A2FfJfG3Sc+e75ciIYl1RngLZmeJAJ4JLpuHLfFpbuy1MjOH3SmaXAR6DoO8BOXM2R6QR8bdvXMZgfLUaTw/rhlH4b6IUmnSAVfaijXHQ4E79sCBGVGcrSKahG5tNmFlXrI9gfGm3kVzfQverUe0T4NjtUjIcf9oetN9Gwg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 15 Feb 2023 15:31:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.02.2023 16:21, Anthony PERARD wrote:
> @@ -13,6 +14,10 @@ MAJOR := $(shell $(XEN_ROOT)/version.sh 
> $(XEN_ROOT)/xen/Makefile)
>  endif
>  MINOR ?= 0
>  
> +ifeq ($(origin version-script), undefined)
> +version-script := libxen$(LIBNAME).map.tmp
> +endif

Such a use of $(origin ...) is pretty fragile. Maybe better use ?= ?

> @@ -72,6 +77,10 @@ headers.lst: FORCE
>       @{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp
>       @$(call move-if-changed,$@.tmp,$@)
>  
> +libxen$(LIBNAME).map.tmp: FORCE
> +     echo 'VERS_$(MAJOR).$(MINOR) { global: *; };' >.$@.tmp
> +     $(call move-if-changed,.$@.tmp,$@)

Isn't this going to get in the way of your "build everything from root"
effort, where $@ will include a path? Also do we really need .tmp.tmp
files?

>  lib$(LIB_FILE_NAME).a: $(OBJS-y)

Seeing this right adjacent in context - any reason you use libxen$(LIBNAME)
and not the same lib$(LIB_FILE_NAME) for the base file name?

> @@ -120,7 +129,7 @@ TAGS:
>  clean::
>       rm -rf $(TARGETS) *~ $(DEPS_RM) $(OBJS-y) $(PIC_OBJS)
>       rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) 
> lib$(LIB_FILE_NAME).so.$(MAJOR)
> -     rm -f headers.chk headers.lst
> +     rm -f headers.chk headers.lst libxen*.map.tmp

If I hadn't checked, I'd have assumed that *.tmp are removed without
being named explicitly. So yes, I see the need for the addition, but then
I wonder why you don't also remove the .*.tmp.tmp file, which may be left
around if the build is interrupted at exactly the "right" time.

Jan



 


Rackspace

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